#include <stdint.h>
#include <stdbool.h>
#define SPIRAL_MAP_CAP 64
#define SPIRAL_LOOP_CAP 16777216
static int32_t spiral_map_key[SPIRAL_MAP_CAP];
static int32_t spiral_map_val[SPIRAL_MAP_CAP];
static int32_t spiral_map_used[SPIRAL_MAP_CAP];
static int32_t spiral_map_lookup(int32_t key) {
    int32_t i;
    for (i = 0; i < SPIRAL_MAP_CAP; i++) {
        if (spiral_map_used[i] && spiral_map_key[i] == key) return spiral_map_val[i];
    }
    return 0;
}
static int32_t spiral_map_update(int32_t key, int32_t val) {
    int32_t i;
    int32_t free_slot = -1;
    for (i = 0; i < SPIRAL_MAP_CAP; i++) {
        if (spiral_map_used[i] && spiral_map_key[i] == key) { spiral_map_val[i] = val; return 0; }
        if (!spiral_map_used[i] && free_slot < 0) free_slot = i;
    }
    if (free_slot < 0) return 1;
    spiral_map_used[free_slot] = 1;
    spiral_map_key[free_slot] = key;
    spiral_map_val[free_slot] = val;
    return 0;
}
static bool sp_method1(int32_t p0, bool p1) {
    int32_t v0 = p0;
    bool v1 = p1;
    for (int32_t spiral_trip = 0; spiral_trip < SPIRAL_LOOP_CAP; spiral_trip++) {
        int32_t v2 = 0;
        v2 = (v0 - 1);
        bool v4 = false;
        if (v1) {
            bool v3 = false;
            v3 = (v0 > 0);
            v4 = v3;
        } else {
            v4 = false;
        }
        bool v5 = false;
        v5 = (v2 == 0);
        if (v5) {
            return v4;
        } else {
            int32_t t511_2 = v2;
            bool t545_4 = v4;
            v0 = t511_2;
            v1 = t545_4;
            continue;
        }
    }
    return false;
}
static bool sp_method0(int32_t p0) {
    int32_t v0 = p0;
    bool v1 = false;
    v1 = true;
    bool v2 = false;
    v2 = (v0 == 0);
    if (v2) {
        return v1;
    } else {
        return sp_method1(v0, v1);
    }
}
static bool sp_method2(int32_t p0) {
    int32_t v0 = p0;
    bool v1 = false;
    v1 = false;
    bool v2 = false;
    v2 = (v0 == 0);
    if (v2) {
        return v1;
    } else {
        return sp_method1(v0, v1);
    }
}
static int32_t spiral_main(void) {
    int32_t v0 = 0;
    v0 = 3;
    bool v1 = false;
    v1 = sp_method0(v0);
    bool v2 = false;
    v2 = sp_method2(v0);
    if (v1) {
        if (v2) {
            return 1;
        } else {
            return 0;
        }
    } else {
        return 2;
    }
}
int main(void) {
    return spiral_main();
}
