static void continue_send(IPMIBmcExtern *ibe)

{

    if (ibe->outlen == 0) {

        goto check_reset;

    }

 send:

    ibe->outpos += qemu_chr_fe_write(ibe->chr, ibe->outbuf + ibe->outpos,

                                     ibe->outlen - ibe->outpos);

    if (ibe->outpos < ibe->outlen) {

        /* Not fully transmitted, try again in a 10ms */

        timer_mod_ns(ibe->extern_timer,

                     qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 10000000);

    } else {

        /* Sent */

        ibe->outlen = 0;

        ibe->outpos = 0;

        if (!ibe->sending_cmd) {

            ibe->waiting_rsp = true;

        } else {

            ibe->sending_cmd = false;

        }

    check_reset:

        if (ibe->connected && ibe->send_reset) {

            /* Send the reset */

            ibe->outbuf[0] = VM_CMD_RESET;

            ibe->outbuf[1] = VM_CMD_CHAR;

            ibe->outlen = 2;

            ibe->outpos = 0;

            ibe->send_reset = false;

            ibe->sending_cmd = true;

            goto send;

        }



        if (ibe->waiting_rsp) {

            /* Make sure we get a response within 4 seconds. */

            timer_mod_ns(ibe->extern_timer,

                         qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 4000000000ULL);

        }

    }

    return;

}

static void continue_send(IPMIBmcExtern *ibe)

{

    if (ibe->outlen == 0) {

        goto check_reset;

    }

 send:

    ibe->outpos += qemu_chr_fe_write(ibe->chr, ibe->outbuf + ibe->outpos,

                                     ibe->outlen - ibe->outpos);

    if (ibe->outpos < ibe->outlen) {

        

        timer_mod_ns(ibe->extern_timer,

                     qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 10000000);

    } else {

        

        ibe->outlen = 0;

        ibe->outpos = 0;

        if (!ibe->sending_cmd) {

            ibe->waiting_rsp = true;

        } else {

            ibe->sending_cmd = false;

        }

    check_reset:

        if (ibe->connected && ibe->send_reset) {

            

            ibe->outbuf[0] = VM_CMD_RESET;

            ibe->outbuf[1] = VM_CMD_CHAR;

            ibe->outlen = 2;

            ibe->outpos = 0;

            ibe->send_reset = false;

            ibe->sending_cmd = true;

            goto send;

        }



        if (ibe->waiting_rsp) {

            

            timer_mod_ns(ibe->extern_timer,

                         qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 4000000000ULL);

        }

    }

    return;

}

    ibe->outpos += qemu_chr_fe_write(ibe->chr, ibe->outbuf + ibe->outpos,                                      ibe->outlen - ibe->outpos);
static void FUNC_0(IPMIBmcExtern *VAR_0)

{

    if (VAR_0->outlen == 0) {

        goto check_reset;

    }

 send:

    VAR_0->outpos += qemu_chr_fe_write(VAR_0->chr, VAR_0->outbuf + VAR_0->outpos,

                                     VAR_0->outlen - VAR_0->outpos);

    if (VAR_0->outpos < VAR_0->outlen) {

        

        timer_mod_ns(VAR_0->extern_timer,

                     qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 10000000);

    } else {

        

        VAR_0->outlen = 0;

        VAR_0->outpos = 0;

        if (!VAR_0->sending_cmd) {

            VAR_0->waiting_rsp = true;

        } else {

            VAR_0->sending_cmd = false;

        }

    check_reset:

        if (VAR_0->connected && VAR_0->send_reset) {

            

            VAR_0->outbuf[0] = VM_CMD_RESET;

            VAR_0->outbuf[1] = VM_CMD_CHAR;

            VAR_0->outlen = 2;

            VAR_0->outpos = 0;

            VAR_0->send_reset = false;

            VAR_0->sending_cmd = true;

            goto send;

        }



        if (VAR_0->waiting_rsp) {

            

            timer_mod_ns(VAR_0->extern_timer,

                         qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 4000000000ULL);

        }

    }

    return;

}

static void FUNC_0(IPMIBmcExtern *VAR_0)
{ if (VAR_0->outlen == 0) { goto check_reset; } send:
VAR_0->outpos += qemu_chr_fe_write(VAR_0->chr, VAR_0->outbuf + VAR_0->outpos,
VAR_0->outlen - VAR_0->outpos); if (VAR_0->outpos < VAR_0->outlen) { timer_mod_ns(VAR_0->extern_timer,
qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 10000000); } else { VAR_0->outlen = 0; VAR_0->outpos = 0; if (!VAR_0->sending_cmd) { VAR_0->waiting_rsp = true; } else { VAR_0->sending_cmd = false; } check_reset:
if (VAR_0->connected && VAR_0->send_reset) { VAR_0->outbuf[0] = VM_CMD_RESET; VAR_0->outbuf[1] = VM_CMD_CHAR; VAR_0->outlen = 2; VAR_0->outpos = 0; VAR_0->send_reset = false; VAR_0->sending_cmd = true; goto send; } if (VAR_0->waiting_rsp) { timer_mod_ns(VAR_0->extern_timer,
qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 4000000000ULL); } } return; }