static void sd_response_r1_make(SDState *sd,

                                uint8_t *response, uint32_t last_status)

{

    uint32_t mask = CARD_STATUS_B ^ ILLEGAL_COMMAND;

    uint32_t status;



    status = (sd->card_status & ~mask) | (last_status & mask);

    sd->card_status &= ~CARD_STATUS_C | APP_CMD;



    response[0] = (status >> 24) & 0xff;

    response[1] = (status >> 16) & 0xff;

    response[2] = (status >> 8) & 0xff;

    response[3] = (status >> 0) & 0xff;

}

static void sd_response_r1_make(SDState *sd,

                                uint8_t *response, uint32_t last_status)

{

    uint32_t mask = CARD_STATUS_B ^ ILLEGAL_COMMAND;

    uint32_t status;



    status = (sd->card_status & ~mask) | (last_status & mask);

    sd->card_status &= ~CARD_STATUS_C | APP_CMD;



    response[0] = (status >> 24) & 0xff;

    response[1] = (status >> 16) & 0xff;

    response[2] = (status >> 8) & 0xff;

    response[3] = (status >> 0) & 0xff;

}

static void FUNC_0(SDState *VAR_0,

                                uint8_t *VAR_1, uint32_t VAR_2)

{

    uint32_t mask = CARD_STATUS_B ^ ILLEGAL_COMMAND;

    uint32_t status;



    status = (VAR_0->card_status & ~mask) | (VAR_2 & mask);

    VAR_0->card_status &= ~CARD_STATUS_C | APP_CMD;



    VAR_1[0] = (status >> 24) & 0xff;

    VAR_1[1] = (status >> 16) & 0xff;

    VAR_1[2] = (status >> 8) & 0xff;

    VAR_1[3] = (status >> 0) & 0xff;

}

static void FUNC_0(SDState *VAR_0,
uint8_t *VAR_1, uint32_t VAR_2)
{ uint32_t mask = CARD_STATUS_B ^ ILLEGAL_COMMAND; uint32_t status; status = (VAR_0->card_status & ~mask) | (VAR_2 & mask); VAR_0->card_status &= ~CARD_STATUS_C | APP_CMD; VAR_1[0] = (status >> 24) & 0xff; VAR_1[1] = (status >> 16) & 0xff; VAR_1[2] = (status >> 8) & 0xff; VAR_1[3] = (status >> 0) & 0xff; }