{"name": "Sys_ConsoleInputShutdown", "code": "int Sys_ConsoleInputShutdown ( ) { unsigned int @@v0@@ ; if ( ttycon_on ) { tty_Back ( ) ; tcsetattr ( Number , Number , & tty_tc ) ; } @@v0@@ = fcntl ( Number , Number , Number L ) ; BYTE1 ( @@v0@@ ) &= Number ; return fcntl ( Number , Number , @@v0@@ ) ; }", "source": [{"n": "v0", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "r8"}]}
{"name": "tty_Back", "code": "ssize_t tty_Back ( ) { char @@buf@@ ; @@buf@@ = Number ; write ( Number , & @@buf@@ , Number ) ; @@buf@@ = Number ; write ( Number , & @@buf@@ , Number ) ; @@buf@@ = Number ; return write ( Number , & @@buf@@ , Number ) ; }", "source": [{"n": "buf", "t": {"T": 1, "n": "char", "s": 1}, "location": "s1"}]} {"name": "Sys_Exit", "code": "void __fastcall __noreturn Sys_Exit ( int @@a1@@ ) { Sys_ConsoleInputShutdown ( ) ; exit ( @@a1@@ ) ; }", "source": [{"n": "a1", "t": {"T": 1, "n": "int", "s": 4}, "location": "r56"}]} {"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"}]}