int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,

                             int cpuid, void *opaque)

{

    struct arm_note note;

    CPUARMState *env = &ARM_CPU(cs)->env;

    DumpState *s = opaque;

    int ret, i;



    arm_note_init(&note, s, "CORE", 5, NT_PRSTATUS, sizeof(note.prstatus));



    note.prstatus.pr_pid = cpu_to_dump32(s, cpuid);



    for (i = 0; i < 16; ++i) {

        note.prstatus.pr_reg.regs[i] = cpu_to_dump32(s, env->regs[i]);

    }

    note.prstatus.pr_reg.regs[16] = cpu_to_dump32(s, cpsr_read(env));



    ret = f(&note, ARM_PRSTATUS_NOTE_SIZE, s);

    if (ret < 0) {

        return -1;

    }



    return 0;

}

int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,

                             int cpuid, void *opaque)

{

    struct arm_note note;

    CPUARMState *env = &ARM_CPU(cs)->env;

    DumpState *s = opaque;

    int ret, i;



    arm_note_init(&note, s, "CORE", 5, NT_PRSTATUS, sizeof(note.prstatus));



    note.prstatus.pr_pid = cpu_to_dump32(s, cpuid);



    for (i = 0; i < 16; ++i) {

        note.prstatus.pr_reg.regs[i] = cpu_to_dump32(s, env->regs[i]);

    }

    note.prstatus.pr_reg.regs[16] = cpu_to_dump32(s, cpsr_read(env));



    ret = f(&note, ARM_PRSTATUS_NOTE_SIZE, s);

    if (ret < 0) {

        return -1;

    }



    return 0;

}

int FUNC_0(WriteCoreDumpFunction VAR_0, CPUState *VAR_1,

                             int VAR_2, void *VAR_3)

{

    struct arm_note VAR_4;

    CPUARMState *env = &ARM_CPU(VAR_1)->env;

    DumpState *s = VAR_3;

    int VAR_5, VAR_6;



    arm_note_init(&VAR_4, s, "CORE", 5, NT_PRSTATUS, sizeof(VAR_4.prstatus));



    VAR_4.prstatus.pr_pid = cpu_to_dump32(s, VAR_2);



    for (VAR_6 = 0; VAR_6 < 16; ++VAR_6) {

        VAR_4.prstatus.pr_reg.regs[VAR_6] = cpu_to_dump32(s, env->regs[VAR_6]);

    }

    VAR_4.prstatus.pr_reg.regs[16] = cpu_to_dump32(s, cpsr_read(env));



    VAR_5 = VAR_0(&VAR_4, ARM_PRSTATUS_NOTE_SIZE, s);

    if (VAR_5 < 0) {

        return -1;

    }



    return 0;

}

int FUNC_0(WriteCoreDumpFunction VAR_0, CPUState *VAR_1,
int VAR_2, void *VAR_3)
{ struct arm_note VAR_4; CPUARMState *env = &ARM_CPU(VAR_1)->env; DumpState *s = VAR_3; int VAR_5, VAR_6; arm_note_init(&VAR_4, s, "CORE", 5, NT_PRSTATUS, sizeof(VAR_4.prstatus)); VAR_4.prstatus.pr_pid = cpu_to_dump32(s, VAR_2); for (VAR_6 = 0; VAR_6 < 16; ++VAR_6) { VAR_4.prstatus.pr_reg.regs[VAR_6] = cpu_to_dump32(s, env->regs[VAR_6]); } VAR_4.prstatus.pr_reg.regs[16] = cpu_to_dump32(s, cpsr_read(env)); VAR_5 = VAR_0(&VAR_4, ARM_PRSTATUS_NOTE_SIZE, s); if (VAR_5 < 0) { return -1; } return 0; }