{"name": "time_ms", "code": "unsigned __int64 time_ms ( ) { double @@v0@@ ; unsigned __int64 @@result@@ ; struct timeval @@tv@@ ; gettimeofday ( & @@tv@@ , Number L ) ; @@v0@@ = Number * ( double ) SLODWORD ( @@tv@@ . tv_usec ) + ( double ) SLODWORD ( @@tv@@ . tv_sec ) * Number ; if ( @@v0@@ >= Number ) @@result@@ = ( unsigned int ) ( int ) ( @@v0@@ - Number ) ^ Number ; else @@result@@ = ( unsigned int ) ( int ) @@v0@@ ; return @@result@@ ; }", "source": [{"n": "v0", "t": {"T": 1, "n": "double", "s": 8}, "location": "r496"}, {"n": "result", "t": {"T": 1, "n": "unsigned __int64", "s": 8}, "location": "r8"}, {"n": "tv", "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": "s16"}]}
{"name": "main", "code": "int __cdecl __noreturn main ( int @@argc@@ , const char * * @@argv@@ , const char * * @@envp@@ ) { int * v3 ; char * v4 ; int * v5 ; int * v6 ; char * v7 ; int * v8 ; int * v9 ; char * v10 ; int * v11 ; int * v12 ; char * v13 ; int * v14 ; int * v15 ; char * v16 ; int * v17 ; int * v18 ; char * v19 ; int * v20 ; int * v21 ; char * v22 ; int * v23 ; int v24 ; int v25 ; const char * v26 ; int * v27 ; char * v28 ; int * v29 ; char * v30 ; int @@optval@@ ; char @@v32@@ [ Number ] ; unsigned __int8 @@v33@@ ; int @@v34@@ ; unsigned int @@v35@@ ; __int64 @@v36@@ ; __int64 @@v37@@ ; char @@v38@@ [ Number ] ; int @@v39@@ ; unsigned int @@v40@@ ; __int64 @@v41@@ ; __int64 @@v42@@ ; fd_set @@readfds@@ ; fd_set @@v44@@ ; struct timeval @@timeout@@ ; socklen_t @@addr_len@@ ; struct sockaddr @@addr@@ ; struct sockaddr @@s@@ ; int @@v49@@ ; int @@v50@@ ; __int64 @@v51@@ ; unsigned int @@v52@@ ; int @@v53@@ ; int @@v54@@ ; __int64 @@v55@@ ; __int64 @@v56@@ ; int @@v57@@ ; int @@v58@@ ; int @@v59@@ ; int @@fd@@ ; int @@status@@ ; @@status@@ = Number ; @@fd@@ = Number ; @@v59@@ = Number ; @@v54@@ = Number ; @@v39@@ = Number ; @@v40@@ = Number ; @@v41@@ = Number L ; @@v42@@ = Number L ; @@v34@@ = Number ; @@v35@@ = Number ; @@v36@@ = Number L ; @@v37@@ = Number L ; if ( signal ( Number , ( __sighandler_t ) signal_handler ) == ( __sighandler_t ) Number ) puts ( String ) ; if ( signal ( Number , ( __sighandler_t ) signal_handler ) == ( __sighandler_t ) Number ) puts ( String ) ; parse_options ( @@argc@@ , ( char * const * ) @@argv@@ ) ; if ( ! uart ) uart = strdup ( String ) ; fprintf ( stderr , String , ( unsigned int ) port ) ; fprintf ( stderr , String , uart ) ; @@v54@@ = open ( uart , Number ) ; if ( @@v54@@ == Number ) { v3 = __errno_location ( ) ; v4 = strerror ( * v3 ) ; v5 = __errno_location ( ) ; fprintf ( stderr , String , ( unsigned int ) * v5 , v4 ) ; exit ( Number ) ; } if ( ( unsigned int ) set_serial_config ( ( unsigned int ) @@v54@@ , Number L , Number L , Number L ) == Number ) { v6 = __errno_location ( ) ; v7 = strerror ( * v6 ) ; v8 = __errno_location ( ) ; fprintf ( stderr , String , ( unsigned int ) * v8 , v7 ) ; goto LABEL_57 ; } if ( ( unsigned int ) gpio_init_out ( Number L ) == Number ) { v9 = __errno_location ( ) ; v10 = strerror ( * v9 ) ; v11 = __errno_location ( ) ; fprintf ( stderr , String , ( unsigned int ) * v11 , v10 ) ; goto LABEL_57 ; } @@fd@@ = socket ( Number , Number , Number ) ; if ( @@fd@@ == Number ) { v12 = __errno_location ( ) ; v13 = strerror ( * v12 ) ; v14 = __errno_location ( ) ; fprintf ( stderr , String , ( unsigned int ) * v14 , v13 ) ; goto LABEL_57 ; } @@optval@@ = Number ; if ( setsockopt ( @@fd@@ , Number , Number , & @@optval@@ , Number ) == Number ) { v15 = __errno_location ( ) ; v16 = strerror ( * v15 ) ; v17 = __errno_location ( ) ; fprintf ( stderr , String , ( unsigned int ) * v17 , v16 ) ; } memset ( & @@s@@ , Number , sizeof ( @@s@@ ) ) ; @@s@@ . sa_family = Number ; * ( _DWORD * ) & @@s@@ . sa_data [ Number ] = Number ; * ( _WORD * ) @@s@@ . sa_data = htons ( port ) ; if ( bind ( @@fd@@ , & @@s@@ , Number ) == Number ) { v18 = __errno_location ( ) ; v19 = strerror ( * v18 ) ; v20 = __errno_location ( ) ; fprintf ( stderr , String , ( unsigned int ) * v20 , v19 ) ; goto LABEL_57 ; } if ( listen ( @@fd@@ , Number ) == Number ) { v21 = __errno_location ( ) ; v22 = strerror ( * v21 ) ; v23 = __errno_location ( ) ; fprintf ( stderr , String , ( unsigned int ) * v23 , v22 ) ; goto LABEL_57 ; } memset ( & @@addr@@ , Number , sizeof ( @@addr@@ ) ) ; @@addr_len@@ = Number ; memset ( & @@v44@@ , Number , sizeof ( @@v44@@ ) ) ; @@v53@@ = Number ; @@v52@@ = ( unsigned int ) & @@timeout@@ ; @@v44@@ . fds_bits [ @@v54@@ / Number ] |= Number L << ( @@v54@@ % Number ) ; @@v44@@ . fds_bits [ @@fd@@ / Number ] |= Number L << ( @@fd@@ % Number ) ; @@v57@@ = Number ; @@v58@@ = Number ; @@v55@@ = Number L ; @@v56@@ = Number L ; while ( keep_running ) { @@v51@@ = time_ms ( ) ; if ( @@v57@@ && ( unsigned __int64 ) ( @@v51@@ - @@v55@@ ) > Number ) { send_keepalive ( ( unsigned int ) @@v54@@ ) ; @@v55@@ = @@v51@@ ; } if ( @@v56@@ && ( unsigned __int64 ) ( @@v51@@ - @@v56@@ ) > Number ) { gpio_set_value ( Number L , Number L ) ; @@v56@@ = Number L ; } @@timeout@@ . tv_sec = Number L ; @@timeout@@ . tv_usec = Number L ; @@readfds@@ = @@v44@@ ; @@v50@@ = select ( Number , & @@readfds@@ , Number L , Number L , & @@timeout@@ ) ; if ( @@v50@@ > Number ) { if ( ( @@readfds@@ . fds_bits [ @@v54@@ / Number ] & ( Number L << ( @@v54@@ % Number ) ) ) != Number ) { v24 = transfer_data ( ( unsigned int ) @@v54@@ , ( unsigned int ) @@v59@@ , @@v38@@ ) ; if ( v24 == Number ) { @@v57@@ = Number ; @@v40@@ += send_keepalive ( ( unsigned int ) @@v54@@ ) ; @@v55@@ = @@v51@@ ; } else if ( v24 == Number ) { @@v57@@ = Number ; } } if ( @@v58@@ && ( @@readfds@@ . fds_bits [ @@v59@@ / Number ] & ( Number L << ( @@v59@@ % Number ) ) ) != Number ) { v25 = transfer_data ( ( unsigned int ) @@v59@@ , ( unsigned int ) @@v54@@ , @@v32@@ ) ; if ( v25 == Number ) { if ( @@v33@@ ) v26 = String ; else v26 = String ; fprintf ( stderr , String , v26 ) ; if ( @@v57@@ != @@v33@@ ) { gpio_set_value ( Number L , Number L ) ; @@v56@@ = @@v51@@ ; } } else if ( v25 == Number ) { fprintf ( stderr , String , ( unsigned int ) @@v59@@ ) ; @@v44@@ . fds_bits [ @@v59@@ / Number ] &= ~ ( Number L << ( @@v59@@ % Number ) ) ; close ( @@v59@@ ) ; @@v59@@ = Number ; @@v58@@ = Number ; client_addr = Number ; } } if ( ( @@readfds@@ . fds_bits [ @@fd@@ / Number ] & ( Number L << ( @@fd@@ % Number ) ) ) != Number ) { @@v49@@ = accept ( @@fd@@ , & @@addr@@ , & @@addr_len@@ ) ; if ( @@v49@@ == Number ) { v27 = __errno_location ( ) ; v28 = strerror ( * v27 ) ; v29 = __errno_location ( ) ; fprintf ( stderr , String , ( unsigned int ) * v29 , v28 ) ; goto LABEL_57 ; } v30 = inet_ntoa ( * ( struct in_addr * ) & @@addr@@ . sa_data [ Number ] ) ; fprintf ( stderr , String , v30 ) ; if ( @@v58@@ ) { if ( * ( _DWORD * ) & @@addr@@ . sa_data [ Number ] == client_addr ) { fprintf ( stderr , String , ( unsigned int ) @@v59@@ , ( unsigned int ) @@v49@@ ) ; @@v44@@ . fds_bits [ @@v59@@ / Number ] &= ~ ( Number L << ( @@v59@@ % Number ) ) ; close ( @@v59@@ ) ; @@v59@@ = @@v49@@ ; @@v44@@ . fds_bits [ @@v49@@ / Number ] |= Number L << ( @@v49@@ % Number ) ; } else { fwrite ( String , Number , Number , stderr ) ; close ( @@v49@@ ) ; } } else { fprintf ( stderr , String , ( unsigned int ) @@v49@@ ) ; @@v59@@ = @@v49@@ ; client_addr = * ( _DWORD * ) & @@addr@@ . sa_data [ Number ] ; @@v44@@ . fds_bits [ @@v49@@ / Number ] |= Number L << ( @@v49@@ % Number ) ; @@v58@@ = Number ; } } usleep ( Number ) ; } } fwrite ( String , Number , Number , stderr ) ; @@status@@ = Number ; LABEL_57 : close ( @@v54@@ ) ; close ( @@v59@@ ) ; close ( @@fd@@ ) ; if ( uart ) free ( uart ) ; fprintf ( stderr , String , @@v41@@ , @@v36@@ ) ; fprintf ( stderr , String , @@v42@@ , @@v37@@ ) ; fprintf ( stderr , String , @@v40@@ , @@v35@@ ) ; exit ( @@status@@ ) ; }", "source": [{"n": "envp", "t": {"T": 3, "t": "const char *"}, "location": "r16"}, {"n": "argc", "t": {"T": 1, "n": "int", "s": 4}, "location": "r56"}, {"n": "argv", "t": {"T": 3, "t": "const char *"}, "location": "r64"}, {"n": "s", "t": {"T": 6, "n": "struct sockaddr", "l": [{"T": 4, "n": "sa_family", "t": "sa_family_t", "s": 2}, {"T": 4, "n": "sa_data", "t": "char[14]", "s": 14}]}, "location": "s112"}, {"n": "addr", "t": {"T": 6, "n": "struct sockaddr", "l": [{"T": 4, "n": "sa_family", "t": "sa_family_t", "s": 2}, {"T": 4, "n": "sa_data", "t": "char[14]", "s": 14}]}, "location": "s128"}, {"n": "addr_len", "t": {"T": 1, "n": "socklen_t", "s": 4}, "location": "s132"}, {"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": "s160"}, {"n": "status", "t": {"T": 1, "n": "int", "s": 4}, "location": "s20"}, {"n": "fd", "t": {"T": 1, "n": "int", "s": 4}, "location": "s24"}, {"n": "v38", "t": {"T": 2, "n": 2048, "s": 1, "t": "char"}, "location": "s2496"}, {"n": "v37", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s2512"}, {"n": "v36", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s2520"}, {"n": "v35", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "s2524"}, {"n": "v34", "t": {"T": 1, "n": "int", "s": 4}, "location": "s2528"}, {"n": "v59", "t": {"T": 1, "n": "int", "s": 4}, "location": "s28"}, {"n": "v44", "t": {"T": 6, "n": "fd_set", "l": [{"T": 4, "n": "fds_bits", "t": "__fd_mask[16]", "s": 128}]}, "location": "s288"}, {"n": "v58", "t": {"T": 1, "n": "int", "s": 4}, "location": "s32"}, {"n": "v57", "t": {"T": 1, "n": "int", "s": 4}, "location": "s36"}, {"n": "readfds", "t": {"T": 6, "n": "fd_set", "l": [{"T": 4, "n": "fds_bits", "t": "__fd_mask[16]", "s": 128}]}, "location": "s416"}, {"n": "v42", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s432"}, {"n": "v41", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s440"}, {"n": "v40", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "s444"}, {"n": "v39", "t": {"T": 1, "n": "int", "s": 4}, "location": "s448"}, {"n": "v33", "t": {"T": 1, "n": "unsigned __int8", "s": 1}, "location": "s4574"}, {"n": "v32", "t": {"T": 2, "n": 2, "s": 1, "t": "char"}, "location": "s4576"}, {"n": "optval", "t": {"T": 1, "n": "int", "s": 4}, "location": "s4580"}, {"n": "v56", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s48"}, {"n": "v55", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s56"}, {"n": "v54", "t": {"T": 1, "n": "int", "s": 4}, "location": "s60"}, {"n": "v53", "t": {"T": 1, "n": "int", "s": 4}, "location": "s64"}, {"n": "v52", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "s68"}, {"n": "v51", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s80"}, {"n": "v50", "t": {"T": 1, "n": "int", "s": 4}, "location": "s84"}, {"n": "v49", "t": {"T": 1, "n": "int", "s": 4}, "location": "s88"}]}