{"name": "Sys_GetEvent", "code": "_QWORD * __fastcall Sys_GetEvent ( _QWORD * @@a1@@ ) { __int64 v1 ; __int64 v2 ; __int64 v3 ; _QWORD * v4 ; __int64 v5 ; __int64 v6 ; __int64 v7 ; __int64 v8 ; __int64 v9 ; __int64 v10 ; __int64 @@v12@@ [ Number ] ; char @@v13@@ [ Number ] ; void * @@src@@ ; int @@v15@@ ; __int64 @@v16@@ [ Number ] ; _QWORD * @@v17@@ ; int @@v18@@ ; char * @@dest@@ ; char * @@s@@ ; int @@v21@@ ; if ( eventHead <= ( unsigned int ) eventTail ) { @@s@@ = Sys_ConsoleInput ( ) ; if ( @@s@@ ) { @@v21@@ = strlen ( @@s@@ ) + Number ; @@dest@@ = ( char * ) Z_Malloc ( ( unsigned int ) @@v21@@ ) ; if ( @@v21@@ > Number && ( * @@s@@ == Number || * @@s@@ == Number ) ) { strcpy ( @@dest@@ , @@s@@ + Number ) ; -- @@v21@@ ; } else { strcpy ( @@dest@@ , @@s@@ ) ; } Sys_QueEvent ( Number , Number , Number , Number , @@v21@@ , ( __int64 ) @@dest@@ ) ; } MSG_Init ( @@v13@@ , sys_packetReceived , Number ) ; if ( ( unsigned int ) Sys_GetPacket ( @@v12@@ , @@v13@@ ) ) { @@v18@@ = @@v15@@ + Number ; v4 = ( _QWORD * ) Z_Malloc ( ( unsigned int ) ( @@v15@@ + Number ) ) ; @@v17@@ = v4 ; v5 = @@v12@@ [ Number ] ; * v4 = @@v12@@ [ Number ] ; v4 [ Number ] = v5 ; v6 = @@v12@@ [ Number ] ; v4 [ Number ] = @@v12@@ [ Number ] ; v4 [ Number ] = v6 ; v4 [ Number ] = @@v12@@ [ Number ] ; memcpy ( @@v17@@ + Number , @@src@@ , @@v15@@ ) ; Sys_QueEvent ( Number , Number , Number , Number , @@v18@@ , ( __int64 ) @@v17@@ ) ; } if ( eventHead <= ( unsigned int ) eventTail ) { memset ( @@v16@@ , Number , sizeof ( @@v16@@ ) ) ; LODWORD ( @@v16@@ [ Number ] ) = Sys_Milliseconds ( ) ; v10 = @@v16@@ [ Number ] ; * @@a1@@ = @@v16@@ [ Number ] ; @@a1@@ [ Number ] = v10 ; v9 = @@v16@@ [ Number ] ; @@a1@@ [ Number ] = @@v16@@ [ Number ] ; } else { v7 = Number L * ( unsigned __int8 ) eventTail ++ ; v8 = * ( _QWORD * ) & eventQue [ v7 + Number ] ; * @@a1@@ = * ( _QWORD * ) & eventQue [ v7 ] ; @@a1@@ [ Number ] = v8 ; v9 = * ( _QWORD * ) & eventQue [ v7 + Number ] ; @@a1@@ [ Number ] = * ( _QWORD * ) & eventQue [ v7 + Number ] ; } @@a1@@ [ Number ] = v9 ; } else { v1 = Number L * ( unsigned __int8 ) eventTail ++ ; v2 = * ( _QWORD * ) & eventQue [ v1 + Number ] ; * @@a1@@ = * ( _QWORD * ) & eventQue [ v1 ] ; @@a1@@ [ Number ] = v2 ; v3 = * ( _QWORD * ) & eventQue [ v1 + Number ] ; @@a1@@ [ Number ] = * ( _QWORD * ) & eventQue [ v1 + Number ] ; @@a1@@ [ Number ] = v3 ; } return @@a1@@ ; }", "source": [{"n": "a1", "t": {"T": 3, "t": "_QWORD"}, "location": "r56"}, {"n": "v15", "t": {"T": 1, "n": "int", "s": 4}, "location": "s116"}, {"n": "src", "t": {"T": 3, "t": "void"}, "location": "s128"}, {"n": "v13", "t": {"T": 2, "n": 16, "s": 1, "t": "char"}, "location": "s144"}, {"n": "v12", "t": {"T": 2, "n": 6, "s": 8, "t": "__int64"}, "location": "s192"}, {"n": "v21", "t": {"T": 1, "n": "int", "s": 4}, "location": "s20"}, {"n": "s", "t": {"T": 3, "t": "char"}, "location": "s32"}, {"n": "dest", "t": {"T": 3, "t": "char"}, "location": "s40"}, {"n": "v18", "t": {"T": 1, "n": "int", "s": 4}, "location": "s44"}, {"n": "v17", "t": {"T": 3, "t": "_QWORD"}, "location": "s56"}, {"n": "v16", "t": {"T": 2, "n": 4, "s": 8, "t": "__int64"}, "location": "s96"}]}
{"name": "Sys_ConsoleInput", "code": "char * Sys_ConsoleInput ( ) { char * @@result@@ ; __int64 v1 ; char * v2 ; char * v3 ; int * @@v4@@ ; int * v5 ; fd_set @@readfds@@ ; struct timeval @@timeout@@ ; char @@buf@@ ; char * @@v9@@ ; int @@v10@@ ; int @@v11@@ ; unsigned int @@v12@@ ; int @@v13@@ ; if ( ! ttycon_on ) { if ( ! com_dedicated || ! * ( _DWORD * ) ( com_dedicated + Number L ) ) return Number L ; if ( ! stdin_active ) return Number L ; memset ( & @@readfds@@ , Number , sizeof ( @@readfds@@ ) ) ; @@v13@@ = Number ; @@v12@@ = ( unsigned int ) & @@timeout@@ ; @@readfds@@ . fds_bits [ Number ] |= Number ; @@timeout@@ . tv_sec = Number L ; @@timeout@@ . tv_usec = Number L ; if ( select ( Number , & @@readfds@@ , Number L , Number L , & @@timeout@@ ) == Number || ( @@readfds@@ . fds_bits [ Number ] & Number ) == Number ) return Number L ; @@v11@@ = read ( Number , text_8197 , Number ) ; if ( @@v11@@ ) { if ( @@v11@@ > Number ) { text_8197 [ @@v11@@ - Number ] = Number ; @@result@@ = text_8197 ; } else { @@result@@ = Number L ; } } else { stdin_active = Number ; @@result@@ = Number L ; } return @@result@@ ; } @@v10@@ = read ( Number , & @@buf@@ , Number ) ; if ( @@v10@@ == Number ) return Number L ; if ( @@buf@@ == tty_erase || @@buf@@ == Number || @@buf@@ == Number ) { if ( tty_con > Number ) { byte_1C0C [ -- tty_con ] = Number ; tty_Back ( ) ; } return Number L ; } if ( ! @@buf@@ || @@buf@@ > Number ) { if ( ( unsigned int ) tty_con > Number ) return Number L ; byte_1C0C [ tty_con ++ ] = @@buf@@ ; write ( Number , & @@buf@@ , Number ) ; return Number L ; } if ( @@buf@@ == Number ) { Hist_Add ( & tty_con ) ; Q_strncpyz ( text_8197 , byte_1C0C , Number L ) ; Field_Clear ( & tty_con ) ; @@buf@@ = Number ; write ( Number , & @@buf@@ , Number ) ; write ( Number , & unk_4FC0 , Number ) ; return text_8197 ; } if ( @@buf@@ == Number ) { tty_Hide ( ) ; Field_AutoComplete ( & tty_con ) ; tty_Show ( & tty_con , & @@buf@@ , v1 ) ; return Number L ; } @@v10@@ = read ( Number , & @@buf@@ , Number ) ; if ( @@v10@@ == Number || @@buf@@ != Number && @@buf@@ != Number ) goto LABEL_32 ; v2 = & @@buf@@ ; @@v10@@ = read ( Number , & @@buf@@ , Number ) ; if ( @@v10@@ == Number || @@buf@@ > Number ) goto LABEL_32 ; if ( @@buf@@ >= Number ) return Number L ; if ( @@buf@@ == Number ) { @@v9@@ = Hist_Prev ( ) ; if ( @@v9@@ ) { tty_Hide ( ) ; qmemcpy ( & tty_con , @@v9@@ , Number ) ; v3 = @@v9@@ + Number ; * ( & tty_con + Number ) = * ( ( _DWORD * ) @@v9@@ + Number ) ; tty_Show ( & tty_con + Number , v3 , & tty_con + Number ) ; } tty_FlushIn ( ) ; @@result@@ = Number L ; } else { if ( @@buf@@ != Number ) { LABEL_32 : Com_DPrintf ( String , ( unsigned int ) @@buf@@ , ( unsigned int ) tty_erase ) ; tty_FlushIn ( ) ; return Number L ; } @@v9@@ = Hist_Next ( ) ; tty_Hide ( ) ; if ( @@v9@@ ) { qmemcpy ( & tty_con , @@v9@@ , Number ) ; v2 = @@v9@@ + Number ; @@v4@@ = & tty_con + Number ; * ( & tty_con + Number ) = * ( ( _DWORD * ) @@v9@@ + Number ) ; v5 = & tty_con + Number ; } else { @@v4@@ = & tty_con ; Field_Clear ( & tty_con ) ; } tty_Show ( @@v4@@ , v2 , v5 ) ; tty_FlushIn ( ) ; @@result@@ = Number L ; } return @@result@@ ; }", "source": [{"n": "v4", "t": {"T": 3, "t": "int"}, "location": "r56"}, {"n": "result", "t": {"T": 3, "t": "char"}, "location": "r8"}, {"n": "v11", "t": {"T": 1, "n": "int", "s": 4}, "location": "s12"}, {"n": "v10", "t": {"T": 1, "n": "int", "s": 4}, "location": "s16"}, {"n": "readfds", "t": {"T": 6, "n": "fd_set", "l": [{"T": 4, "n": "fds_bits", "t": "__fd_mask[16]", "s": 128}]}, "location": "s176"}, {"n": "v9", "t": {"T": 3, "t": "char"}, "location": "s24"}, {"n": "buf", "t": {"T": 1, "n": "char", "s": 1}, "location": "s25"}, {"n": "v13", "t": {"T": 1, "n": "int", "s": 4}, "location": "s4"}, {"n": "timeout", "t": {"T": 6, "n": "struct timeval", "l": [{"T": 4, "n": "tv_sec", "t": "__time_t", "s": 8}, {"T": 4, "n": "tv_usec", "t": "__suseconds_t", "s": 8}]}, "location": "s48"}, {"n": "v12", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "s8"}]} {"name": "Sys_QueEvent", "code": "char * __fastcall Sys_QueEvent ( unsigned int @@a1@@ , unsigned int @@a2@@ , int @@a3@@ , int @@a4@@ , int @@a5@@ , __int64 @@a6@@ ) { char * @@result@@ ; unsigned int @@v11@@ ; char * v12 ; char * v13 ; @@v11@@ = @@a1@@ ; if ( @@a2@@ == Number && ( v12 = & eventQue [ Number * ( unsigned __int8 ) ( eventHead - Number ) ] , * ( ( _DWORD * ) v12 + Number ) == Number ) ) { if ( eventTail == eventHead && eventTail ) { * ( ( _DWORD * ) v12 + Number ) = Number ; * ( ( _DWORD * ) v12 + Number ) = Number ; -- eventTail ; } if ( ! @@a1@@ ) @@v11@@ = Sys_Milliseconds ( ) ; * ( ( _DWORD * ) v12 + Number ) += @@a3@@ ; * ( ( _DWORD * ) v12 + Number ) += @@a4@@ ; @@result@@ = v12 ; * ( _DWORD * ) v12 = @@v11@@ ; } else { v13 = & eventQue [ Number * ( unsigned __int8 ) eventHead ] ; if ( ( unsigned int ) ( eventHead - eventTail ) > Number ) { Com_Printf ( String , @@a1@@ , @@a2@@ ) ; if ( * ( ( _QWORD * ) v13 + Number ) ) Z_Free ( * ( ( _QWORD * ) v13 + Number ) ) ; ++ eventTail ; } ++ eventHead ; if ( ! @@a1@@ ) @@v11@@ = Sys_Milliseconds ( ) ; * ( _DWORD * ) v13 = @@v11@@ ; * ( ( _DWORD * ) v13 + Number ) = @@a2@@ ; * ( ( _DWORD * ) v13 + Number ) = @@a3@@ ; * ( ( _DWORD * ) v13 + Number ) = @@a4@@ ; * ( ( _DWORD * ) v13 + Number ) = @@a5@@ ; @@result@@ = v13 ; * ( ( _QWORD * ) v13 + Number ) = @@a6@@ ; } return @@result@@ ; }", "source": [{"n": "a3", "t": {"T": 1, "n": "int", "s": 4}, "location": "r16"}, {"n": "a4", "t": {"T": 1, "n": "int", "s": 4}, "location": "r24"}, {"n": "a1", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "r64"}, {"n": "a5", "t": {"T": 1, "n": "int", "s": 4}, "location": "r72"}, {"n": "result", "t": {"T": 3, "t": "char"}, "location": "r8"}, {"n": "a6", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r80"}, {"n": "v11", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "s20"}]}