void gdb_register_coprocessor(CPUState * env,

                             gdb_reg_cb get_reg, gdb_reg_cb set_reg,

                             int num_regs, const char *xml, int g_pos)

{

    GDBRegisterState *s;

    GDBRegisterState **p;

    static int last_reg = NUM_CORE_REGS;



    s = (GDBRegisterState *)g_malloc0(sizeof(GDBRegisterState));

    s->base_reg = last_reg;

    s->num_regs = num_regs;

    s->get_reg = get_reg;

    s->set_reg = set_reg;

    s->xml = xml;

    p = &env->gdb_regs;

    while (*p) {

        /* Check for duplicates.  */

        if (strcmp((*p)->xml, xml) == 0)

            return;

        p = &(*p)->next;

    }

    /* Add to end of list.  */

    last_reg += num_regs;

    *p = s;

    if (g_pos) {

        if (g_pos != s->base_reg) {

            fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n"

                    "Expected %d got %d\n", xml, g_pos, s->base_reg);

        } else {

            num_g_regs = last_reg;

        }

    }

}

void gdb_register_coprocessor(CPUState * env,

                             gdb_reg_cb get_reg, gdb_reg_cb set_reg,

                             int num_regs, const char *xml, int g_pos)

{

    GDBRegisterState *s;

    GDBRegisterState **p;

    static int last_reg = NUM_CORE_REGS;



    s = (GDBRegisterState *)g_malloc0(sizeof(GDBRegisterState));

    s->base_reg = last_reg;

    s->num_regs = num_regs;

    s->get_reg = get_reg;

    s->set_reg = set_reg;

    s->xml = xml;

    p = &env->gdb_regs;

    while (*p) {

        

        if (strcmp((*p)->xml, xml) == 0)

            return;

        p = &(*p)->next;

    }

    

    last_reg += num_regs;

    *p = s;

    if (g_pos) {

        if (g_pos != s->base_reg) {

            fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n"

                    "Expected %d got %d\n", xml, g_pos, s->base_reg);

        } else {

            num_g_regs = last_reg;

        }

    }

}

    s = (GDBRegisterState *)g_malloc0(sizeof(GDBRegisterState));     s->base_reg = last_reg;     s->num_regs = num_regs;     s->get_reg = get_reg;     s->set_reg = set_reg;     s->xml = xml;
void FUNC_0(CPUState * VAR_0,

                             gdb_reg_cb VAR_1, gdb_reg_cb VAR_2,

                             int VAR_3, const char *VAR_4, int VAR_5)

{

    GDBRegisterState *s;

    GDBRegisterState **p;

    static int VAR_6 = NUM_CORE_REGS;



    s = (GDBRegisterState *)g_malloc0(sizeof(GDBRegisterState));

    s->base_reg = VAR_6;

    s->VAR_3 = VAR_3;

    s->VAR_1 = VAR_1;

    s->VAR_2 = VAR_2;

    s->VAR_4 = VAR_4;

    p = &VAR_0->gdb_regs;

    while (*p) {

        

        if (strcmp((*p)->VAR_4, VAR_4) == 0)

            return;

        p = &(*p)->next;

    }

    

    VAR_6 += VAR_3;

    *p = s;

    if (VAR_5) {

        if (VAR_5 != s->base_reg) {

            fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n"

                    "Expected %d got %d\n", VAR_4, VAR_5, s->base_reg);

        } else {

            num_g_regs = VAR_6;

        }

    }

}

void FUNC_0(CPUState * VAR_0,
gdb_reg_cb VAR_1, gdb_reg_cb VAR_2,
int VAR_3, const char *VAR_4, int VAR_5)
{ GDBRegisterState *s; GDBRegisterState **p; static int VAR_6 = NUM_CORE_REGS; s = (GDBRegisterState *)g_malloc0(sizeof(GDBRegisterState)); s->base_reg = VAR_6; s->VAR_3 = VAR_3; s->VAR_1 = VAR_1; s->VAR_2 = VAR_2; s->VAR_4 = VAR_4; p = &VAR_0->gdb_regs; while (*p) { if (strcmp((*p)->VAR_4, VAR_4) == 0)
return; p = &(*p)->next; } VAR_6 += VAR_3; *p = s; if (VAR_5) { if (VAR_5 != s->base_reg) { fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n"
"Expected %d got %d\n", VAR_4, VAR_5, s->base_reg); } else { num_g_regs = VAR_6; } } }