if(SSL_get_shutdown(machine->ssl)) {  if(buffer_empty(&machine->dirty_out)) {  if(!state_machine_close_dirty(machine)) return 0; }
if(SSL_get_app_data(machine->ssl) || (SSL_get_shutdown(machine->ssl) && buffer_empty(&machine->dirty_out))) {  if(!state_machine_close_dirty(machine)) return 0;
int state_machine_churn(state_machine_t *machine){	unsigned int loop;	/* Do this loop twice to cover any dependencies about which precise	 * order of reads and writes is required. */	for(loop = 0; loop < 2; loop++) {		buffer_to_SSL(&machine->clean_in, machine->ssl);		buffer_to_BIO(&machine->dirty_in, machine->bio_intossl);		buffer_from_SSL(&machine->clean_out, machine->ssl);		buffer_from_BIO(&machine->dirty_out, machine->bio_fromssl);	}	if(machine->ssl == NULL) {		if(buffer_empty(&machine->clean_out))			/* Time to close this state-machine altogether */			return 0;		else			/* Still buffered data on the clean side to go out */			return 1;	}	if(SSL_get_shutdown(machine->ssl)) {		/* An SSL shutdown was underway */		if(buffer_empty(&machine->dirty_out)) {			/* Great, we can seal off the dirty side completely */			if(!state_machine_close_dirty(machine))				return 0;		}	}	/* Either the SSL is alive and well, or the closing process still has	 * outgoing data waiting to be sent */	return 1;}