static void main_loop(void)

{

    bool nonblocking;

    int last_io __attribute__ ((unused)) = 0;

#ifdef CONFIG_PROFILER

    int64_t ti;

#endif

    int r;



    qemu_main_loop_start();



    for (;;) {

#ifdef CONFIG_IOTHREAD

        nonblocking = !kvm_enabled() && last_io > 0;

#else

        nonblocking = cpu_exec_all();

        if (vm_request_pending()) {

            nonblocking = true;

        }

#endif

#ifdef CONFIG_PROFILER

        ti = profile_getclock();

#endif

        last_io = main_loop_wait(nonblocking);

#ifdef CONFIG_PROFILER

        dev_time += profile_getclock() - ti;

#endif



        if (qemu_debug_requested()) {

            vm_stop(VMSTOP_DEBUG);

        }

        if (qemu_shutdown_requested()) {

            qemu_kill_report();

            monitor_protocol_event(QEVENT_SHUTDOWN, NULL);

            if (no_shutdown) {

                vm_stop(VMSTOP_SHUTDOWN);

            } else

                break;

        }

        if (qemu_reset_requested()) {

            pause_all_vcpus();

            cpu_synchronize_all_states();

            qemu_system_reset(VMRESET_REPORT);

            resume_all_vcpus();

        }

        if (qemu_powerdown_requested()) {

            monitor_protocol_event(QEVENT_POWERDOWN, NULL);

            qemu_irq_raise(qemu_system_powerdown);

        }

        if ((r = qemu_vmstop_requested())) {

            vm_stop(r);

        }

    }

    bdrv_close_all();

    pause_all_vcpus();

}

static void main_loop(void)

{

    bool nonblocking;

    int last_io __attribute__ ((unused)) = 0;

#ifdef CONFIG_PROFILER

    int64_t ti;

#endif

    int r;



    qemu_main_loop_start();



    for (;;) {

#ifdef CONFIG_IOTHREAD

        nonblocking = !kvm_enabled() && last_io > 0;

#else

        nonblocking = cpu_exec_all();

        if (vm_request_pending()) {

            nonblocking = true;

        }

#endif

#ifdef CONFIG_PROFILER

        ti = profile_getclock();

#endif

        last_io = main_loop_wait(nonblocking);

#ifdef CONFIG_PROFILER

        dev_time += profile_getclock() - ti;

#endif



        if (qemu_debug_requested()) {

            vm_stop(VMSTOP_DEBUG);

        }

        if (qemu_shutdown_requested()) {

            qemu_kill_report();

            monitor_protocol_event(QEVENT_SHUTDOWN, NULL);

            if (no_shutdown) {

                vm_stop(VMSTOP_SHUTDOWN);

            } else

                break;

        }

        if (qemu_reset_requested()) {

            pause_all_vcpus();

            cpu_synchronize_all_states();

            qemu_system_reset(VMRESET_REPORT);

            resume_all_vcpus();

        }

        if (qemu_powerdown_requested()) {

            monitor_protocol_event(QEVENT_POWERDOWN, NULL);

            qemu_irq_raise(qemu_system_powerdown);

        }

        if ((r = qemu_vmstop_requested())) {

            vm_stop(r);

        }

    }

    bdrv_close_all();

    pause_all_vcpus();

}

#ifdef CONFIG_IOTHREAD #endif #ifdef CONFIG_IOTHREAD #endif #endif #ifdef CONFIG_IOTHREAD #else #endif #ifdef CONFIG_IOTHREAD #else #endif #ifdef CONFIG_IOTHREAD #endif     int r; #else #endif #endif #endif #ifdef CONFIG_IOTHREAD #else #endif #endif #ifdef CONFIG_IOTHREAD #endif #endif #endif #ifdef CONFIG_IOTHREAD #else         nonblocking = cpu_exec_all();         if (vm_request_pending()) {             nonblocking = true; #endif
static void FUNC_0(void)

{

    bool nonblocking;

    int VAR_0 __attribute__ ((unused)) = 0;

#ifdef CONFIG_PROFILER

    int64_t ti;

#endif

    int VAR_1;



    qemu_main_loop_start();



    for (;;) {

#ifdef CONFIG_IOTHREAD

        nonblocking = !kvm_enabled() && VAR_0 > 0;

#else

        nonblocking = cpu_exec_all();

        if (vm_request_pending()) {

            nonblocking = true;

        }

#endif

#ifdef CONFIG_PROFILER

        ti = profile_getclock();

#endif

        VAR_0 = main_loop_wait(nonblocking);

#ifdef CONFIG_PROFILER

        dev_time += profile_getclock() - ti;

#endif



        if (qemu_debug_requested()) {

            vm_stop(VMSTOP_DEBUG);

        }

        if (qemu_shutdown_requested()) {

            qemu_kill_report();

            monitor_protocol_event(QEVENT_SHUTDOWN, NULL);

            if (no_shutdown) {

                vm_stop(VMSTOP_SHUTDOWN);

            } else

                break;

        }

        if (qemu_reset_requested()) {

            pause_all_vcpus();

            cpu_synchronize_all_states();

            qemu_system_reset(VMRESET_REPORT);

            resume_all_vcpus();

        }

        if (qemu_powerdown_requested()) {

            monitor_protocol_event(QEVENT_POWERDOWN, NULL);

            qemu_irq_raise(qemu_system_powerdown);

        }

        if ((VAR_1 = qemu_vmstop_requested())) {

            vm_stop(VAR_1);

        }

    }

    bdrv_close_all();

    pause_all_vcpus();

}

static void FUNC_0(void)
{ bool nonblocking; int VAR_0 __attribute__ ((unused)) = 0; #ifdef CONFIG_PROFILER
int64_t ti; #endif
int VAR_1; qemu_main_loop_start(); for (;;) { #ifdef CONFIG_IOTHREAD
nonblocking = !kvm_enabled() && VAR_0 > 0; #else
nonblocking = cpu_exec_all(); if (vm_request_pending()) { nonblocking = true; } #endif
#ifdef CONFIG_PROFILER
ti = profile_getclock(); #endif
VAR_0 = main_loop_wait(nonblocking); #ifdef CONFIG_PROFILER
dev_time += profile_getclock() - ti; #endif
if (qemu_debug_requested()) { vm_stop(VMSTOP_DEBUG); } if (qemu_shutdown_requested()) { qemu_kill_report(); monitor_protocol_event(QEVENT_SHUTDOWN, NULL); if (no_shutdown) { vm_stop(VMSTOP_SHUTDOWN); } else break; } if (qemu_reset_requested()) { pause_all_vcpus(); cpu_synchronize_all_states(); qemu_system_reset(VMRESET_REPORT); resume_all_vcpus(); } if (qemu_powerdown_requested()) { monitor_protocol_event(QEVENT_POWERDOWN, NULL); qemu_irq_raise(qemu_system_powerdown); } if ((VAR_1 = qemu_vmstop_requested())) { vm_stop(VAR_1); } } bdrv_close_all(); pause_all_vcpus(); }