diff --git a/fc-solve/source/.clang-format b/fc-solve/source/.clang-format
index 88fdace50..a7dd68df9 100644
--- a/fc-solve/source/.clang-format
+++ b/fc-solve/source/.clang-format
@@ -4,3 +4,5 @@ AlignAfterOpenBracket: DontAlign
 BreakBeforeBraces: Allman
 IndentWidth:     4
 SortIncludes:    false
+BraceWrapping:
+    AfterExternBlock: false
diff --git a/fc-solve/source/alloc_wrap.h b/fc-solve/source/alloc_wrap.h
index 0b5f5d529..3a52f4b03 100644
--- a/fc-solve/source/alloc_wrap.h
+++ b/fc-solve/source/alloc_wrap.h
@@ -11,7 +11,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include <stdlib.h>
diff --git a/fc-solve/source/cl_callback.h b/fc-solve/source/cl_callback.h
index fe3f9a4f8..16a0c9396 100644
--- a/fc-solve/source/cl_callback.h
+++ b/fc-solve/source/cl_callback.h
@@ -245,7 +245,8 @@ static freecell_solver_str_t known_parameters[] = {"-h", "--help",
     "--display-parent-iter", "-sel", "--show-exceeded-limits", "-o", "--output",
     "--reset", "--version", NULL};
 
-typedef enum {
+typedef enum
+{
     SUCCESS = 0,
     ERROR = -1,
 } exit_code_t;
diff --git a/fc-solve/source/dbm_cache.h b/fc-solve/source/dbm_cache.h
index bbe8d6e08..309478e63 100644
--- a/fc-solve/source/dbm_cache.h
+++ b/fc-solve/source/dbm_cache.h
@@ -13,7 +13,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "meta_alloc.h"
@@ -25,39 +26,39 @@ extern "C" {
 #include "dbm_calc_derived_iface.h"
 #include "dbm_lru_cache.h"
 
-static int fc_solve_compare_lru_cache_keys(const void *const void_a,
-    const void *const void_b, void *context GCC_UNUSED)
-{
+    static int fc_solve_compare_lru_cache_keys(const void *const void_a,
+        const void *const void_b, void *context GCC_UNUSED)
+    {
 #define GET_PARAM(p) ((((const fcs_cache_key_info_t *)(p))->key))
-    return memcmp(
-        &(GET_PARAM(void_a)), &(GET_PARAM(void_b)), sizeof(GET_PARAM(void_a)));
+        return memcmp(&(GET_PARAM(void_a)), &(GET_PARAM(void_b)),
+            sizeof(GET_PARAM(void_a)));
 #undef GET_PARAM
-}
+    }
 
-static inline void cache_destroy_key(fcs_cache_key_info_t *cache_key)
-{
-    for (; cache_key; cache_key = RECYCLE_BIN_NEXT(cache_key))
+    static inline void cache_destroy_key(fcs_cache_key_info_t *cache_key)
     {
-        free(cache_key->moves_to_key);
-        cache_key->moves_to_key = NULL;
+        for (; cache_key; cache_key = RECYCLE_BIN_NEXT(cache_key))
+        {
+            free(cache_key->moves_to_key);
+            cache_key->moves_to_key = NULL;
+        }
     }
-}
 
-static inline void cache_destroy(fcs_lru_cache_t *cache)
-{
-    cache_destroy_key(cache->recycle_bin);
-    cache_destroy_key(cache->lowest_pri);
-    fc_solve_kaz_tree_destroy(cache->kaz_tree);
-    fc_solve_compact_allocator_finish(
-        &(cache->states_values_to_keys_allocator));
-}
+    static inline void cache_destroy(fcs_lru_cache_t *cache)
+    {
+        cache_destroy_key(cache->recycle_bin);
+        cache_destroy_key(cache->lowest_pri);
+        fc_solve_kaz_tree_destroy(cache->kaz_tree);
+        fc_solve_compact_allocator_finish(
+            &(cache->states_values_to_keys_allocator));
+    }
 
-static inline void cache_init(fcs_lru_cache_t *const cache,
-    const long max_num_elements_in_cache,
-    fcs_meta_compact_allocator_t *const meta_alloc)
-{
+    static inline void cache_init(fcs_lru_cache_t *const cache,
+        const long max_num_elements_in_cache,
+        fcs_meta_compact_allocator_t *const meta_alloc)
+    {
 #if (FCS_RCS_CACHE_STORAGE == FCS_RCS_CACHE_STORAGE_JUDY)
-    cache->states_values_to_keys_map = ((Pvoid_t)NULL);
+        cache->states_values_to_keys_map = ((Pvoid_t)NULL);
 #elif (FCS_RCS_CACHE_STORAGE == FCS_RCS_CACHE_STORAGE_KAZ_TREE)
     cache->tree_recycle_bin = NULL;
     cache->kaz_tree = fc_solve_kaz_tree_create(fc_solve_compare_lru_cache_keys,
@@ -66,117 +67,117 @@ static inline void cache_init(fcs_lru_cache_t *const cache,
 #error Unknown FCS_RCS_CACHE_STORAGE
 #endif
 
-    fc_solve_compact_allocator_init(
-        &(cache->states_values_to_keys_allocator), meta_alloc);
-    cache->lowest_pri = NULL;
-    cache->highest_pri = NULL;
-    cache->recycle_bin = NULL;
-    cache->count_elements_in_cache = 0;
-    cache->max_num_elements_in_cache = max_num_elements_in_cache;
-}
-
-static inline fcs_bool_t cache_does_key_exist(
-    fcs_lru_cache_t *const cache, fcs_cache_key_t *const key)
-{
-    const fcs_cache_key_info_t to_check = {.key = *key};
-    const dict_key_t existing_key =
-        fc_solve_kaz_tree_lookup_value(cache->kaz_tree, &to_check);
-    if (!existing_key)
-    {
-        return FALSE;
+        fc_solve_compact_allocator_init(
+            &(cache->states_values_to_keys_allocator), meta_alloc);
+        cache->lowest_pri = NULL;
+        cache->highest_pri = NULL;
+        cache->recycle_bin = NULL;
+        cache->count_elements_in_cache = 0;
+        cache->max_num_elements_in_cache = max_num_elements_in_cache;
     }
-    else
-    {
-        /* First - promote this key to the top of the cache. */
-        fcs_cache_key_info_t *const existing =
-            (fcs_cache_key_info_t *)existing_key;
 
-        if (existing->higher_pri)
+    static inline fcs_bool_t cache_does_key_exist(
+        fcs_lru_cache_t *const cache, fcs_cache_key_t *const key)
+    {
+        const fcs_cache_key_info_t to_check = {.key = *key};
+        const dict_key_t existing_key =
+            fc_solve_kaz_tree_lookup_value(cache->kaz_tree, &to_check);
+        if (!existing_key)
         {
-            existing->higher_pri->lower_pri = existing->lower_pri;
-            if (existing->lower_pri)
-            {
-                existing->lower_pri->higher_pri = existing->higher_pri;
-            }
-            else
+            return FALSE;
+        }
+        else
+        {
+            /* First - promote this key to the top of the cache. */
+            fcs_cache_key_info_t *const existing =
+                (fcs_cache_key_info_t *)existing_key;
+
+            if (existing->higher_pri)
             {
-                cache->lowest_pri = existing->higher_pri;
-                /* Bug fix: keep the chain intact. */
-                existing->higher_pri->lower_pri = NULL;
+                existing->higher_pri->lower_pri = existing->lower_pri;
+                if (existing->lower_pri)
+                {
+                    existing->lower_pri->higher_pri = existing->higher_pri;
+                }
+                else
+                {
+                    cache->lowest_pri = existing->higher_pri;
+                    /* Bug fix: keep the chain intact. */
+                    existing->higher_pri->lower_pri = NULL;
+                }
+                cache->highest_pri->higher_pri = existing;
+                existing->lower_pri = cache->highest_pri;
+                cache->highest_pri = existing;
+                existing->higher_pri = NULL;
             }
-            cache->highest_pri->higher_pri = existing;
-            existing->lower_pri = cache->highest_pri;
-            cache->highest_pri = existing;
-            existing->higher_pri = NULL;
-        }
 
-        return TRUE;
+            return TRUE;
+        }
     }
-}
-
-static inline fcs_cache_key_info_t *cache_insert(fcs_lru_cache_t *cache,
-    const fcs_cache_key_t *key, const fcs_fcc_move_t *moves_to_parent,
-    const fcs_fcc_move_t final_move)
-{
-    fcs_cache_key_info_t *cache_key;
-    var_AUTO(kaz_tree, cache->kaz_tree);
 
-    if (cache->count_elements_in_cache >= cache->max_num_elements_in_cache)
+    static inline fcs_cache_key_info_t *cache_insert(fcs_lru_cache_t *cache,
+        const fcs_cache_key_t *key, const fcs_fcc_move_t *moves_to_parent,
+        const fcs_fcc_move_t final_move)
     {
-        fc_solve_kaz_tree_delete_by_value(
-            kaz_tree, (cache_key = cache->lowest_pri));
+        fcs_cache_key_info_t *cache_key;
+        var_AUTO(kaz_tree, cache->kaz_tree);
 
-        cache->lowest_pri = cache->lowest_pri->higher_pri;
-        cache->lowest_pri->lower_pri = NULL;
-    }
-    else
-    {
-        cache_key = (fcs_cache_key_info_t *)fcs_compact_alloc_ptr(
-            &(cache->states_values_to_keys_allocator), sizeof(*cache_key));
-        cache_key->moves_to_key = NULL;
-        ++cache->count_elements_in_cache;
-    }
+        if (cache->count_elements_in_cache >= cache->max_num_elements_in_cache)
+        {
+            fc_solve_kaz_tree_delete_by_value(
+                kaz_tree, (cache_key = cache->lowest_pri));
 
-    cache_key->key = *key;
-    if (moves_to_parent)
-    {
-        fcs_fcc_move_t *moves;
-        const_AUTO(len, strlen((const char *)moves_to_parent));
-        cache_key->moves_to_key = moves =
-            SREALLOC(cache_key->moves_to_key, len + 1 + 1);
-        memcpy(moves, moves_to_parent, len);
-        moves[len] = final_move;
-        moves[len + 1] = '\0';
-    }
-    else if (final_move)
-    {
-        cache_key->moves_to_key = SREALLOC(cache_key->moves_to_key, 2);
-        cache_key->moves_to_key[0] = final_move;
-        cache_key->moves_to_key[1] = '\0';
-    }
-    else
-    {
-        free(cache_key->moves_to_key);
-        cache_key->moves_to_key = NULL;
-    }
+            cache->lowest_pri = cache->lowest_pri->higher_pri;
+            cache->lowest_pri->lower_pri = NULL;
+        }
+        else
+        {
+            cache_key = (fcs_cache_key_info_t *)fcs_compact_alloc_ptr(
+                &(cache->states_values_to_keys_allocator), sizeof(*cache_key));
+            cache_key->moves_to_key = NULL;
+            ++cache->count_elements_in_cache;
+        }
 
-    if (cache->highest_pri)
-    {
-        cache_key->lower_pri = cache->highest_pri;
-        cache_key->higher_pri = NULL;
-        cache->highest_pri->higher_pri = cache_key;
-        cache->highest_pri = cache_key;
-    }
-    else
-    {
-        cache->highest_pri = cache->lowest_pri = cache_key;
-        cache_key->higher_pri = cache_key->lower_pri = NULL;
-    }
+        cache_key->key = *key;
+        if (moves_to_parent)
+        {
+            fcs_fcc_move_t *moves;
+            const_AUTO(len, strlen((const char *)moves_to_parent));
+            cache_key->moves_to_key = moves =
+                SREALLOC(cache_key->moves_to_key, len + 1 + 1);
+            memcpy(moves, moves_to_parent, len);
+            moves[len] = final_move;
+            moves[len + 1] = '\0';
+        }
+        else if (final_move)
+        {
+            cache_key->moves_to_key = SREALLOC(cache_key->moves_to_key, 2);
+            cache_key->moves_to_key[0] = final_move;
+            cache_key->moves_to_key[1] = '\0';
+        }
+        else
+        {
+            free(cache_key->moves_to_key);
+            cache_key->moves_to_key = NULL;
+        }
 
-    fc_solve_kaz_tree_alloc_insert(kaz_tree, cache_key);
+        if (cache->highest_pri)
+        {
+            cache_key->lower_pri = cache->highest_pri;
+            cache_key->higher_pri = NULL;
+            cache->highest_pri->higher_pri = cache_key;
+            cache->highest_pri = cache_key;
+        }
+        else
+        {
+            cache->highest_pri = cache->lowest_pri = cache_key;
+            cache_key->higher_pri = cache_key->lower_pri = NULL;
+        }
 
-    return cache_key;
-}
+        fc_solve_kaz_tree_alloc_insert(kaz_tree, cache_key);
+
+        return cache_key;
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/dbm_calc_derived.h b/fc-solve/source/dbm_calc_derived.h
index f50b17cf1..579f90728 100644
--- a/fc-solve/source/dbm_calc_derived.h
+++ b/fc-solve/source/dbm_calc_derived.h
@@ -14,7 +14,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "meta_alloc.h"
@@ -26,35 +27,35 @@ extern "C" {
 #include "indirect_buffer.h"
 #include "fcc_brfs_test.h"
 
-typedef struct fcs_derived_state_struct
-{
-    fcs_state_keyval_pair_t state;
-    fcs_encoded_state_buffer_t key;
-    fcs_dbm_record_t *parent;
-    struct fcs_derived_state_struct *next;
-    int core_irreversible_moves_count;
-    fcs_which_moves_bitmask_t which_irreversible_moves_bitmask;
-    fcs_fcc_move_t move;
-    int num_non_reversible_moves_including_prune;
-    DECLARE_IND_BUF_T(indirect_stacks_buffer)
-} fcs_derived_state_t;
-
-static inline void fcs_derived_state_list__recycle(
-    fcs_derived_state_t **const p_recycle_bin,
-    fcs_derived_state_t **const p_list)
-{
-    var_AUTO(list, *p_list);
-    var_AUTO(bin, *p_recycle_bin);
-    while (list)
+    typedef struct fcs_derived_state_struct
     {
-        var_AUTO(list_next, list->next);
-        list->next = bin;
-        bin = list;
-        list = list_next;
+        fcs_state_keyval_pair_t state;
+        fcs_encoded_state_buffer_t key;
+        fcs_dbm_record_t *parent;
+        struct fcs_derived_state_struct *next;
+        int core_irreversible_moves_count;
+        fcs_which_moves_bitmask_t which_irreversible_moves_bitmask;
+        fcs_fcc_move_t move;
+        int num_non_reversible_moves_including_prune;
+        DECLARE_IND_BUF_T(indirect_stacks_buffer)
+    } fcs_derived_state_t;
+
+    static inline void fcs_derived_state_list__recycle(
+        fcs_derived_state_t **const p_recycle_bin,
+        fcs_derived_state_t **const p_list)
+    {
+        var_AUTO(list, *p_list);
+        var_AUTO(bin, *p_recycle_bin);
+        while (list)
+        {
+            var_AUTO(list_next, list->next);
+            list->next = bin;
+            bin = list;
+            list = list_next;
+        }
+        *p_recycle_bin = bin;
+        *p_list = NULL;
     }
-    *p_recycle_bin = bin;
-    *p_list = NULL;
-}
 
 #define MAKE_MOVE(src, dest) ((fcs_fcc_move_t)((src) | ((dest) << 4)))
 #define COL2MOVE(idx) (idx)
@@ -103,18 +104,18 @@ static inline void fcs_derived_state_list__recycle(
         COPY_INDIRECT_COLS()                                                   \
     }
 
-static inline void fc_solve_add_to_irrev_moves_bitmask(
-    fcs_which_moves_bitmask_t *const which_irreversible_moves_bitmask,
-    const fcs_card_t moved_card, const int count)
-{
-    unsigned char *const by_rank_ptr =
-        which_irreversible_moves_bitmask->s + fcs_card_rank(moved_card) - 1;
-    const int suit_times_two = (fcs_card_suit(moved_card) << 1);
-    const int new_count =
-        ((((*by_rank_ptr) >> (suit_times_two)) & ((1 << 2) - 1)) + count);
-    *by_rank_ptr &= (~((((unsigned char)0x3) << (suit_times_two))));
-    *by_rank_ptr |= (new_count << (suit_times_two));
-}
+    static inline void fc_solve_add_to_irrev_moves_bitmask(
+        fcs_which_moves_bitmask_t *const which_irreversible_moves_bitmask,
+        const fcs_card_t moved_card, const int count)
+    {
+        unsigned char *const by_rank_ptr =
+            which_irreversible_moves_bitmask->s + fcs_card_rank(moved_card) - 1;
+        const int suit_times_two = (fcs_card_suit(moved_card) << 1);
+        const int new_count =
+            ((((*by_rank_ptr) >> (suit_times_two)) & ((1 << 2) - 1)) + count);
+        *by_rank_ptr &= (~((((unsigned char)0x3) << (suit_times_two))));
+        *by_rank_ptr |= (new_count << (suit_times_two));
+    }
 
 #define COMMIT_NEW_STATE_WITH_COUNT(src, dest, count, moved_card)              \
     {                                                                          \
@@ -138,64 +139,66 @@ static inline void fc_solve_add_to_irrev_moves_bitmask(
     COMMIT_NEW_STATE_WITH_COUNT(                                               \
         src, dest, ((is_reversible) ? 0 : 1), moved_card)
 
-static inline __attribute__((pure)) int calc_foundation_to_put_card_on(
-    const fcs_dbm_variant_type_t local_variant, fcs_state_t *const ptr_state,
-    const fcs_card_t card)
-{
+    static inline __attribute__((pure)) int calc_foundation_to_put_card_on(
+        const fcs_dbm_variant_type_t local_variant,
+        fcs_state_t *const ptr_state, const fcs_card_t card)
+    {
 #ifndef FCS_FREECELL_ONLY
-    const int sequences_are_built_by = CALC_SEQUENCES_ARE_BUILT_BY();
+        const int sequences_are_built_by = CALC_SEQUENCES_ARE_BUILT_BY();
 #endif
-    const int_fast32_t rank = fcs_card_rank(card);
-    const int_fast32_t suit = fcs_card_suit(card);
-    for (uint_fast32_t deck = 0; deck < INSTANCE_DECKS_NUM; ++deck)
-    {
-        if (fcs_foundation_value(*ptr_state, (deck << 2) + suit) == rank - 1)
+        const int_fast32_t rank = fcs_card_rank(card);
+        const int_fast32_t suit = fcs_card_suit(card);
+        for (uint_fast32_t deck = 0; deck < INSTANCE_DECKS_NUM; ++deck)
         {
-            uint_fast32_t other_deck_idx;
-
-            for (other_deck_idx = 0; other_deck_idx < (INSTANCE_DECKS_NUM << 2);
-                 ++other_deck_idx)
+            if (fcs_foundation_value(*ptr_state, (deck << 2) + suit) ==
+                rank - 1)
             {
-                if (fcs_foundation_value(*ptr_state, other_deck_idx) <
-                    rank - 2 -
-                        (FCS__SEQS_ARE_BUILT_BY_RANK()
-                                ? 0
-                                : ((other_deck_idx & 0x1) == (suit & 0x1))))
+                uint_fast32_t other_deck_idx;
+
+                for (other_deck_idx = 0;
+                     other_deck_idx < (INSTANCE_DECKS_NUM << 2);
+                     ++other_deck_idx)
                 {
-                    break;
+                    if (fcs_foundation_value(*ptr_state, other_deck_idx) <
+                        rank - 2 -
+                            (FCS__SEQS_ARE_BUILT_BY_RANK()
+                                    ? 0
+                                    : ((other_deck_idx & 0x1) == (suit & 0x1))))
+                    {
+                        break;
+                    }
+                }
+                if (other_deck_idx == (INSTANCE_DECKS_NUM << 2))
+                {
+                    return (deck << 2) + suit;
                 }
-            }
-            if (other_deck_idx == (INSTANCE_DECKS_NUM << 2))
-            {
-                return (deck << 2) + suit;
             }
         }
+        return -1;
     }
-    return -1;
-}
-
-typedef struct
-{
-    fcs_fcc_moves_list_item_t *recycle_bin;
-    fcs_compact_allocator_t *allocator;
-} fcs_fcc_moves_seq_allocator_t;
 
-static inline fcs_fcc_moves_list_item_t *fc_solve_fcc_alloc_moves_list_item(
-    fcs_fcc_moves_seq_allocator_t *const allocator)
-{
-    fcs_fcc_moves_list_item_t *new_item;
-    if (allocator->recycle_bin)
+    typedef struct
     {
-        allocator->recycle_bin = (new_item = allocator->recycle_bin)->next;
-    }
-    else
+        fcs_fcc_moves_list_item_t *recycle_bin;
+        fcs_compact_allocator_t *allocator;
+    } fcs_fcc_moves_seq_allocator_t;
+
+    static inline fcs_fcc_moves_list_item_t *fc_solve_fcc_alloc_moves_list_item(
+        fcs_fcc_moves_seq_allocator_t *const allocator)
     {
-        new_item = (fcs_fcc_moves_list_item_t *)fcs_compact_alloc_ptr(
-            allocator->allocator, sizeof(*new_item));
+        fcs_fcc_moves_list_item_t *new_item;
+        if (allocator->recycle_bin)
+        {
+            allocator->recycle_bin = (new_item = allocator->recycle_bin)->next;
+        }
+        else
+        {
+            new_item = (fcs_fcc_moves_list_item_t *)fcs_compact_alloc_ptr(
+                allocator->allocator, sizeof(*new_item));
+        }
+        new_item->next = NULL;
+        return new_item;
     }
-    new_item->next = NULL;
-    return new_item;
-}
 
 #define FROM_COL_IS_REVERSIBLE_MOVE()                                          \
     ((cards_num <= 1)                                                          \
@@ -203,387 +206,393 @@ static inline fcs_fcc_moves_list_item_t *fc_solve_fcc_alloc_moves_list_item(
             : fcs_is_parent_card(card, fcs_col_get_card(col, cards_num - 2)))
 #define COUNT_NON_REV(is_reversible) ((is_reversible) ? 1 : 2)
 
-/* Returns the number of amortized irreversible moves performed. */
-static inline int horne_prune(const fcs_dbm_variant_type_t local_variant,
-    fcs_state_keyval_pair_t *const init_state_kv_ptr,
-    fcs_which_moves_bitmask_t *const which_irreversible_moves_bitmask,
-    fcs_fcc_moves_seq_t *const moves_seq,
-    fcs_fcc_moves_seq_allocator_t *const allocator)
-{
-    fcs_fcc_move_t additional_moves[RANK_KING * 4 * DECKS_NUM];
-    int count_moves_so_far = 0;
-    int count_additional_irrev_moves = 0;
+    /* Returns the number of amortized irreversible moves performed. */
+    static inline int horne_prune(const fcs_dbm_variant_type_t local_variant,
+        fcs_state_keyval_pair_t *const init_state_kv_ptr,
+        fcs_which_moves_bitmask_t *const which_irreversible_moves_bitmask,
+        fcs_fcc_moves_seq_t *const moves_seq,
+        fcs_fcc_moves_seq_allocator_t *const allocator)
+    {
+        fcs_fcc_move_t additional_moves[RANK_KING * 4 * DECKS_NUM];
+        int count_moves_so_far = 0;
+        int count_additional_irrev_moves = 0;
 #ifndef FCS_FREECELL_ONLY
-    const int sequences_are_built_by = CALC_SEQUENCES_ARE_BUILT_BY();
+        const int sequences_are_built_by = CALC_SEQUENCES_ARE_BUILT_BY();
 #endif
 
 #define the_state (init_state_kv_ptr->s)
-    uint_fast32_t num_cards_moved;
-    do
-    {
-        num_cards_moved = 0;
-        for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+        uint_fast32_t num_cards_moved;
+        do
         {
-            var_AUTO(col, fcs_state_get_col(the_state, stack_idx));
-            const int cards_num = fcs_col_len(col);
-            if (!cards_num)
-            {
-                continue;
-            }
-            /* Get the top card in the stack */
-            const fcs_card_t card = fcs_col_get_card(col, cards_num - 1);
-            const int dest_foundation =
-                calc_foundation_to_put_card_on(local_variant, &the_state, card);
-            if (dest_foundation >= 0)
+            num_cards_moved = 0;
+            for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
             {
-                const_AUTO(is_reversible, FROM_COL_IS_REVERSIBLE_MOVE());
-                if (!is_reversible)
+                var_AUTO(col, fcs_state_get_col(the_state, stack_idx));
+                const int cards_num = fcs_col_len(col);
+                if (!cards_num)
                 {
-                    count_additional_irrev_moves++;
+                    continue;
                 }
-                /* We can safely move it. */
-                num_cards_moved++;
-                fc_solve_add_to_irrev_moves_bitmask(
-                    which_irreversible_moves_bitmask, card,
-                    COUNT_NON_REV(is_reversible));
-
-                fcs_col_pop_top(col);
-
-                fcs_increment_foundation(the_state, dest_foundation);
-
-                additional_moves[count_moves_so_far++] =
-                    MAKE_MOVE(COL2MOVE(stack_idx), FOUND2MOVE(dest_foundation));
-            }
-        }
-
-        /* Now check the same for the free cells */
-        for (int fc = 0; fc < LOCAL_FREECELLS_NUM; fc++)
-        {
-            const fcs_card_t card = fcs_freecell_card(the_state, fc);
-            if (fcs_card_is_valid(card))
-            {
+                /* Get the top card in the stack */
+                const fcs_card_t card = fcs_col_get_card(col, cards_num - 1);
                 const int dest_foundation = calc_foundation_to_put_card_on(
                     local_variant, &the_state, card);
                 if (dest_foundation >= 0)
                 {
+                    const_AUTO(is_reversible, FROM_COL_IS_REVERSIBLE_MOVE());
+                    if (!is_reversible)
+                    {
+                        count_additional_irrev_moves++;
+                    }
+                    /* We can safely move it. */
                     num_cards_moved++;
                     fc_solve_add_to_irrev_moves_bitmask(
-                        which_irreversible_moves_bitmask, card, 1);
+                        which_irreversible_moves_bitmask, card,
+                        COUNT_NON_REV(is_reversible));
 
-                    /* We can put it there */
+                    fcs_col_pop_top(col);
 
-                    fcs_empty_freecell(the_state, fc);
                     fcs_increment_foundation(the_state, dest_foundation);
-                    additional_moves[count_moves_so_far++] =
-                        MAKE_MOVE(COL2MOVE(fc), FOUND2MOVE(dest_foundation));
+
+                    additional_moves[count_moves_so_far++] = MAKE_MOVE(
+                        COL2MOVE(stack_idx), FOUND2MOVE(dest_foundation));
                 }
             }
-        }
-    } while (num_cards_moved);
-
-    /* modify moves_seq in-place. */
-    if (count_moves_so_far && moves_seq)
-    {
-        fcs_fcc_moves_list_item_t **iter = &(moves_seq->moves_list);
-
-        /* Assuming FCS_FCC_NUM_MOVES_IN_ITEM is 8 and we want (*iter)
-         * to point at the place to either write the new moves or
-         * alternatively (on parity) on the pointer to allocate a new
-         * list_item for the moves.
-         *
-         * If count is 0, then we should move 0.
-         * If count is 1, then we should move 0.
-         * .
-         * .
-         * .
-         * If count is 7, then we should move 0.
-         * If count is 8, then we should move 1 time.
-         *
-         * to sum up we need to move count / FCS_FCC_NUM_MOVES_IN_ITEM .
-         *
-         * */
-        const int count = moves_seq->count;
-        for (int pos = 0; pos <= count - FCS_FCC_NUM_MOVES_IN_ITEM;
-             pos += FCS_FCC_NUM_MOVES_IN_ITEM)
-        {
-            iter = &((*iter)->next);
-        }
-
-        int pos = count;
 
-        for (int pos_moves_so_far = 0; pos_moves_so_far < count_moves_so_far;
-             pos_moves_so_far++)
-        {
-            if (pos % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+            /* Now check the same for the free cells */
+            for (int fc = 0; fc < LOCAL_FREECELLS_NUM; fc++)
             {
-                (*iter) = fc_solve_fcc_alloc_moves_list_item(allocator);
+                const fcs_card_t card = fcs_freecell_card(the_state, fc);
+                if (fcs_card_is_valid(card))
+                {
+                    const int dest_foundation = calc_foundation_to_put_card_on(
+                        local_variant, &the_state, card);
+                    if (dest_foundation >= 0)
+                    {
+                        num_cards_moved++;
+                        fc_solve_add_to_irrev_moves_bitmask(
+                            which_irreversible_moves_bitmask, card, 1);
+
+                        /* We can put it there */
+
+                        fcs_empty_freecell(the_state, fc);
+                        fcs_increment_foundation(the_state, dest_foundation);
+                        additional_moves[count_moves_so_far++] = MAKE_MOVE(
+                            COL2MOVE(fc), FOUND2MOVE(dest_foundation));
+                    }
+                }
             }
-            (*iter)->data.s[pos % FCS_FCC_NUM_MOVES_IN_ITEM] =
-                additional_moves[pos_moves_so_far];
-            if ((++pos) % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+        } while (num_cards_moved);
+
+        /* modify moves_seq in-place. */
+        if (count_moves_so_far && moves_seq)
+        {
+            fcs_fcc_moves_list_item_t **iter = &(moves_seq->moves_list);
+
+            /* Assuming FCS_FCC_NUM_MOVES_IN_ITEM is 8 and we want (*iter)
+             * to point at the place to either write the new moves or
+             * alternatively (on parity) on the pointer to allocate a new
+             * list_item for the moves.
+             *
+             * If count is 0, then we should move 0.
+             * If count is 1, then we should move 0.
+             * .
+             * .
+             * .
+             * If count is 7, then we should move 0.
+             * If count is 8, then we should move 1 time.
+             *
+             * to sum up we need to move count / FCS_FCC_NUM_MOVES_IN_ITEM .
+             *
+             * */
+            const int count = moves_seq->count;
+            for (int pos = 0; pos <= count - FCS_FCC_NUM_MOVES_IN_ITEM;
+                 pos += FCS_FCC_NUM_MOVES_IN_ITEM)
             {
                 iter = &((*iter)->next);
             }
-        }
-        moves_seq->count += count_moves_so_far;
-    }
-
-    return count_moves_so_far + count_additional_irrev_moves;
-}
-
-static inline int horne_prune__simple(
-    const fcs_dbm_variant_type_t local_variant,
-    fcs_state_keyval_pair_t *const init_state_kv_ptr)
-{
-    fcs_which_moves_bitmask_t no_use = {{'\0'}};
-    return horne_prune(local_variant, init_state_kv_ptr, &no_use, NULL, NULL);
-}
 
-static inline fcs_bool_t card_cannot_be_placed(const fcs_state_t *const s,
-    const uint16_t ds, const fcs_card_t card, const int sequences_are_built_by)
-{
-    const_AUTO(col, fcs_state_get_col(*s, ds));
-    const_AUTO(col_len, fcs_col_len(col));
-    return ((col_len == 0) ||
-            (!fcs_is_parent_card(card, fcs_col_get_card(col, col_len - 1))));
-}
+            int pos = count;
 
-#define the_state (init_state_kv_ptr->s)
-static inline fcs_bool_t is_state_solved(
-    fcs_state_keyval_pair_t *const init_state_kv_ptr)
-{
-    for (int suit = 0; suit < DECKS_NUM * 4; suit++)
-    {
-        if (fcs_foundation_value(the_state, suit) < RANK_KING)
-        {
-            return FALSE;
+            for (int pos_moves_so_far = 0;
+                 pos_moves_so_far < count_moves_so_far; pos_moves_so_far++)
+            {
+                if (pos % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+                {
+                    (*iter) = fc_solve_fcc_alloc_moves_list_item(allocator);
+                }
+                (*iter)->data.s[pos % FCS_FCC_NUM_MOVES_IN_ITEM] =
+                    additional_moves[pos_moves_so_far];
+                if ((++pos) % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+                {
+                    iter = &((*iter)->next);
+                }
+            }
+            moves_seq->count += count_moves_so_far;
         }
+
+        return count_moves_so_far + count_additional_irrev_moves;
     }
-    return TRUE;
-}
 
-static inline fcs_bool_t instance_solver_thread_calc_derived_states(
-    const fcs_dbm_variant_type_t local_variant,
-    fcs_state_keyval_pair_t *const init_state_kv_ptr,
-    fcs_dbm_record_t *const parent_ptr,
-    fcs_derived_state_t **const derived_list,
-    fcs_derived_state_t **const derived_list_recycle_bin,
-    fcs_compact_allocator_t *const derived_list_allocator,
-    const fcs_bool_t perform_horne_prune)
-{
-    fcs_derived_state_t *ptr_new_state;
-    int empty_stack_idx = -1;
-    const int sequences_are_built_by = CALC_SEQUENCES_ARE_BUILT_BY();
-#define new_state (ptr_new_state->state.s)
-    if (is_state_solved(init_state_kv_ptr))
+    static inline int horne_prune__simple(
+        const fcs_dbm_variant_type_t local_variant,
+        fcs_state_keyval_pair_t *const init_state_kv_ptr)
     {
-        return TRUE;
+        fcs_which_moves_bitmask_t no_use = {{'\0'}};
+        return horne_prune(
+            local_variant, init_state_kv_ptr, &no_use, NULL, NULL);
     }
 
-    /* Move top stack cards to foundations. */
-    for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+    static inline fcs_bool_t card_cannot_be_placed(const fcs_state_t *const s,
+        const uint16_t ds, const fcs_card_t card,
+        const int sequences_are_built_by)
     {
-        const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
-        const_AUTO(cards_num, fcs_col_len(col));
-        if (cards_num == 0)
-        {
-            empty_stack_idx = stack_idx;
-            continue;
-        }
-        /* Get the top card in the stack */
-        const_AUTO(card, fcs_col_get_card(col, cards_num - 1));
-        const_AUTO(suit, fcs_card_suit(card));
-        for (int deck = 0; deck < INSTANCE_DECKS_NUM; deck++)
-        {
-            if (fcs_foundation_value(the_state, deck * 4 + suit) !=
-                fcs_card_rank(card) - 1)
-            {
-                continue;
-            }
-            /* We can put it there */
-            BEGIN_NEW_STATE()
-
-            fcs_state_pop_col_top(&new_state, stack_idx);
-            fcs_increment_foundation(new_state, deck * 4 + suit);
-
-            COMMIT_NEW_STATE_WITH_COUNT(COL2MOVE(stack_idx), FOUND2MOVE(suit),
-                COUNT_NON_REV(FROM_COL_IS_REVERSIBLE_MOVE()), card)
-            break;
-        }
+        const_AUTO(col, fcs_state_get_col(*s, ds));
+        const_AUTO(col_len, fcs_col_len(col));
+        return ((col_len == 0) || (!fcs_is_parent_card(card,
+                                      fcs_col_get_card(col, col_len - 1))));
     }
 
-    int empty_fc_idx = -1;
-    /* Move freecell cards to foundations. */
-    for (int fc_idx = 0; fc_idx < LOCAL_FREECELLS_NUM; fc_idx++)
+#define the_state (init_state_kv_ptr->s)
+    static inline fcs_bool_t is_state_solved(
+        fcs_state_keyval_pair_t *const init_state_kv_ptr)
     {
-        const_AUTO(card, fcs_freecell_card(the_state, fc_idx));
-        if (fcs_card_is_empty(card))
-        {
-            empty_fc_idx = fc_idx;
-            continue;
-        }
-        const_AUTO(suit, fcs_card_suit(card));
-        for (int deck = 0; deck < INSTANCE_DECKS_NUM; deck++)
+        for (int suit = 0; suit < DECKS_NUM * 4; suit++)
         {
-            if (fcs_foundation_value(the_state, deck * 4 + suit) !=
-                fcs_card_rank(card) - 1)
+            if (fcs_foundation_value(the_state, suit) < RANK_KING)
             {
-                continue;
+                return FALSE;
             }
-            BEGIN_NEW_STATE()
-
-            /* We can put it there */
-            fcs_empty_freecell(new_state, fc_idx);
-            fcs_increment_foundation(new_state, deck * 4 + suit);
-
-            COMMIT_NEW_STATE(
-                FREECELL2MOVE(fc_idx), FOUND2MOVE(suit), FALSE, card)
-            break;
         }
+        return TRUE;
     }
 
-    const int cards_num_min_limit =
-        ((local_variant == FCS_DBM_VARIANT_BAKERS_DOZEN) ? 1 : 0);
-
-    /* Move stack card on top of a parent */
-    for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+    static inline fcs_bool_t instance_solver_thread_calc_derived_states(
+        const fcs_dbm_variant_type_t local_variant,
+        fcs_state_keyval_pair_t *const init_state_kv_ptr,
+        fcs_dbm_record_t *const parent_ptr,
+        fcs_derived_state_t **const derived_list,
+        fcs_derived_state_t **const derived_list_recycle_bin,
+        fcs_compact_allocator_t *const derived_list_allocator,
+        const fcs_bool_t perform_horne_prune)
     {
-        const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
-        const_AUTO(cards_num, fcs_col_len(col));
-        if (cards_num <= cards_num_min_limit)
+        fcs_derived_state_t *ptr_new_state;
+        int empty_stack_idx = -1;
+        const int sequences_are_built_by = CALC_SEQUENCES_ARE_BUILT_BY();
+#define new_state (ptr_new_state->state.s)
+        if (is_state_solved(init_state_kv_ptr))
         {
-            continue;
+            return TRUE;
         }
-        const_AUTO(card, fcs_col_get_card(col, cards_num - 1));
 
-        for (int ds = 0; ds < LOCAL_STACKS_NUM; ++ds)
+        /* Move top stack cards to foundations. */
+        for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
         {
-            if (ds == stack_idx || card_cannot_be_placed(&the_state, ds, card,
-                                       sequences_are_built_by))
+            const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
+            const_AUTO(cards_num, fcs_col_len(col));
+            if (cards_num == 0)
             {
+                empty_stack_idx = stack_idx;
                 continue;
             }
-            /* Let's move it */
-            BEGIN_NEW_STATE()
+            /* Get the top card in the stack */
+            const_AUTO(card, fcs_col_get_card(col, cards_num - 1));
+            const_AUTO(suit, fcs_card_suit(card));
+            for (int deck = 0; deck < INSTANCE_DECKS_NUM; deck++)
+            {
+                if (fcs_foundation_value(the_state, deck * 4 + suit) !=
+                    fcs_card_rank(card) - 1)
+                {
+                    continue;
+                }
+                /* We can put it there */
+                BEGIN_NEW_STATE()
 
-            fcs_state_pop_col_top(&new_state, stack_idx);
-            fcs_state_push(&new_state, ds, card);
+                fcs_state_pop_col_top(&new_state, stack_idx);
+                fcs_increment_foundation(new_state, deck * 4 + suit);
 
-            COMMIT_NEW_STATE(COL2MOVE(stack_idx), COL2MOVE(ds),
-                FROM_COL_IS_REVERSIBLE_MOVE(), card)
+                COMMIT_NEW_STATE_WITH_COUNT(COL2MOVE(stack_idx),
+                    FOUND2MOVE(suit),
+                    COUNT_NON_REV(FROM_COL_IS_REVERSIBLE_MOVE()), card)
+                break;
+            }
         }
-    }
 
-    /* Move freecell card on top of a parent */
-    for (int fc_idx = 0; fc_idx < LOCAL_FREECELLS_NUM; fc_idx++)
-    {
-        const_AUTO(card, fcs_freecell_card(the_state, fc_idx));
-        if (!fcs_card_is_valid(card))
-        {
-            continue;
-        }
-        for (int ds = 0; ds < LOCAL_STACKS_NUM; ++ds)
+        int empty_fc_idx = -1;
+        /* Move freecell cards to foundations. */
+        for (int fc_idx = 0; fc_idx < LOCAL_FREECELLS_NUM; fc_idx++)
         {
-            if (card_cannot_be_placed(
-                    &the_state, ds, card, sequences_are_built_by))
+            const_AUTO(card, fcs_freecell_card(the_state, fc_idx));
+            if (fcs_card_is_empty(card))
             {
+                empty_fc_idx = fc_idx;
                 continue;
             }
-            /* Let's move it */
-            BEGIN_NEW_STATE()
+            const_AUTO(suit, fcs_card_suit(card));
+            for (int deck = 0; deck < INSTANCE_DECKS_NUM; deck++)
+            {
+                if (fcs_foundation_value(the_state, deck * 4 + suit) !=
+                    fcs_card_rank(card) - 1)
+                {
+                    continue;
+                }
+                BEGIN_NEW_STATE()
 
-            fcs_state_push(&new_state, ds, card);
-            fcs_empty_freecell(new_state, fc_idx);
+                /* We can put it there */
+                fcs_empty_freecell(new_state, fc_idx);
+                fcs_increment_foundation(new_state, deck * 4 + suit);
 
-            COMMIT_NEW_STATE(FREECELL2MOVE(fc_idx), COL2MOVE(ds), TRUE, card)
+                COMMIT_NEW_STATE(
+                    FREECELL2MOVE(fc_idx), FOUND2MOVE(suit), FALSE, card)
+                break;
+            }
         }
-    }
 
-    if ((local_variant != FCS_DBM_VARIANT_BAKERS_DOZEN) &&
-        (empty_stack_idx >= 0))
-    {
-        /* Stack Card to Empty Stack */
+        const int cards_num_min_limit =
+            ((local_variant == FCS_DBM_VARIANT_BAKERS_DOZEN) ? 1 : 0);
+
+        /* Move stack card on top of a parent */
         for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
         {
             const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
             const_AUTO(cards_num, fcs_col_len(col));
-            /* Bug fix: if there's only one card in a column, there's no
-             * point moving it to a new empty column.
-             * */
-            if (cards_num <= 1)
+            if (cards_num <= cards_num_min_limit)
             {
                 continue;
             }
-
             const_AUTO(card, fcs_col_get_card(col, cards_num - 1));
-            /* Let's move it */
-            BEGIN_NEW_STATE()
 
-            fcs_state_pop_col_top(&new_state, stack_idx);
-            fcs_state_push(&new_state, empty_stack_idx, card);
+            for (int ds = 0; ds < LOCAL_STACKS_NUM; ++ds)
+            {
+                if (ds == stack_idx || card_cannot_be_placed(&the_state, ds,
+                                           card, sequences_are_built_by))
+                {
+                    continue;
+                }
+                /* Let's move it */
+                BEGIN_NEW_STATE()
+
+                fcs_state_pop_col_top(&new_state, stack_idx);
+                fcs_state_push(&new_state, ds, card);
 
-            COMMIT_NEW_STATE(COL2MOVE(stack_idx), COL2MOVE(empty_stack_idx),
-                FROM_COL_IS_REVERSIBLE_MOVE(), card)
+                COMMIT_NEW_STATE(COL2MOVE(stack_idx), COL2MOVE(ds),
+                    FROM_COL_IS_REVERSIBLE_MOVE(), card)
+            }
         }
 
-        /* Freecell card -> Empty Stack. */
+        /* Move freecell card on top of a parent */
         for (int fc_idx = 0; fc_idx < LOCAL_FREECELLS_NUM; fc_idx++)
         {
             const_AUTO(card, fcs_freecell_card(the_state, fc_idx));
-            if (fcs_card_is_empty(card))
+            if (!fcs_card_is_valid(card))
             {
                 continue;
             }
+            for (int ds = 0; ds < LOCAL_STACKS_NUM; ++ds)
+            {
+                if (card_cannot_be_placed(
+                        &the_state, ds, card, sequences_are_built_by))
+                {
+                    continue;
+                }
+                /* Let's move it */
+                BEGIN_NEW_STATE()
 
-            BEGIN_NEW_STATE()
-
-            fcs_state_push(&new_state, empty_stack_idx, card);
-            fcs_empty_freecell(new_state, fc_idx);
+                fcs_state_push(&new_state, ds, card);
+                fcs_empty_freecell(new_state, fc_idx);
 
-            COMMIT_NEW_STATE(
-                FREECELL2MOVE(fc_idx), COL2MOVE(empty_stack_idx), TRUE, card);
+                COMMIT_NEW_STATE(
+                    FREECELL2MOVE(fc_idx), COL2MOVE(ds), TRUE, card)
+            }
         }
-    }
 
-    if (empty_fc_idx >= 0)
-    {
-        /* Stack Card to Empty Freecell */
-        for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+        if ((local_variant != FCS_DBM_VARIANT_BAKERS_DOZEN) &&
+            (empty_stack_idx >= 0))
         {
-            const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
-            const_AUTO(cards_num, fcs_col_len(col));
-            if (cards_num <= cards_num_min_limit)
+            /* Stack Card to Empty Stack */
+            for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
             {
-                continue;
+                const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
+                const_AUTO(cards_num, fcs_col_len(col));
+                /* Bug fix: if there's only one card in a column, there's no
+                 * point moving it to a new empty column.
+                 * */
+                if (cards_num <= 1)
+                {
+                    continue;
+                }
+
+                const_AUTO(card, fcs_col_get_card(col, cards_num - 1));
+                /* Let's move it */
+                BEGIN_NEW_STATE()
+
+                fcs_state_pop_col_top(&new_state, stack_idx);
+                fcs_state_push(&new_state, empty_stack_idx, card);
+
+                COMMIT_NEW_STATE(COL2MOVE(stack_idx), COL2MOVE(empty_stack_idx),
+                    FROM_COL_IS_REVERSIBLE_MOVE(), card)
             }
-            const_AUTO(card, fcs_col_get_card(col, cards_num - 1));
-            /* Let's move it */
-            BEGIN_NEW_STATE()
 
-            fcs_state_pop_col_top(&new_state, stack_idx);
-            fcs_put_card_in_freecell(new_state, empty_fc_idx, card);
+            /* Freecell card -> Empty Stack. */
+            for (int fc_idx = 0; fc_idx < LOCAL_FREECELLS_NUM; fc_idx++)
+            {
+                const_AUTO(card, fcs_freecell_card(the_state, fc_idx));
+                if (fcs_card_is_empty(card))
+                {
+                    continue;
+                }
+
+                BEGIN_NEW_STATE()
 
-            COMMIT_NEW_STATE(COL2MOVE(stack_idx), FREECELL2MOVE(empty_fc_idx),
-                FROM_COL_IS_REVERSIBLE_MOVE(), card)
+                fcs_state_push(&new_state, empty_stack_idx, card);
+                fcs_empty_freecell(new_state, fc_idx);
+
+                COMMIT_NEW_STATE(FREECELL2MOVE(fc_idx),
+                    COL2MOVE(empty_stack_idx), TRUE, card);
+            }
         }
-    }
-    /* Perform Horne's Prune on all the states,
-     * or just set their num irreversible moves counts.
-     * */
-    for (var_AUTO(derived_iter, *derived_list); derived_iter;
-         derived_iter = derived_iter->next)
-    {
-        derived_iter->num_non_reversible_moves_including_prune =
-            (derived_iter->core_irreversible_moves_count +
-                (perform_horne_prune
-                        ? horne_prune(local_variant, &(derived_iter->state),
-                              &(derived_iter->which_irreversible_moves_bitmask),
-                              NULL, NULL)
-                        : 0));
-    }
 
-    return FALSE;
-}
+        if (empty_fc_idx >= 0)
+        {
+            /* Stack Card to Empty Freecell */
+            for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+            {
+                const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
+                const_AUTO(cards_num, fcs_col_len(col));
+                if (cards_num <= cards_num_min_limit)
+                {
+                    continue;
+                }
+                const_AUTO(card, fcs_col_get_card(col, cards_num - 1));
+                /* Let's move it */
+                BEGIN_NEW_STATE()
+
+                fcs_state_pop_col_top(&new_state, stack_idx);
+                fcs_put_card_in_freecell(new_state, empty_fc_idx, card);
+
+                COMMIT_NEW_STATE(COL2MOVE(stack_idx),
+                    FREECELL2MOVE(empty_fc_idx), FROM_COL_IS_REVERSIBLE_MOVE(),
+                    card)
+            }
+        }
+        /* Perform Horne's Prune on all the states,
+         * or just set their num irreversible moves counts.
+         * */
+        for (var_AUTO(derived_iter, *derived_list); derived_iter;
+             derived_iter = derived_iter->next)
+        {
+            derived_iter->num_non_reversible_moves_including_prune =
+                (derived_iter->core_irreversible_moves_count +
+                    (perform_horne_prune
+                            ? horne_prune(local_variant, &(derived_iter->state),
+                                  &(derived_iter
+                                          ->which_irreversible_moves_bitmask),
+                                  NULL, NULL)
+                            : 0));
+        }
+
+        return FALSE;
+    }
 
 #undef FROM_COL_IS_REVERSIBLE_MOVE
 #undef COUNT_NON_REV
diff --git a/fc-solve/source/dbm_calc_derived_iface.h b/fc-solve/source/dbm_calc_derived_iface.h
index 7828c78f0..c646c0e43 100644
--- a/fc-solve/source/dbm_calc_derived_iface.h
+++ b/fc-solve/source/dbm_calc_derived_iface.h
@@ -13,41 +13,42 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "dbm_common.h"
 
-typedef struct
-{
-    unsigned char s[RANK_KING];
-} fcs_which_moves_bitmask_t;
-
-typedef struct
-{
-    char *state_string;
-    unsigned char move;
-    int core_irreversible_moves_count;
-    int num_non_reversible_moves_including_prune;
-    fcs_which_moves_bitmask_t which_irreversible_moves_bitmask;
-} fcs_derived_state_debug_t;
-
-DLLEXPORT int fc_solve_user_INTERNAL_calc_derived_states_wrapper(
-    fcs_dbm_variant_type_t, const char *, int *, fcs_derived_state_debug_t **,
-    fcs_bool_t);
-
-DLLEXPORT void fc_solve_user_INTERNAL_free_derived_states(
-    const int num_derived_states,
-    fcs_derived_state_debug_t *const derived_states);
-
-/*
- * The char * returned is malloc()ed and should be free()ed.
- */
-DLLEXPORT int fc_solve_user_INTERNAL_perform_horne_prune(
-    fcs_dbm_variant_type_t, const char *, char **);
-
-DLLEXPORT void fc_solve_user_INTERNAL_perform_horne_prune__free_ret_state_s(
-    char *const ret_state_s);
+    typedef struct
+    {
+        unsigned char s[RANK_KING];
+    } fcs_which_moves_bitmask_t;
+
+    typedef struct
+    {
+        char *state_string;
+        unsigned char move;
+        int core_irreversible_moves_count;
+        int num_non_reversible_moves_including_prune;
+        fcs_which_moves_bitmask_t which_irreversible_moves_bitmask;
+    } fcs_derived_state_debug_t;
+
+    DLLEXPORT int fc_solve_user_INTERNAL_calc_derived_states_wrapper(
+        fcs_dbm_variant_type_t, const char *, int *,
+        fcs_derived_state_debug_t **, fcs_bool_t);
+
+    DLLEXPORT void fc_solve_user_INTERNAL_free_derived_states(
+        const int num_derived_states,
+        fcs_derived_state_debug_t *const derived_states);
+
+    /*
+     * The char * returned is malloc()ed and should be free()ed.
+     */
+    DLLEXPORT int fc_solve_user_INTERNAL_perform_horne_prune(
+        fcs_dbm_variant_type_t, const char *, char **);
+
+    DLLEXPORT void fc_solve_user_INTERNAL_perform_horne_prune__free_ret_state_s(
+        char *const ret_state_s);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/dbm_common.h b/fc-solve/source/dbm_common.h
index 6951b4e2a..f3bbb6e9d 100644
--- a/fc-solve/source/dbm_common.h
+++ b/fc-solve/source/dbm_common.h
@@ -11,15 +11,17 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "state.h"
 
-typedef enum {
-    FCS_DBM_VARIANT_2FC_FREECELL,
-    FCS_DBM_VARIANT_BAKERS_DOZEN,
-} fcs_dbm_variant_type_t;
+    typedef enum
+    {
+        FCS_DBM_VARIANT_2FC_FREECELL,
+        FCS_DBM_VARIANT_BAKERS_DOZEN,
+    } fcs_dbm_variant_type_t;
 
 #ifndef FCS_DBM_FREECELLS_NUM
 #define FCS_DBM_FREECELLS_NUM 2
diff --git a/fc-solve/source/dbm_kaztree_compare.h b/fc-solve/source/dbm_kaztree_compare.h
index e40c3e700..a181a1a4f 100644
--- a/fc-solve/source/dbm_kaztree_compare.h
+++ b/fc-solve/source/dbm_kaztree_compare.h
@@ -16,33 +16,34 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "delta_states.h"
 
 #if defined(FCS_DBM_RECORD_POINTER_REPR) && (!defined(FCS_DEBONDT_DELTA_STATES))
-static int compare_records(
-    const void *const void_a, const void *const void_b, void *const context)
-{
+    static int compare_records(
+        const void *const void_a, const void *const void_b, void *const context)
+    {
 #define GET_PARAM(p) (&(((const fcs_dbm_record_t *)(p))->key))
-    const fcs_encoded_state_buffer_t *const a = GET_PARAM(void_a),
-                                            *const b = GET_PARAM(void_b);
+        const fcs_encoded_state_buffer_t *const a = GET_PARAM(void_a),
+                                                *const b = GET_PARAM(void_b);
 #undef GET_PARAM
 
-    if (a->s[0] < b->s[0])
-    {
-        return -1;
+        if (a->s[0] < b->s[0])
+        {
+            return -1;
+        }
+        else if (a->s[0] > b->s[0])
+        {
+            return 1;
+        }
+        else
+        {
+            return memcmp(a->s, b->s, a->s[0] + 1);
+        }
     }
-    else if (a->s[0] > b->s[0])
-    {
-        return 1;
-    }
-    else
-    {
-        return memcmp(a->s, b->s, a->s[0] + 1);
-    }
-}
 #else
 static int compare_records(const void *const void_a, const void *const void_b,
     void *const context GCC_UNUSED)
diff --git a/fc-solve/source/dbm_lru_cache.h b/fc-solve/source/dbm_lru_cache.h
index 07751fc4d..3f59b1071 100644
--- a/fc-solve/source/dbm_lru_cache.h
+++ b/fc-solve/source/dbm_lru_cache.h
@@ -10,47 +10,48 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "generic_tree.h"
 #include "fcc_brfs_test.h"
 
 #ifdef FCS_LRU_KEY_IS_STATE
-typedef fcs_state_keyval_pair_t fcs_cache_key_t;
+    typedef fcs_state_keyval_pair_t fcs_cache_key_t;
 #else
 typedef fcs_encoded_state_buffer_t fcs_cache_key_t;
 #endif
 
-struct fcs_cache_key_info_struct
-{
-    fcs_cache_key_t key;
-    fcs_fcc_move_t *moves_to_key;
-    /* lower_pri and higher_pri form a doubly linked list.
-     *
-     * pri == priority.
-     * */
-    struct fcs_cache_key_info_struct *lower_pri, *higher_pri;
-};
-
-typedef struct fcs_cache_key_info_struct fcs_cache_key_info_t;
-
-typedef struct
-{
+    struct fcs_cache_key_info_struct
+    {
+        fcs_cache_key_t key;
+        fcs_fcc_move_t *moves_to_key;
+        /* lower_pri and higher_pri form a doubly linked list.
+         *
+         * pri == priority.
+         * */
+        struct fcs_cache_key_info_struct *lower_pri, *higher_pri;
+    };
+
+    typedef struct fcs_cache_key_info_struct fcs_cache_key_info_t;
+
+    typedef struct
+    {
 #if (FCS_RCS_CACHE_STORAGE == FCS_RCS_CACHE_STORAGE_JUDY)
-    Pvoid_t states_values_to_keys_map;
+        Pvoid_t states_values_to_keys_map;
 #elif (FCS_RCS_CACHE_STORAGE == FCS_RCS_CACHE_STORAGE_KAZ_TREE)
     dict_t *kaz_tree;
 #else
 #error Unknown FCS_RCS_CACHE_STORAGE
 #endif
-    fcs_compact_allocator_t states_values_to_keys_allocator;
-    long count_elements_in_cache, max_num_elements_in_cache;
+        fcs_compact_allocator_t states_values_to_keys_allocator;
+        long count_elements_in_cache, max_num_elements_in_cache;
 
-    fcs_cache_key_info_t *lowest_pri, *highest_pri, *recycle_bin;
+        fcs_cache_key_info_t *lowest_pri, *highest_pri, *recycle_bin;
 #define RECYCLE_BIN_NEXT(item) ((item)->higher_pri)
-    void *tree_recycle_bin;
-} fcs_lru_cache_t;
+        void *tree_recycle_bin;
+    } fcs_lru_cache_t;
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/dbm_move_to_string.h b/fc-solve/source/dbm_move_to_string.h
index 95802cb97..fd5e2411d 100644
--- a/fc-solve/source/dbm_move_to_string.h
+++ b/fc-solve/source/dbm_move_to_string.h
@@ -13,41 +13,42 @@
 #include "rinutils.h"
 
 #ifdef __cplusplus
-extern "C" {
-#endif
-
-static void move_to_string(unsigned char move, char *const move_buffer)
+extern "C"
 {
-    char *s = move_buffer;
+#endif
 
-    for (int iter = 0; iter < 2; iter++)
+    static void move_to_string(unsigned char move, char *const move_buffer)
     {
-        int val_to_inspect = (move & 0xF);
-        move >>= 4;
+        char *s = move_buffer;
 
-        if (val_to_inspect < 8)
+        for (int iter = 0; iter < 2; iter++)
         {
-            s += sprintf(s, "Column %d", val_to_inspect);
-        }
-        else
-        {
-            val_to_inspect -= 8;
-            if (val_to_inspect < 4)
+            int val_to_inspect = (move & 0xF);
+            move >>= 4;
+
+            if (val_to_inspect < 8)
             {
-                s += sprintf(s, "Freecell %d", val_to_inspect);
+                s += sprintf(s, "Column %d", val_to_inspect);
             }
             else
             {
-                val_to_inspect -= 4;
-                s += sprintf(s, "Foundation %d", val_to_inspect);
+                val_to_inspect -= 8;
+                if (val_to_inspect < 4)
+                {
+                    s += sprintf(s, "Freecell %d", val_to_inspect);
+                }
+                else
+                {
+                    val_to_inspect -= 4;
+                    s += sprintf(s, "Foundation %d", val_to_inspect);
+                }
+            }
+            if (iter == 0)
+            {
+                s += sprintf(s, "%s", " -> ");
             }
-        }
-        if (iter == 0)
-        {
-            s += sprintf(s, "%s", " -> ");
         }
     }
-}
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/dbm_procs.h b/fc-solve/source/dbm_procs.h
index 1e61b8c43..36752a397 100644
--- a/fc-solve/source/dbm_procs.h
+++ b/fc-solve/source/dbm_procs.h
@@ -17,99 +17,101 @@
 #include "try_param.h"
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #ifndef FCS_DBM_WITHOUT_CACHES
 
-static int fc_solve_compare_pre_cache_keys(
-    const void *const void_a, const void *const void_b, void *const context)
-{
+    static int fc_solve_compare_pre_cache_keys(
+        const void *const void_a, const void *const void_b, void *const context)
+    {
 #define GET_PARAM(p) ((((const fcs_pre_cache_key_val_pair_t *)(p))->key))
-    return memcmp(
-        &(GET_PARAM(void_a)), &(GET_PARAM(void_b)), sizeof(GET_PARAM(void_a)));
+        return memcmp(&(GET_PARAM(void_a)), &(GET_PARAM(void_b)),
+            sizeof(GET_PARAM(void_a)));
 #undef GET_PARAM
-}
-
-static inline void pre_cache_init(fcs_pre_cache_t *const pre_cache_ptr,
-    fcs_meta_compact_allocator_t *const meta_alloc)
-{
-    pre_cache_ptr->tree_recycle_bin = NULL;
-    pre_cache_ptr->kaz_tree =
-        fc_solve_kaz_tree_create(fc_solve_compare_pre_cache_keys, NULL,
-            meta_alloc, &(pre_cache_ptr->tree_recycle_bin));
-
-    fc_solve_compact_allocator_init(&(pre_cache_ptr->kv_allocator), meta_alloc);
-    pre_cache_ptr->kv_recycle_bin = NULL;
-    pre_cache_ptr->count_elements = 0;
-}
-
-static inline void pre_cache_insert(fcs_pre_cache_t *pre_cache,
-    fcs_encoded_state_buffer_t *key, fcs_encoded_state_buffer_t *parent)
-{
-    fcs_pre_cache_key_val_pair_t *to_insert;
-
-    if (pre_cache->kv_recycle_bin)
-    {
-        pre_cache->kv_recycle_bin =
-            (to_insert = pre_cache->kv_recycle_bin)->next;
     }
-    else
+
+    static inline void pre_cache_init(fcs_pre_cache_t *const pre_cache_ptr,
+        fcs_meta_compact_allocator_t *const meta_alloc)
     {
-        to_insert = fcs_compact_alloc_ptr(
-            &(pre_cache->kv_allocator), sizeof(*to_insert));
+        pre_cache_ptr->tree_recycle_bin = NULL;
+        pre_cache_ptr->kaz_tree =
+            fc_solve_kaz_tree_create(fc_solve_compare_pre_cache_keys, NULL,
+                meta_alloc, &(pre_cache_ptr->tree_recycle_bin));
+
+        fc_solve_compact_allocator_init(
+            &(pre_cache_ptr->kv_allocator), meta_alloc);
+        pre_cache_ptr->kv_recycle_bin = NULL;
+        pre_cache_ptr->count_elements = 0;
     }
-    to_insert->key = *key;
-    to_insert->parent = *parent;
 
-    fc_solve_kaz_tree_alloc_insert(pre_cache->kaz_tree, to_insert);
-    pre_cache->count_elements++;
-}
+    static inline void pre_cache_insert(fcs_pre_cache_t *pre_cache,
+        fcs_encoded_state_buffer_t *key, fcs_encoded_state_buffer_t *parent)
+    {
+        fcs_pre_cache_key_val_pair_t *to_insert;
 
-static inline fcs_bool_t pre_cache_does_key_exist(
-    fcs_pre_cache_t *pre_cache, fcs_encoded_state_buffer_t *key)
-{
-    fcs_pre_cache_key_val_pair_t to_check = {.key = *key};
-    return (
-        fc_solve_kaz_tree_lookup_value(pre_cache->kaz_tree, &to_check) != NULL);
-}
+        if (pre_cache->kv_recycle_bin)
+        {
+            pre_cache->kv_recycle_bin =
+                (to_insert = pre_cache->kv_recycle_bin)->next;
+        }
+        else
+        {
+            to_insert = fcs_compact_alloc_ptr(
+                &(pre_cache->kv_allocator), sizeof(*to_insert));
+        }
+        to_insert->key = *key;
+        to_insert->parent = *parent;
 
-static inline void cache_populate_from_pre_cache(
-    fcs_lru_cache_t *const cache, fcs_pre_cache_t *const pre_cache)
-{
-#ifdef FCS_DBM_USE_LIBAVL
-    struct rb_traverser trav;
-    var_AUTO(kaz_tree, pre_cache->kaz_tree);
-    rb_t_init(&trav, kaz_tree);
+        fc_solve_kaz_tree_alloc_insert(pre_cache->kaz_tree, to_insert);
+        pre_cache->count_elements++;
+    }
 
-    for (dict_key_t item = rb_t_first(&trav, kaz_tree); item;
-         item = rb_t_next(&trav))
+    static inline fcs_bool_t pre_cache_does_key_exist(
+        fcs_pre_cache_t *pre_cache, fcs_encoded_state_buffer_t *key)
     {
-        cache_insert(cache, &(((fcs_pre_cache_key_val_pair_t *)(item))->key),
-            NULL, '\0');
+        fcs_pre_cache_key_val_pair_t to_check = {.key = *key};
+        return (fc_solve_kaz_tree_lookup_value(
+                    pre_cache->kaz_tree, &to_check) != NULL);
     }
-#else
-    var_AUTO(kaz_tree, pre_cache->kaz_tree);
-    for (dnode_t *node = fc_solve_kaz_tree_first(kaz_tree); node;
-         node = fc_solve_kaz_tree_next(kaz_tree, node))
+
+    static inline void cache_populate_from_pre_cache(
+        fcs_lru_cache_t *const cache, fcs_pre_cache_t *const pre_cache)
     {
-        cache_insert(
-            cache, &(((fcs_pre_cache_key_val_pair_t *)(node->dict_key))->key));
-    }
+#ifdef FCS_DBM_USE_LIBAVL
+        struct rb_traverser trav;
+        var_AUTO(kaz_tree, pre_cache->kaz_tree);
+        rb_t_init(&trav, kaz_tree);
+
+        for (dict_key_t item = rb_t_first(&trav, kaz_tree); item;
+             item = rb_t_next(&trav))
+        {
+            cache_insert(cache,
+                &(((fcs_pre_cache_key_val_pair_t *)(item))->key), NULL, '\0');
+        }
+#else
+        var_AUTO(kaz_tree, pre_cache->kaz_tree);
+        for (dnode_t *node = fc_solve_kaz_tree_first(kaz_tree); node;
+             node = fc_solve_kaz_tree_next(kaz_tree, node))
+        {
+            cache_insert(cache,
+                &(((fcs_pre_cache_key_val_pair_t *)(node->dict_key))->key));
+        }
 #endif
-}
+    }
 
-static inline void pre_cache_offload_and_destroy(
-    fcs_pre_cache_t *const pre_cache, fcs_dbm_store_t store,
-    fcs_lru_cache_t *const cache)
-{
-    fc_solve_dbm_store_offload_pre_cache(store, pre_cache);
-    cache_populate_from_pre_cache(cache, pre_cache);
+    static inline void pre_cache_offload_and_destroy(
+        fcs_pre_cache_t *const pre_cache, fcs_dbm_store_t store,
+        fcs_lru_cache_t *const cache)
+    {
+        fc_solve_dbm_store_offload_pre_cache(store, pre_cache);
+        cache_populate_from_pre_cache(cache, pre_cache);
 
-    /* Now reset the pre_cache. */
-    fc_solve_kaz_tree_destroy(pre_cache->kaz_tree);
-    fc_solve_compact_allocator_finish(&(pre_cache->kv_allocator));
-}
+        /* Now reset the pre_cache. */
+        fc_solve_kaz_tree_destroy(pre_cache->kaz_tree);
+        fc_solve_compact_allocator_finish(&(pre_cache->kv_allocator));
+    }
 
 #ifndef FCS_DBM_CACHE_ONLY
 #define PRE_CACHE_OFFLOAD(instance)                                            \
@@ -123,133 +125,136 @@ static inline void pre_cache_offload_and_destroy(
 
 #ifndef FCS_DBM_CACHE_ONLY
 
-static inline void pre_cache_offload_and_reset(fcs_pre_cache_t *const pre_cache,
-    const fcs_dbm_store_t store, fcs_lru_cache_t *const cache,
-    fcs_meta_compact_allocator_t *const meta_alloc)
-{
-    pre_cache_offload_and_destroy(pre_cache, store, cache);
-    pre_cache_init(pre_cache, meta_alloc);
-}
+    static inline void pre_cache_offload_and_reset(
+        fcs_pre_cache_t *const pre_cache, const fcs_dbm_store_t store,
+        fcs_lru_cache_t *const cache,
+        fcs_meta_compact_allocator_t *const meta_alloc)
+    {
+        pre_cache_offload_and_destroy(pre_cache, store, cache);
+        pre_cache_init(pre_cache, meta_alloc);
+    }
 
 #endif
 
 #endif // FCS_DBM_WITHOUT_CACHES
 
-typedef struct fcs_dbm_solver_thread_struct fcs_dbm_solver_thread_t;
+    typedef struct fcs_dbm_solver_thread_struct fcs_dbm_solver_thread_t;
 
-typedef struct
-{
-    fcs_dbm_solver_thread_t *thread;
-} thread_arg_t;
-
-static inline void instance_check_key(fcs_dbm_solver_thread_t *const thread,
-    fcs_dbm_solver_instance_t *const instance, const int key_depth,
-    fcs_encoded_state_buffer_t *const key, fcs_dbm_record_t *const parent,
-    const unsigned char move,
-    const fcs_which_moves_bitmask_t *const which_irreversible_moves_bitmask
+    typedef struct
+    {
+        fcs_dbm_solver_thread_t *thread;
+    } thread_arg_t;
+
+    static inline void instance_check_key(fcs_dbm_solver_thread_t *const thread,
+        fcs_dbm_solver_instance_t *const instance, const int key_depth,
+        fcs_encoded_state_buffer_t *const key, fcs_dbm_record_t *const parent,
+        const unsigned char move,
+        const fcs_which_moves_bitmask_t *const which_irreversible_moves_bitmask
 #ifndef FCS_DBM_WITHOUT_CACHES
-    ,
-    const fcs_fcc_move_t *moves_to_parent
+        ,
+        const fcs_fcc_move_t *moves_to_parent
 #endif
-);
-
-static inline fcs_bool_t instance_check_multiple_keys(
-    fcs_dbm_solver_thread_t *const thread,
-    fcs_dbm_solver_instance_t *const instance,
-    fcs_dbm__cache_store__common_t *const cache_store GCC_UNUSED,
-    fcs_meta_compact_allocator_t *const meta_alloc GCC_UNUSED,
-    fcs_derived_state_t **lists, size_t batch_size
+    );
+
+    static inline fcs_bool_t instance_check_multiple_keys(
+        fcs_dbm_solver_thread_t *const thread,
+        fcs_dbm_solver_instance_t *const instance,
+        fcs_dbm__cache_store__common_t *const cache_store GCC_UNUSED,
+        fcs_meta_compact_allocator_t *const meta_alloc GCC_UNUSED,
+        fcs_derived_state_t **lists, size_t batch_size
 #ifndef FCS_DBM_WITHOUT_CACHES
-    ,
-    const fcs_fcc_move_t *moves_to_parent
+        ,
+        const fcs_fcc_move_t *moves_to_parent
 #endif
-)
-{
-    /* Small optimization in case the list is empty. */
-    if (batch_size == 1 && !lists[0])
+    )
     {
-        return FALSE;
-    }
-    fcs_lock_lock(&instance->common.storage_lock);
-    for (typeof(batch_size) batch_i = 0; batch_i < batch_size; ++batch_i)
-    {
-        for (var_AUTO(list, lists[batch_i]); list; list = list->next)
+        /* Small optimization in case the list is empty. */
+        if (batch_size == 1 && !lists[0])
         {
-            instance_check_key(thread, instance, CHECK_KEY_CALC_DEPTH(),
-                &(list->key), list->parent, list->move,
-                &(list->which_irreversible_moves_bitmask)
+            return FALSE;
+        }
+        fcs_lock_lock(&instance->common.storage_lock);
+        for (typeof(batch_size) batch_i = 0; batch_i < batch_size; ++batch_i)
+        {
+            for (var_AUTO(list, lists[batch_i]); list; list = list->next)
+            {
+                instance_check_key(thread, instance, CHECK_KEY_CALC_DEPTH(),
+                    &(list->key), list->parent, list->move,
+                    &(list->which_irreversible_moves_bitmask)
 #ifndef FCS_DBM_WITHOUT_CACHES
-                    ,
-                moves_to_parent
+                        ,
+                    moves_to_parent
 #endif
-            );
+                );
 #ifndef FCS_DBM_WITHOUT_CACHES
 #ifndef FCS_DBM_CACHE_ONLY
-            if (cache_store->pre_cache.count_elements >=
-                cache_store->pre_cache_max_count)
-            {
-                pre_cache_offload_and_reset(&(cache_store->pre_cache),
-                    cache_store->store, &(cache_store->cache), meta_alloc);
-            }
+                if (cache_store->pre_cache.count_elements >=
+                    cache_store->pre_cache_max_count)
+                {
+                    pre_cache_offload_and_reset(&(cache_store->pre_cache),
+                        cache_store->store, &(cache_store->cache), meta_alloc);
+                }
 #endif
 #endif
+            }
         }
-    }
 #ifdef MAX_FCC_DEPTH
-    const fcs_bool_t have_more = !q_stats_is_empty(
-        &instance->colls_by_depth[instance->curr_depth].queue.stats);
+        const fcs_bool_t have_more = !q_stats_is_empty(
+            &instance->colls_by_depth[instance->curr_depth].queue.stats);
 
-    if (have_more)
-    {
-        fcs_condvar_signal(&(instance->monitor));
-    }
-    else
-    {
-        fcs_condvar_broadcast(&(instance->monitor));
-    }
+        if (have_more)
+        {
+            fcs_condvar_signal(&(instance->monitor));
+        }
+        else
+        {
+            fcs_condvar_broadcast(&(instance->monitor));
+        }
 #else
     const fcs_bool_t have_more = FALSE;
 #endif
-    fcs_lock_unlock(&instance->common.storage_lock);
-    return have_more;
-}
+        fcs_lock_unlock(&instance->common.storage_lock);
+        return have_more;
+    }
 
-static void instance_print_stats(fcs_dbm_solver_instance_t *const instance)
-{
-    const_AUTO(mytime, fcs_get_time());
-    FILE *const out_fh = instance->common.out_fh;
-    fprintf(out_fh,
-        ("Reached %ld ; States-in-collection: %ld ; Time: " FCS_T_FMT "\n"
-         ">>>Queue Stats: inserted=%ld items_in_queue=%ld extracted=%ld\n"),
-        instance->common.count_num_processed,
-        instance->common.num_states_in_collection, FCS_TIME_GET_SEC(mytime),
-        FCS_TIME_GET_USEC(mytime), instance->common.num_states_in_collection,
-        instance->common.num_states_in_collection -
+    static void instance_print_stats(fcs_dbm_solver_instance_t *const instance)
+    {
+        const_AUTO(mytime, fcs_get_time());
+        FILE *const out_fh = instance->common.out_fh;
+        fprintf(out_fh,
+            ("Reached %ld ; States-in-collection: %ld ; Time: " FCS_T_FMT "\n"
+             ">>>Queue Stats: inserted=%ld items_in_queue=%ld extracted=%ld\n"),
             instance->common.count_num_processed,
-        instance->common.count_num_processed);
-    fflush(out_fh);
-}
+            instance->common.num_states_in_collection, FCS_TIME_GET_SEC(mytime),
+            FCS_TIME_GET_USEC(mytime),
+            instance->common.num_states_in_collection,
+            instance->common.num_states_in_collection -
+                instance->common.count_num_processed,
+            instance->common.count_num_processed);
+        fflush(out_fh);
+    }
 
 #ifdef DEBUG_FOO
 
-static inline void instance_debug_out_state(
-    fcs_dbm_solver_instance_t *const instance,
-    fcs_encoded_state_buffer_t *enc_state)
-{
-    fcs_state_keyval_pair_t state;
-    fcs_state_locs_struct_t locs;
-    fc_solve_init_locs(&locs);
-    DECLARE_IND_BUF_T(indirect_stacks_buffer)
-    const_AUTO(local_variant, instance->common.variant);
-    /* Handle item. */
-    fc_solve_delta_stater_decode_into_state(
-        &global_delta_stater, enc_state->s, &state, indirect_stacks_buffer);
-
-    fcs_render_state_str_t state_str;
-    FCS__RENDER_STATE(state_str, &(state.s), &locs);
-    fprintf(instance->common.out_fh, "Found State:\n<<<\n%s>>>\n", state_str);
-    fflush(instance->common.out_fh);
-}
+    static inline void instance_debug_out_state(
+        fcs_dbm_solver_instance_t *const instance,
+        fcs_encoded_state_buffer_t *enc_state)
+    {
+        fcs_state_keyval_pair_t state;
+        fcs_state_locs_struct_t locs;
+        fc_solve_init_locs(&locs);
+        DECLARE_IND_BUF_T(indirect_stacks_buffer)
+        const_AUTO(local_variant, instance->common.variant);
+        /* Handle item. */
+        fc_solve_delta_stater_decode_into_state(
+            &global_delta_stater, enc_state->s, &state, indirect_stacks_buffer);
+
+        fcs_render_state_str_t state_str;
+        FCS__RENDER_STATE(state_str, &(state.s), &locs);
+        fprintf(
+            instance->common.out_fh, "Found State:\n<<<\n%s>>>\n", state_str);
+        fflush(instance->common.out_fh);
+    }
 
 #else
 #define instance_debug_out_state(instance, key)                                \
@@ -257,88 +262,88 @@ static inline void instance_debug_out_state(
     }
 #endif
 
-static void calc_trace(fcs_dbm_record_t *const ptr_initial_record,
-    fcs_encoded_state_buffer_t **const ptr_trace, int *const ptr_trace_num)
-{
+    static void calc_trace(fcs_dbm_record_t *const ptr_initial_record,
+        fcs_encoded_state_buffer_t **const ptr_trace, int *const ptr_trace_num)
+    {
 #define GROW_BY 100
-    size_t trace_num = 0;
-    size_t trace_max_num = GROW_BY;
-    fcs_encoded_state_buffer_t *trace = SMALLOC(trace, trace_max_num);
-    fcs_encoded_state_buffer_t *key_ptr = trace;
-    fcs_dbm_record_t *record = ptr_initial_record;
+        size_t trace_num = 0;
+        size_t trace_max_num = GROW_BY;
+        fcs_encoded_state_buffer_t *trace = SMALLOC(trace, trace_max_num);
+        fcs_encoded_state_buffer_t *key_ptr = trace;
+        fcs_dbm_record_t *record = ptr_initial_record;
 
-    while (record)
-    {
-#if 1
-        *(key_ptr) = record->key;
-        if ((++trace_num) == trace_max_num)
+        while (record)
         {
-            trace = SREALLOC(trace, trace_max_num += GROW_BY);
-            key_ptr = &(trace[trace_num - 1]);
-        }
-        record = fcs_dbm_record_get_parent_ptr(record);
-        key_ptr++;
+#if 1
+            *(key_ptr) = record->key;
+            if ((++trace_num) == trace_max_num)
+            {
+                trace = SREALLOC(trace, trace_max_num += GROW_BY);
+                key_ptr = &(trace[trace_num - 1]);
+            }
+            record = fcs_dbm_record_get_parent_ptr(record);
+            key_ptr++;
 #endif
-    }
+        }
 #undef GROW_BY
-    *ptr_trace_num = trace_num;
-    *ptr_trace = trace;
-}
+        *ptr_trace_num = trace_num;
+        *ptr_trace = trace;
+    }
 
-static inline void mark_and_sweep_old_states(
-    fcs_dbm_solver_instance_t *const instance, dict_t *const kaz_tree,
-    const int curr_depth)
-{
-    /* Now that we are about to ascend to a new depth, let's
-     * mark-and-sweep
-     * the old states, some of which are no longer of interest.
-     * */
-    FILE *const out_fh = instance->common.out_fh;
-    TRACE("Start mark-and-sweep cleanup for curr_depth=%d\n", curr_depth);
-    const_AUTO(tree_recycle_bin,
-        ((struct rb_node **)(&(instance->common.tree_recycle_bin))));
-
-    struct rb_traverser trav;
-    rb_t_init(&trav, kaz_tree);
-
-    const size_t items_count = kaz_tree->rb_count;
-    size_t idx = 0;
-    for (dict_key_t item = rb_t_first(&trav, kaz_tree); item;
-         item = rb_t_next(&trav))
+    static inline void mark_and_sweep_old_states(
+        fcs_dbm_solver_instance_t *const instance, dict_t *const kaz_tree,
+        const int curr_depth)
     {
-        if (!rb_get_decommissioned_flag(item))
+        /* Now that we are about to ascend to a new depth, let's
+         * mark-and-sweep
+         * the old states, some of which are no longer of interest.
+         * */
+        FILE *const out_fh = instance->common.out_fh;
+        TRACE("Start mark-and-sweep cleanup for curr_depth=%d\n", curr_depth);
+        const_AUTO(tree_recycle_bin,
+            ((struct rb_node **)(&(instance->common.tree_recycle_bin))));
+
+        struct rb_traverser trav;
+        rb_t_init(&trav, kaz_tree);
+
+        const size_t items_count = kaz_tree->rb_count;
+        size_t idx = 0;
+        for (dict_key_t item = rb_t_first(&trav, kaz_tree); item;
+             item = rb_t_next(&trav))
         {
-            var_AUTO(ancestor, (struct rb_node *)item);
-            while (fcs_dbm_record_get_refcount(&(ancestor->rb_data)) == 0)
+            if (!rb_get_decommissioned_flag(item))
             {
-                rb_set_decommissioned_flag(ancestor, 1);
-
-                AVL_SET_NEXT(ancestor, *tree_recycle_bin);
-                *tree_recycle_bin = ancestor;
-
-                if (!(ancestor =
-                            (struct rb_node *)fcs_dbm_record_get_parent_ptr(
-                                &(ancestor->rb_data))))
+                var_AUTO(ancestor, (struct rb_node *)item);
+                while (fcs_dbm_record_get_refcount(&(ancestor->rb_data)) == 0)
                 {
-                    break;
+                    rb_set_decommissioned_flag(ancestor, 1);
+
+                    AVL_SET_NEXT(ancestor, *tree_recycle_bin);
+                    *tree_recycle_bin = ancestor;
+
+                    if (!(ancestor =
+                                (struct rb_node *)fcs_dbm_record_get_parent_ptr(
+                                    &(ancestor->rb_data))))
+                    {
+                        break;
+                    }
+                    fcs_dbm_record_decrement_refcount(&(ancestor->rb_data));
                 }
-                fcs_dbm_record_decrement_refcount(&(ancestor->rb_data));
             }
-        }
-        if (((++idx) % 100000) == 0)
-        {
+            if (((++idx) % 100000) == 0)
+            {
 #ifdef WIN32
-            fprintf(out_fh,
-                "Mark+Sweep Progress - " FCS_LL_FMT "/" FCS_LL_FMT "\n",
-                (long long)idx, (long long)items_count);
+                fprintf(out_fh,
+                    "Mark+Sweep Progress - " FCS_LL_FMT "/" FCS_LL_FMT "\n",
+                    (long long)idx, (long long)items_count);
 #else
             fprintf(
                 out_fh, "Mark+Sweep Progress - %zu/%zu\n", idx, items_count);
 #endif
+            }
         }
+        TRACE("Finish mark-and-sweep cleanup for curr_depth=%d\n", curr_depth);
     }
-    TRACE("Finish mark-and-sweep cleanup for curr_depth=%d\n", curr_depth);
-}
 
 #ifdef FCS_DBM_SINGLE_THREAD
 #define NUM_THREADS() 1
@@ -364,161 +369,163 @@ static inline void mark_and_sweep_old_states(
 #define DESTROY_CACHE(instance) DESTROY_STORE(instance)
 #endif
 
-static inline void instance_increment(fcs_dbm_solver_instance_t *const instance)
-{
-    --instance->common.count_of_items_in_queue;
-    ++instance->common.queue_num_extracted_and_processed;
-    if (++instance->common.count_num_processed % 100000 == 0)
+    static inline void instance_increment(
+        fcs_dbm_solver_instance_t *const instance)
     {
-        instance_print_stats(instance);
-    }
-    if (instance->common.count_num_processed >=
-        instance->common.max_count_num_processed)
-    {
-        instance->common.should_terminate = MAX_ITERS_TERMINATE;
+        --instance->common.count_of_items_in_queue;
+        ++instance->common.queue_num_extracted_and_processed;
+        if (++instance->common.count_num_processed % 100000 == 0)
+        {
+            instance_print_stats(instance);
+        }
+        if (instance->common.count_num_processed >=
+            instance->common.max_count_num_processed)
+        {
+            instance->common.should_terminate = MAX_ITERS_TERMINATE;
+        }
     }
-}
 
-static inline void fcs_dbm__cache_store__init(
-    fcs_dbm__cache_store__common_t *const cache_store,
-    fcs_dbm_instance_common_elems_t *const common,
-    fcs_meta_compact_allocator_t *const meta_alloc GCC_UNUSED,
-    const char *const dbm_store_path, const long pre_cache_max_count GCC_UNUSED,
-    const long caches_delta GCC_UNUSED)
-{
+    static inline void fcs_dbm__cache_store__init(
+        fcs_dbm__cache_store__common_t *const cache_store,
+        fcs_dbm_instance_common_elems_t *const common,
+        fcs_meta_compact_allocator_t *const meta_alloc GCC_UNUSED,
+        const char *const dbm_store_path,
+        const long pre_cache_max_count GCC_UNUSED,
+        const long caches_delta GCC_UNUSED)
+    {
 #ifndef FCS_DBM_WITHOUT_CACHES
 #ifndef FCS_DBM_CACHE_ONLY
-    pre_cache_init(&(cache_store->pre_cache), meta_alloc);
+        pre_cache_init(&(cache_store->pre_cache), meta_alloc);
 #endif
-    cache_init(
-        &(cache_store->cache), pre_cache_max_count + caches_delta, meta_alloc);
+        cache_init(&(cache_store->cache), pre_cache_max_count + caches_delta,
+            meta_alloc);
 #endif
 #ifndef FCS_DBM_CACHE_ONLY
-    fc_solve_dbm_store_init(
-        &(cache_store->store), dbm_store_path, &(common->tree_recycle_bin));
+        fc_solve_dbm_store_init(
+            &(cache_store->store), dbm_store_path, &(common->tree_recycle_bin));
 #endif
-}
+    }
 
-typedef struct
-{
-    fcs_dbm_variant_type_t local_variant;
-    const char *offload_dir_path, *dbm_store_path;
-    long pre_cache_max_count, iters_delta_limit, caches_delta;
-    size_t num_threads;
-} fcs_dbm_common_input_t;
-
-static const fcs_dbm_common_input_t fcs_dbm_common_input_init = {
-    .local_variant = FCS_DBM_VARIANT_2FC_FREECELL,
-    .offload_dir_path = NULL,
-    .dbm_store_path = "./fc_solve_dbm_store",
-    .pre_cache_max_count = 1000000,
-    .iters_delta_limit = -1,
-    .caches_delta = 1000000,
-    .num_threads = 2};
-
-static inline fcs_bool_t fcs_dbm__extract_common_from_argv(const int argc,
-    char **const argv, int *const arg, fcs_dbm_common_input_t *const inp)
-{
-    const char *param;
-    if ((param = TRY_PARAM("--pre-cache-max-count")))
+    typedef struct
+    {
+        fcs_dbm_variant_type_t local_variant;
+        const char *offload_dir_path, *dbm_store_path;
+        long pre_cache_max_count, iters_delta_limit, caches_delta;
+        size_t num_threads;
+    } fcs_dbm_common_input_t;
+
+    static const fcs_dbm_common_input_t fcs_dbm_common_input_init = {
+        .local_variant = FCS_DBM_VARIANT_2FC_FREECELL,
+        .offload_dir_path = NULL,
+        .dbm_store_path = "./fc_solve_dbm_store",
+        .pre_cache_max_count = 1000000,
+        .iters_delta_limit = -1,
+        .caches_delta = 1000000,
+        .num_threads = 2};
+
+    static inline fcs_bool_t fcs_dbm__extract_common_from_argv(const int argc,
+        char **const argv, int *const arg, fcs_dbm_common_input_t *const inp)
     {
-        if ((inp->pre_cache_max_count = atol(param)) < 1000)
+        const char *param;
+        if ((param = TRY_PARAM("--pre-cache-max-count")))
         {
-            fc_solve_err("--pre-cache-max-count must be at least 1,000.\n");
+            if ((inp->pre_cache_max_count = atol(param)) < 1000)
+            {
+                fc_solve_err("--pre-cache-max-count must be at least 1,000.\n");
+            }
+            return TRUE;
         }
-        return TRUE;
-    }
-    else if ((param = TRY_PARAM("--game")))
-    {
-        if (!strcmp(param, "bakers_dozen"))
+        else if ((param = TRY_PARAM("--game")))
         {
-            inp->local_variant = FCS_DBM_VARIANT_BAKERS_DOZEN;
+            if (!strcmp(param, "bakers_dozen"))
+            {
+                inp->local_variant = FCS_DBM_VARIANT_BAKERS_DOZEN;
+            }
+            else if (!strcmp(param, "freecell"))
+            {
+                inp->local_variant = FCS_DBM_VARIANT_2FC_FREECELL;
+            }
+            else
+            {
+                fc_solve_err("Unknown game '%s'. Aborting\n", param);
+            }
+            return TRUE;
         }
-        else if (!strcmp(param, "freecell"))
+        else if ((param = TRY_PARAM("--offload-dir-path")))
         {
-            inp->local_variant = FCS_DBM_VARIANT_2FC_FREECELL;
+            inp->offload_dir_path = param;
+            return TRUE;
         }
-        else
+        else if ((param = TRY_PARAM("--num-threads")))
         {
-            fc_solve_err("Unknown game '%s'. Aborting\n", param);
+            if ((inp->num_threads = (size_t)atoi(param)) < 1)
+            {
+                fc_solve_err("--num-threads must be at least 1.\n");
+            }
+            return TRUE;
         }
-        return TRUE;
-    }
-    else if ((param = TRY_PARAM("--offload-dir-path")))
-    {
-        inp->offload_dir_path = param;
-        return TRUE;
-    }
-    else if ((param = TRY_PARAM("--num-threads")))
-    {
-        if ((inp->num_threads = (size_t)atoi(param)) < 1)
+        else if ((param = TRY_PARAM("--iters-delta-limit")))
         {
-            fc_solve_err("--num-threads must be at least 1.\n");
+            inp->iters_delta_limit = atol(param);
+            return TRUE;
         }
-        return TRUE;
-    }
-    else if ((param = TRY_PARAM("--iters-delta-limit")))
-    {
-        inp->iters_delta_limit = atol(param);
-        return TRUE;
-    }
-    else if ((param = TRY_PARAM("--caches-delta")))
-    {
-        if ((inp->caches_delta = atol(param)) < 1000)
+        else if ((param = TRY_PARAM("--caches-delta")))
         {
-            fc_solve_err("--caches-delta must be at least 1,000.\n");
+            if ((inp->caches_delta = atol(param)) < 1000)
+            {
+                fc_solve_err("--caches-delta must be at least 1,000.\n");
+            }
+            return TRUE;
         }
-        return TRUE;
-    }
-    else if ((param = TRY_PARAM("--dbm-store-path")))
-    {
-        inp->dbm_store_path = param;
-        return TRUE;
+        else if ((param = TRY_PARAM("--dbm-store-path")))
+        {
+            inp->dbm_store_path = param;
+            return TRUE;
+        }
+        return FALSE;
     }
-    return FALSE;
-}
 
-static inline fcs_dbm_record_t *cache_store__has_key(
-    fcs_dbm__cache_store__common_t *const cache_store,
-    fcs_encoded_state_buffer_t *const key, fcs_dbm_record_t *const parent)
-{
-#ifndef FCS_DBM_WITHOUT_CACHES
-    if (cache_does_key_exist(&(cache_store->cache), key))
+    static inline fcs_dbm_record_t *cache_store__has_key(
+        fcs_dbm__cache_store__common_t *const cache_store,
+        fcs_encoded_state_buffer_t *const key, fcs_dbm_record_t *const parent)
     {
-        return NULL;
-    }
+#ifndef FCS_DBM_WITHOUT_CACHES
+        if (cache_does_key_exist(&(cache_store->cache), key))
+        {
+            return NULL;
+        }
 #ifndef FCS_DBM_CACHE_ONLY
-    else if (pre_cache_does_key_exist(&(cache_store->pre_cache), key))
-    {
-        return NULL;
-    }
-    else if (fc_solve_dbm_store_does_key_exist(cache_store->store, key->s))
-    {
-        cache_insert(&(cache_store->cache), key, NULL, '\0');
-        return NULL;
-    }
+        else if (pre_cache_does_key_exist(&(cache_store->pre_cache), key))
+        {
+            return NULL;
+        }
+        else if (fc_solve_dbm_store_does_key_exist(cache_store->store, key->s))
+        {
+            cache_insert(&(cache_store->cache), key, NULL, '\0');
+            return NULL;
+        }
 #endif
-    return ((fcs_dbm_record_t *)key);
+        return ((fcs_dbm_record_t *)key);
 #else
     return fc_solve_dbm_store_insert_key_value(
         cache_store->store, key, parent, TRUE);
 #endif
-}
+    }
 
 #ifndef FCS_DBM_WITHOUT_CACHES
-static inline fcs_cache_key_info_t *cache_store__insert_key(
-    fcs_dbm__cache_store__common_t *const cache_store,
-    fcs_encoded_state_buffer_t *const key, fcs_dbm_record_t *const parent,
-    const fcs_fcc_move_t *const moves_to_parent,
-    const unsigned char move GCC_UNUSED)
-{
+    static inline fcs_cache_key_info_t *cache_store__insert_key(
+        fcs_dbm__cache_store__common_t *const cache_store,
+        fcs_encoded_state_buffer_t *const key, fcs_dbm_record_t *const parent,
+        const fcs_fcc_move_t *const moves_to_parent,
+        const unsigned char move GCC_UNUSED)
+    {
 #ifndef FCS_DBM_CACHE_ONLY
-    pre_cache_insert(&(cache_store->pre_cache), key, &(parent->key));
-    return NULL;
+        pre_cache_insert(&(cache_store->pre_cache), key, &(parent->key));
+        return NULL;
 #else
-    return cache_insert(&(cache_store->cache), key, moves_to_parent, move);
+        return cache_insert(&(cache_store->cache), key, moves_to_parent, move);
 #endif
-}
+    }
 #endif
 
 #ifdef __cplusplus
diff --git a/fc-solve/source/dbm_solver.h b/fc-solve/source/dbm_solver.h
index 919bb1d99..c0efe8a86 100644
--- a/fc-solve/source/dbm_solver.h
+++ b/fc-solve/source/dbm_solver.h
@@ -10,7 +10,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "generic_tree.h"
@@ -24,137 +25,140 @@ extern "C" {
 
 #include "dbm_lru_cache.h"
 
-typedef union fcs_pre_cache_key_val_pair_struct {
-    struct
-    {
-        fcs_encoded_state_buffer_t key;
-        fcs_encoded_state_buffer_t parent;
-    };
-    union fcs_pre_cache_key_val_pair_struct *next;
-} fcs_pre_cache_key_val_pair_t;
+    typedef union fcs_pre_cache_key_val_pair_struct {
+        struct
+        {
+            fcs_encoded_state_buffer_t key;
+            fcs_encoded_state_buffer_t parent;
+        };
+        union fcs_pre_cache_key_val_pair_struct *next;
+    } fcs_pre_cache_key_val_pair_t;
 
-typedef struct
-{
-    dict_t *kaz_tree;
-    fcs_compact_allocator_t kv_allocator;
-    fcs_pre_cache_key_val_pair_t *kv_recycle_bin;
-    long count_elements;
-    void *tree_recycle_bin;
-} fcs_pre_cache_t;
+    typedef struct
+    {
+        dict_t *kaz_tree;
+        fcs_compact_allocator_t kv_allocator;
+        fcs_pre_cache_key_val_pair_t *kv_recycle_bin;
+        long count_elements;
+        void *tree_recycle_bin;
+    } fcs_pre_cache_t;
 #endif
 
-typedef void *fcs_dbm_store_t;
-void fc_solve_dbm_store_init(fcs_dbm_store_t *, const char *, void **);
-dict_t *fc_solve_dbm_store_get_dict(fcs_dbm_store_t);
-fcs_bool_t fc_solve_dbm_store_does_key_exist(
-    fcs_dbm_store_t, const unsigned char *);
-fcs_bool_t fc_solve_dbm_store_lookup_parent(
-    fcs_dbm_store_t, const unsigned char *const, unsigned char *const);
+    typedef void *fcs_dbm_store_t;
+    void fc_solve_dbm_store_init(fcs_dbm_store_t *, const char *, void **);
+    dict_t *fc_solve_dbm_store_get_dict(fcs_dbm_store_t);
+    fcs_bool_t fc_solve_dbm_store_does_key_exist(
+        fcs_dbm_store_t, const unsigned char *);
+    fcs_bool_t fc_solve_dbm_store_lookup_parent(
+        fcs_dbm_store_t, const unsigned char *const, unsigned char *const);
 
-fcs_dbm_record_t *fc_solve_dbm_store_insert_key_value(fcs_dbm_store_t store,
-    const fcs_encoded_state_buffer_t *key, fcs_dbm_record_t *parent,
-    const fcs_bool_t should_modify_parent);
+    fcs_dbm_record_t *fc_solve_dbm_store_insert_key_value(fcs_dbm_store_t store,
+        const fcs_encoded_state_buffer_t *key, fcs_dbm_record_t *parent,
+        const fcs_bool_t should_modify_parent);
 
 #ifndef FCS_DBM_WITHOUT_CACHES
-void fc_solve_dbm_store_offload_pre_cache(
-    fcs_dbm_store_t store, fcs_pre_cache_t *const pre_cache);
+    void fc_solve_dbm_store_offload_pre_cache(
+        fcs_dbm_store_t store, fcs_pre_cache_t *const pre_cache);
 #endif
 
-void fc_solve_dbm_store_destroy(fcs_dbm_store_t store);
+    void fc_solve_dbm_store_destroy(fcs_dbm_store_t store);
 
-typedef struct fcs_dbm_queue_item_struct
-{
-    fcs_encoded_state_buffer_t key;
-    /* TODO : maybe get rid of moves_seq with FCS_DBM_WITHOUT_CACHES
-     * to save space. */
-    fcs_fcc_moves_seq_t moves_seq;
+    typedef struct fcs_dbm_queue_item_struct
+    {
+        fcs_encoded_state_buffer_t key;
+        /* TODO : maybe get rid of moves_seq with FCS_DBM_WITHOUT_CACHES
+         * to save space. */
+        fcs_fcc_moves_seq_t moves_seq;
 #ifndef FCS_DBM_WITHOUT_CACHES
-    fcs_fcc_move_t *moves_to_key;
+        fcs_fcc_move_t *moves_to_key;
 #endif
 
-    struct fcs_dbm_queue_item_struct *next;
-} fcs_dbm_queue_item_t;
+        struct fcs_dbm_queue_item_struct *next;
+    } fcs_dbm_queue_item_t;
 
-enum TERMINATE_REASON
-{
-    DONT_TERMINATE = 0,
-    QUEUE_TERMINATE,
-    MAX_ITERS_TERMINATE,
-    SOLUTION_FOUND_TERMINATE
-};
+    enum TERMINATE_REASON
+    {
+        DONT_TERMINATE = 0,
+        QUEUE_TERMINATE,
+        MAX_ITERS_TERMINATE,
+        SOLUTION_FOUND_TERMINATE
+    };
 
-typedef struct
-{
-    fcs_lock_t storage_lock;
-    long queue_num_extracted_and_processed;
-    fcs_encoded_state_buffer_t first_key;
-    long num_states_in_collection;
-    FILE *out_fh;
-    fcs_dbm_variant_type_t variant;
-    long count_num_processed, count_of_items_in_queue, max_count_num_processed;
-    fcs_bool_t queue_solution_was_found;
-    enum TERMINATE_REASON should_terminate;
+    typedef struct
+    {
+        fcs_lock_t storage_lock;
+        long queue_num_extracted_and_processed;
+        fcs_encoded_state_buffer_t first_key;
+        long num_states_in_collection;
+        FILE *out_fh;
+        fcs_dbm_variant_type_t variant;
+        long count_num_processed, count_of_items_in_queue,
+            max_count_num_processed;
+        fcs_bool_t queue_solution_was_found;
+        enum TERMINATE_REASON should_terminate;
 #ifdef FCS_DBM_WITHOUT_CACHES
-    fcs_dbm_record_t *queue_solution_ptr;
+        fcs_dbm_record_t *queue_solution_ptr;
 #else
     fcs_encoded_state_buffer_t queue_solution;
 #endif
-    void *tree_recycle_bin;
-} fcs_dbm_instance_common_elems_t;
+        void *tree_recycle_bin;
+    } fcs_dbm_instance_common_elems_t;
 
-static inline void fcs_dbm__found_solution(
-    fcs_dbm_instance_common_elems_t *const common,
-    fcs_dbm_record_t *const token, fcs_dbm_queue_item_t *const item GCC_UNUSED)
-{
-    common->should_terminate = SOLUTION_FOUND_TERMINATE;
-    common->queue_solution_was_found = TRUE;
+    static inline void fcs_dbm__found_solution(
+        fcs_dbm_instance_common_elems_t *const common,
+        fcs_dbm_record_t *const token,
+        fcs_dbm_queue_item_t *const item GCC_UNUSED)
+    {
+        common->should_terminate = SOLUTION_FOUND_TERMINATE;
+        common->queue_solution_was_found = TRUE;
 #ifdef FCS_DBM_WITHOUT_CACHES
-    common->queue_solution_ptr = token;
+        common->queue_solution_ptr = token;
 #else
     common->queue_solution = item->key;
 #endif
-}
-
-static inline void fcs_dbm__common_init(
-    fcs_dbm_instance_common_elems_t *const common, const long iters_delta_limit,
-    const fcs_dbm_variant_type_t local_variant, FILE *const out_fh)
-{
-    common->variant = local_variant;
-    common->out_fh = out_fh;
-    common->queue_solution_was_found = FALSE;
-    common->should_terminate = DONT_TERMINATE;
-    common->queue_num_extracted_and_processed = 0;
-    common->num_states_in_collection = 0;
-    common->count_num_processed = 0;
-    if (iters_delta_limit >= 0)
-    {
-        common->max_count_num_processed =
-            common->count_num_processed + iters_delta_limit;
     }
-    else
+
+    static inline void fcs_dbm__common_init(
+        fcs_dbm_instance_common_elems_t *const common,
+        const long iters_delta_limit,
+        const fcs_dbm_variant_type_t local_variant, FILE *const out_fh)
     {
-        common->max_count_num_processed = LONG_MAX;
+        common->variant = local_variant;
+        common->out_fh = out_fh;
+        common->queue_solution_was_found = FALSE;
+        common->should_terminate = DONT_TERMINATE;
+        common->queue_num_extracted_and_processed = 0;
+        common->num_states_in_collection = 0;
+        common->count_num_processed = 0;
+        if (iters_delta_limit >= 0)
+        {
+            common->max_count_num_processed =
+                common->count_num_processed + iters_delta_limit;
+        }
+        else
+        {
+            common->max_count_num_processed = LONG_MAX;
+        }
+        common->count_of_items_in_queue = 0;
+        common->tree_recycle_bin = NULL;
+        fcs_lock_init(&common->storage_lock);
     }
-    common->count_of_items_in_queue = 0;
-    common->tree_recycle_bin = NULL;
-    fcs_lock_init(&common->storage_lock);
-}
 
-typedef struct
-{
+    typedef struct
+    {
 #ifndef FCS_DBM_WITHOUT_CACHES
 #ifndef FCS_DBM_CACHE_ONLY
-    fcs_pre_cache_t pre_cache;
+        fcs_pre_cache_t pre_cache;
 #endif
-    fcs_lru_cache_t cache;
+        fcs_lru_cache_t cache;
 #endif
 #ifndef FCS_DBM_CACHE_ONLY
-    fcs_dbm_store_t store;
+        fcs_dbm_store_t store;
 #endif
 
-    /* The queue */
-    long pre_cache_max_count;
-} fcs_dbm__cache_store__common_t;
+        /* The queue */
+        long pre_cache_max_count;
+    } fcs_dbm__cache_store__common_t;
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/dbm_solver_head.h b/fc-solve/source/dbm_solver_head.h
index ed9ce0baa..e326bad4a 100644
--- a/fc-solve/source/dbm_solver_head.h
+++ b/fc-solve/source/dbm_solver_head.h
@@ -15,7 +15,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include <pthread.h>
@@ -56,7 +57,7 @@ extern "C" {
 #include "dbm_trace.h"
 
 #ifdef DEBUG_FOO
-fc_solve_delta_stater_t global_delta_stater;
+    fc_solve_delta_stater_t global_delta_stater;
 #endif
 
 #ifdef __cplusplus
diff --git a/fc-solve/source/debondt_delta_states_iface.h b/fc-solve/source/debondt_delta_states_iface.h
index 84ff0dfd2..ee3419465 100644
--- a/fc-solve/source/debondt_delta_states_iface.h
+++ b/fc-solve/source/debondt_delta_states_iface.h
@@ -15,11 +15,12 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-extern char *fc_solve_user_INTERNAL_debondt_delta_states_enc_and_dec(
-    fcs_dbm_variant_type_t, const char *, const char *);
+    extern char *fc_solve_user_INTERNAL_debondt_delta_states_enc_and_dec(
+        fcs_dbm_variant_type_t, const char *, const char *);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/delta_states.h b/fc-solve/source/delta_states.h
index 807782779..ddff8b436 100644
--- a/fc-solve/source/delta_states.h
+++ b/fc-solve/source/delta_states.h
@@ -14,7 +14,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "dbm_common.h"
@@ -25,10 +26,10 @@ extern "C" {
 #define FCS_ENCODED_STATE_COUNT_CHARS 24
 #endif
 
-typedef struct
-{
-    unsigned char s[FCS_ENCODED_STATE_COUNT_CHARS];
-} fcs_encoded_state_buffer_t;
+    typedef struct
+    {
+        unsigned char s[FCS_ENCODED_STATE_COUNT_CHARS];
+    } fcs_encoded_state_buffer_t;
 
 #if SIZEOF_VOID_P == 4
 #define FCS_EXPLICIT_REFCOUNT 1
@@ -36,88 +37,90 @@ typedef struct
 
 #ifdef FCS_DBM_RECORD_POINTER_REPR
 
-typedef struct
-{
-    fcs_encoded_state_buffer_t key;
-    uintptr_t parent_and_refcount;
+    typedef struct
+    {
+        fcs_encoded_state_buffer_t key;
+        uintptr_t parent_and_refcount;
 #ifdef FCS_EXPLICIT_REFCOUNT
-    unsigned char refcount;
+        unsigned char refcount;
 #endif
-} fcs_dbm_record_t;
+    } fcs_dbm_record_t;
 
 #define FCS_DBM_RECORD_SHIFT ((sizeof(rec->parent_and_refcount) - 1) * 8)
 
 #ifdef FCS_EXPLICIT_REFCOUNT
-static inline fcs_dbm_record_t *fcs_dbm_record_get_parent_ptr(
-    fcs_dbm_record_t *const rec)
-{
-    return (fcs_dbm_record_t *)(rec->parent_and_refcount);
-}
+    static inline fcs_dbm_record_t *fcs_dbm_record_get_parent_ptr(
+        fcs_dbm_record_t *const rec)
+    {
+        return (fcs_dbm_record_t *)(rec->parent_and_refcount);
+    }
 #else
-static inline fcs_dbm_record_t *fcs_dbm_record_get_parent_ptr(
-    fcs_dbm_record_t *const rec)
-{
-    return (fcs_dbm_record_t *)(rec->parent_and_refcount &
+    static inline fcs_dbm_record_t *fcs_dbm_record_get_parent_ptr(
+        fcs_dbm_record_t *const rec)
+    {
+        return (
+            fcs_dbm_record_t *)(rec->parent_and_refcount &
                                 (~(((uintptr_t)0xFF) << FCS_DBM_RECORD_SHIFT)));
-}
+    }
 #endif
 
-static inline void fcs_dbm_record_set_parent_ptr(
-    fcs_dbm_record_t *const rec, fcs_dbm_record_t *const parent_ptr)
-{
-    rec->parent_and_refcount = ((uintptr_t)parent_ptr);
+    static inline void fcs_dbm_record_set_parent_ptr(
+        fcs_dbm_record_t *const rec, fcs_dbm_record_t *const parent_ptr)
+    {
+        rec->parent_and_refcount = ((uintptr_t)parent_ptr);
 #ifdef FCS_EXPLICIT_REFCOUNT
-    rec->refcount = 0;
+        rec->refcount = 0;
 #endif
-}
+    }
 
 #ifdef FCS_EXPLICIT_REFCOUNT
-static inline unsigned char fcs_dbm_record_get_refcount(
-    const fcs_dbm_record_t *const rec)
-{
-    return rec->refcount;
-}
+    static inline unsigned char fcs_dbm_record_get_refcount(
+        const fcs_dbm_record_t *const rec)
+    {
+        return rec->refcount;
+    }
 #else
-static inline unsigned char fcs_dbm_record_get_refcount(
-    const fcs_dbm_record_t *const rec)
-{
-    return (unsigned char)(rec->parent_and_refcount >> FCS_DBM_RECORD_SHIFT);
-}
+    static inline unsigned char fcs_dbm_record_get_refcount(
+        const fcs_dbm_record_t *const rec)
+    {
+        return (
+            unsigned char)(rec->parent_and_refcount >> FCS_DBM_RECORD_SHIFT);
+    }
 #endif
 
 #ifdef FCS_EXPLICIT_REFCOUNT
-static inline void fcs_dbm_record_set_refcount(
-    fcs_dbm_record_t *const rec, const unsigned char new_val)
-{
-    rec->refcount = new_val;
-}
+    static inline void fcs_dbm_record_set_refcount(
+        fcs_dbm_record_t *const rec, const unsigned char new_val)
+    {
+        rec->refcount = new_val;
+    }
 #else
-static inline void fcs_dbm_record_set_refcount(
-    fcs_dbm_record_t *const rec, const unsigned char new_val)
-{
-    rec->parent_and_refcount &=
-        (~(((const uintptr_t)0xFF) << FCS_DBM_RECORD_SHIFT));
-    rec->parent_and_refcount |=
-        (((const uintptr_t)new_val) << FCS_DBM_RECORD_SHIFT);
-}
+    static inline void fcs_dbm_record_set_refcount(
+        fcs_dbm_record_t *const rec, const unsigned char new_val)
+    {
+        rec->parent_and_refcount &=
+            (~(((const uintptr_t)0xFF) << FCS_DBM_RECORD_SHIFT));
+        rec->parent_and_refcount |=
+            (((const uintptr_t)new_val) << FCS_DBM_RECORD_SHIFT);
+    }
 #endif
 
-static inline void fcs_dbm_record_increment_refcount(
-    fcs_dbm_record_t *const rec)
-{
-    fcs_dbm_record_set_refcount(rec, fcs_dbm_record_get_refcount(rec) + 1);
-}
+    static inline void fcs_dbm_record_increment_refcount(
+        fcs_dbm_record_t *const rec)
+    {
+        fcs_dbm_record_set_refcount(rec, fcs_dbm_record_get_refcount(rec) + 1);
+    }
 
-/* Returns the new value so we can tell if it is zero. */
-static inline unsigned char fcs_dbm_record_decrement_refcount(
-    fcs_dbm_record_t *const rec)
-{
-    const unsigned char new_val = fcs_dbm_record_get_refcount(rec) - 1;
+    /* Returns the new value so we can tell if it is zero. */
+    static inline unsigned char fcs_dbm_record_decrement_refcount(
+        fcs_dbm_record_t *const rec)
+    {
+        const unsigned char new_val = fcs_dbm_record_get_refcount(rec) - 1;
 
-    fcs_dbm_record_set_refcount(rec, new_val);
+        fcs_dbm_record_set_refcount(rec, new_val);
 
-    return new_val;
-}
+        return new_val;
+    }
 
 #else
 
@@ -129,24 +132,25 @@ typedef struct
 
 #endif
 
-typedef struct
-{
+    typedef struct
+    {
 #ifndef FCS_FREECELL_ONLY
-    int sequences_are_built_by;
+        int sequences_are_built_by;
 #endif
-    size_t num_freecells;
-    size_t num_columns;
-    fcs_state_t *init_state, *derived_state;
-    int bits_per_orig_cards_in_column;
-} fc_solve_delta_stater_t;
-
-static inline void fcs_init_encoded_state(fcs_encoded_state_buffer_t *enc_state)
-{
-    memset(enc_state, '\0', sizeof(*enc_state));
-}
-
-extern char *fc_solve_user_INTERNAL_delta_states_enc_and_dec(
-    fcs_dbm_variant_type_t, const char *, const char *);
+        size_t num_freecells;
+        size_t num_columns;
+        fcs_state_t *init_state, *derived_state;
+        int bits_per_orig_cards_in_column;
+    } fc_solve_delta_stater_t;
+
+    static inline void fcs_init_encoded_state(
+        fcs_encoded_state_buffer_t *enc_state)
+    {
+        memset(enc_state, '\0', sizeof(*enc_state));
+    }
+
+    extern char *fc_solve_user_INTERNAL_delta_states_enc_and_dec(
+        fcs_dbm_variant_type_t, const char *, const char *);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/delta_states_any.h b/fc-solve/source/delta_states_any.h
index 4737d26bd..6810e0642 100644
--- a/fc-solve/source/delta_states_any.h
+++ b/fc-solve/source/delta_states_any.h
@@ -14,7 +14,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #ifdef FCS_DEBONDT_DELTA_STATES
@@ -30,22 +31,23 @@ extern "C" {
 #define fcs_init_and_encode_state(a, b, c, d)                                  \
     fcs_debondt_init_and_encode_state(a, b, c, d)
 #ifdef FCS_FREECELL_ONLY
-static inline void fc_solve_delta_stater_init(
-    fc_solve_debondt_delta_stater_t *const delta, fcs_state_t *const init_state,
-    const size_t num_columns, const int num_freecells)
-{
-    fc_solve_debondt_delta_stater_init(delta, FCS_DBM_VARIANT_2FC_FREECELL,
-        init_state, num_columns, num_freecells);
-}
+    static inline void fc_solve_delta_stater_init(
+        fc_solve_debondt_delta_stater_t *const delta,
+        fcs_state_t *const init_state, const size_t num_columns,
+        const int num_freecells)
+    {
+        fc_solve_debondt_delta_stater_init(delta, FCS_DBM_VARIANT_2FC_FREECELL,
+            init_state, num_columns, num_freecells);
+    }
 #else
-static inline void fc_solve_delta_stater_init(
-    fc_solve_debondt_delta_stater_t *const delta, fcs_state_t *const init_state,
-    const size_t num_columns, const int num_freecells,
-    const int sequences_are_built_by)
-{
-    fc_solve_debondt_delta_stater_init(delta, FCS_DBM_VARIANT_2FC_FREECELL,
-        init_state, num_columns, num_freecells, sequences_are_built_by);
-}
+    static inline void fc_solve_delta_stater_init(
+        fc_solve_debondt_delta_stater_t *const delta,
+        fcs_state_t *const init_state, const size_t num_columns,
+        const int num_freecells, const int sequences_are_built_by)
+    {
+        fc_solve_debondt_delta_stater_init(delta, FCS_DBM_VARIANT_2FC_FREECELL,
+            init_state, num_columns, num_freecells, sequences_are_built_by);
+    }
 #endif
 #define fc_solve_delta_stater_release(a)                                       \
     fc_solve_debondt_delta_stater_release(a)
@@ -56,11 +58,11 @@ static inline void fc_solve_delta_stater_init(
 
 #ifdef FCS_DEBONDT_DELTA_STATES
 
-static inline int compare_enc_states(
-    const fcs_encoded_state_buffer_t *a, const fcs_encoded_state_buffer_t *b)
-{
-    return memcmp(a, b, sizeof(*a));
-}
+    static inline int compare_enc_states(const fcs_encoded_state_buffer_t *a,
+        const fcs_encoded_state_buffer_t *b)
+    {
+        return memcmp(a, b, sizeof(*a));
+    }
 
 #else
 
diff --git a/fc-solve/source/delta_states_debondt.h b/fc-solve/source/delta_states_debondt.h
index d8614eca6..cc568c66d 100644
--- a/fc-solve/source/delta_states_debondt.h
+++ b/fc-solve/source/delta_states_debondt.h
@@ -14,7 +14,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "delta_states.h"
@@ -24,23 +25,23 @@ extern "C" {
 
 #define CARD_ARRAY_LEN ((RANK_KING + 1) * FCS_NUM_SUITS)
 
-typedef struct
-{
+    typedef struct
+    {
 #ifndef FCS_FREECELL_ONLY
-    int sequences_are_built_by;
+        int sequences_are_built_by;
 #endif
-    int num_freecells;
-    size_t num_columns;
-    fcs_state_t *init_state, *derived_state;
-    int bits_per_orig_cards_in_column;
-    int card_states[CARD_ARRAY_LEN];
-    int8_t bakers_dozen_topmost_cards_lookup[((1 << 6) / 8) + 1];
-    fcs_var_base_reader_t r;
-    fcs_var_base_writer_t w;
-} fc_solve_debondt_delta_stater_t;
+        int num_freecells;
+        size_t num_columns;
+        fcs_state_t *init_state, *derived_state;
+        int bits_per_orig_cards_in_column;
+        int card_states[CARD_ARRAY_LEN];
+        int8_t bakers_dozen_topmost_cards_lookup[((1 << 6) / 8) + 1];
+        fcs_var_base_reader_t r;
+        fcs_var_base_writer_t w;
+    } fc_solve_debondt_delta_stater_t;
 
-extern char *fc_solve_user_INTERNAL_debondt_delta_states_enc_and_dec(
-    fcs_dbm_variant_type_t, const char *, const char *);
+    extern char *fc_solve_user_INTERNAL_debondt_delta_states_enc_and_dec(
+        fcs_dbm_variant_type_t, const char *, const char *);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/delta_states_iface.h b/fc-solve/source/delta_states_iface.h
index 61bd9fae3..7321dc366 100644
--- a/fc-solve/source/delta_states_iface.h
+++ b/fc-solve/source/delta_states_iface.h
@@ -13,13 +13,14 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "dbm_common.h"
 
-extern char *fc_solve_user_INTERNAL_delta_states_enc_and_dec(
-    fcs_dbm_variant_type_t, const char *, const char *);
+    extern char *fc_solve_user_INTERNAL_delta_states_enc_and_dec(
+        fcs_dbm_variant_type_t, const char *, const char *);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/depth_multi_queue.h b/fc-solve/source/depth_multi_queue.h
index 5f4866263..a6d895683 100644
--- a/fc-solve/source/depth_multi_queue.h
+++ b/fc-solve/source/depth_multi_queue.h
@@ -15,128 +15,131 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "offloading_queue.h"
 
-typedef struct
-{
-    const char *offload_dir_path;
-    fcs_queue_stats_t stats;
-    long min_depth, max_depth, max_depth_margin;
-    /*
-     * page_to_write_to, page_for_backup and page_to_read_from always
-     * point to the two "pages" below, but they can be swapped and
-     * page_for_backup may be NULL.
-     */
-    fcs_offloading_queue_t *queues_by_depth;
-    long next_queue_id;
+    typedef struct
+    {
+        const char *offload_dir_path;
+        fcs_queue_stats_t stats;
+        long min_depth, max_depth, max_depth_margin;
+        /*
+         * page_to_write_to, page_for_backup and page_to_read_from always
+         * point to the two "pages" below, but they can be swapped and
+         * page_for_backup may be NULL.
+         */
+        fcs_offloading_queue_t *queues_by_depth;
+        long next_queue_id;
 #ifndef FCS_DBM_USE_OFFLOADING_QUEUE
-    fcs_meta_compact_allocator_t *meta_alloc;
+        fcs_meta_compact_allocator_t *meta_alloc;
 #endif
-} fcs_depth_multi_queue_t;
+    } fcs_depth_multi_queue_t;
 
 #define DEPTH_Q_GROW_BY 32
 
-static inline void fcs_depth_multi_queue__new_queue(
-    fcs_depth_multi_queue_t *const queue, fcs_offloading_queue_t *const q)
-{
-    fcs_offloading_queue__init(q
+    static inline void fcs_depth_multi_queue__new_queue(
+        fcs_depth_multi_queue_t *const queue, fcs_offloading_queue_t *const q)
+    {
+        fcs_offloading_queue__init(q
 #ifdef FCS_DBM_USE_OFFLOADING_QUEUE
-        ,
-        queue->offload_dir_path, (queue->next_queue_id++)
+            ,
+            queue->offload_dir_path, (queue->next_queue_id++)
 #else
         ,
         queue->meta_alloc
 #endif
-    );
-}
+        );
+    }
 
-static inline void fcs_depth_multi_queue__insert(
-    fcs_depth_multi_queue_t *const queue, const int depth,
-    const fcs_offloading_queue_item_t *const item)
-{
-    while (depth > queue->max_depth)
+    static inline void fcs_depth_multi_queue__insert(
+        fcs_depth_multi_queue_t *const queue, const int depth,
+        const fcs_offloading_queue_item_t *const item)
     {
-        queue->max_depth++;
-        if (queue->max_depth == queue->max_depth_margin)
+        while (depth > queue->max_depth)
         {
-            queue->max_depth_margin += DEPTH_Q_GROW_BY;
-            queue->queues_by_depth =
-                SREALLOC(queue->queues_by_depth, queue->max_depth_margin);
+            queue->max_depth++;
+            if (queue->max_depth == queue->max_depth_margin)
+            {
+                queue->max_depth_margin += DEPTH_Q_GROW_BY;
+                queue->queues_by_depth =
+                    SREALLOC(queue->queues_by_depth, queue->max_depth_margin);
+            }
+            fcs_depth_multi_queue__new_queue(queue,
+                &(queue->queues_by_depth[queue->max_depth - queue->min_depth]));
         }
-        fcs_depth_multi_queue__new_queue(queue,
-            &(queue->queues_by_depth[queue->max_depth - queue->min_depth]));
-    }
-
-    fcs_offloading_queue__insert(
-        &(queue->queues_by_depth[depth - queue->min_depth]), item);
-
-    q_stats_insert(&queue->stats);
-}
 
-static inline void fcs_depth_multi_queue__init(
-    fcs_depth_multi_queue_t *const queue, const char *offload_dir_path,
-    const int first_depth, const fcs_offloading_queue_item_t *const first_item)
-{
-    queue->offload_dir_path = offload_dir_path;
-    fcs_queue_stats_init(&queue->stats);
-    queue->next_queue_id = 0;
-    queue->min_depth = first_depth;
-    queue->max_depth_margin = first_depth + DEPTH_Q_GROW_BY;
-
-    queue->queues_by_depth = SMALLOC(
-        queue->queues_by_depth, queue->max_depth_margin - queue->min_depth + 1);
-    fcs_depth_multi_queue__new_queue(queue, &(queue->queues_by_depth[0]));
-    queue->max_depth = first_depth;
-
-    fcs_depth_multi_queue__insert(queue, first_depth, first_item);
-}
+        fcs_offloading_queue__insert(
+            &(queue->queues_by_depth[depth - queue->min_depth]), item);
 
-static inline void fcs_depth_multi_queue__destroy(
-    fcs_depth_multi_queue_t *const queue)
-{
-    const int limit = queue->max_depth - queue->min_depth;
-    if (queue->queues_by_depth == NULL)
-    {
-        return;
+        q_stats_insert(&queue->stats);
     }
-    for (int i = 0; i <= limit; i++)
+
+    static inline void fcs_depth_multi_queue__init(
+        fcs_depth_multi_queue_t *const queue, const char *offload_dir_path,
+        const int first_depth,
+        const fcs_offloading_queue_item_t *const first_item)
     {
-        fcs_offloading_queue__destroy(&(queue->queues_by_depth[i]));
+        queue->offload_dir_path = offload_dir_path;
+        fcs_queue_stats_init(&queue->stats);
+        queue->next_queue_id = 0;
+        queue->min_depth = first_depth;
+        queue->max_depth_margin = first_depth + DEPTH_Q_GROW_BY;
+
+        queue->queues_by_depth = SMALLOC(queue->queues_by_depth,
+            queue->max_depth_margin - queue->min_depth + 1);
+        fcs_depth_multi_queue__new_queue(queue, &(queue->queues_by_depth[0]));
+        queue->max_depth = first_depth;
+
+        fcs_depth_multi_queue__insert(queue, first_depth, first_item);
     }
-    free(queue->queues_by_depth);
-    queue->queues_by_depth = NULL;
-}
 
-static inline fcs_bool_t fcs_depth_multi_queue__extract(
-    fcs_depth_multi_queue_t *const queue, int *const return_depth,
-    fcs_offloading_queue_item_t *const return_item)
-{
-    if (q_stats_is_empty(&queue->stats))
+    static inline void fcs_depth_multi_queue__destroy(
+        fcs_depth_multi_queue_t *const queue)
     {
-        return FALSE;
+        const int limit = queue->max_depth - queue->min_depth;
+        if (queue->queues_by_depth == NULL)
+        {
+            return;
+        }
+        for (int i = 0; i <= limit; i++)
+        {
+            fcs_offloading_queue__destroy(&(queue->queues_by_depth[i]));
+        }
+        free(queue->queues_by_depth);
+        queue->queues_by_depth = NULL;
     }
 
-    while (q_stats_is_empty(&queue->queues_by_depth[0].stats))
+    static inline fcs_bool_t fcs_depth_multi_queue__extract(
+        fcs_depth_multi_queue_t *const queue, int *const return_depth,
+        fcs_offloading_queue_item_t *const return_item)
     {
-        var_AUTO(save_queue, queue->queues_by_depth[0]);
-        memmove(queue->queues_by_depth, queue->queues_by_depth + 1,
-            sizeof(queue->queues_by_depth[0]) *
-                (queue->max_depth - queue->min_depth));
-        queue->queues_by_depth[queue->max_depth - queue->min_depth] =
-            save_queue;
-        queue->max_depth++;
-        queue->min_depth++;
-        queue->max_depth_margin++;
-    }
+        if (q_stats_is_empty(&queue->stats))
+        {
+            return FALSE;
+        }
 
-    *return_depth = queue->min_depth;
-    fcs_offloading_queue__extract(&(queue->queues_by_depth[0]), return_item);
-    q_stats_extract(&queue->stats);
-    return TRUE;
-}
+        while (q_stats_is_empty(&queue->queues_by_depth[0].stats))
+        {
+            var_AUTO(save_queue, queue->queues_by_depth[0]);
+            memmove(queue->queues_by_depth, queue->queues_by_depth + 1,
+                sizeof(queue->queues_by_depth[0]) *
+                    (queue->max_depth - queue->min_depth));
+            queue->queues_by_depth[queue->max_depth - queue->min_depth] =
+                save_queue;
+            queue->max_depth++;
+            queue->min_depth++;
+            queue->max_depth_margin++;
+        }
+
+        *return_depth = queue->min_depth;
+        fcs_offloading_queue__extract(
+            &(queue->queues_by_depth[0]), return_item);
+        q_stats_extract(&queue->stats);
+        return TRUE;
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/fc_pro_iface_pos.h b/fc-solve/source/fc_pro_iface_pos.h
index bf724f3d6..d006f2656 100644
--- a/fc-solve/source/fc_pro_iface_pos.h
+++ b/fc-solve/source/fc_pro_iface_pos.h
@@ -14,52 +14,53 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "fcs_cl.h"
 #include "state.h"
 
-typedef struct
-{
-    fcs_move_t move;
-    fcs_bool_t to_empty_stack;
-} fcs_extended_move_t;
+    typedef struct
+    {
+        fcs_move_t move;
+        fcs_bool_t to_empty_stack;
+    } fcs_extended_move_t;
 
-typedef struct
-{
-    size_t next_move_idx;
-    size_t num_moves;
-    fcs_extended_move_t *moves;
-} fcs_moves_processed_t;
+    typedef struct
+    {
+        size_t next_move_idx;
+        size_t num_moves;
+        fcs_extended_move_t *moves;
+    } fcs_moves_processed_t;
 
-void fc_solve_moves_processed_gen(fcs_moves_processed_t *,
-    fcs_state_keyval_pair_t *, int, const fcs_moves_sequence_t *);
-void fc_solve_moves_processed_render_move(fcs_extended_move_t, char *);
+    void fc_solve_moves_processed_gen(fcs_moves_processed_t *,
+        fcs_state_keyval_pair_t *, int, const fcs_moves_sequence_t *);
+    void fc_solve_moves_processed_render_move(fcs_extended_move_t, char *);
 
-static inline int fc_solve_moves_processed_get_moves_left(
-    const fcs_moves_processed_t *const moves)
-{
-    return moves->num_moves - moves->next_move_idx;
-}
+    static inline int fc_solve_moves_processed_get_moves_left(
+        const fcs_moves_processed_t *const moves)
+    {
+        return moves->num_moves - moves->next_move_idx;
+    }
 
-static inline fcs_bool_t fc_solve_moves_processed_get_next_move(
-    fcs_moves_processed_t *const moves, fcs_extended_move_t *const move)
-{
-    if (moves->next_move_idx == moves->num_moves)
+    static inline fcs_bool_t fc_solve_moves_processed_get_next_move(
+        fcs_moves_processed_t *const moves, fcs_extended_move_t *const move)
     {
-        return TRUE;
+        if (moves->next_move_idx == moves->num_moves)
+        {
+            return TRUE;
+        }
+        *move = moves->moves[moves->next_move_idx++];
+        return FALSE;
     }
-    *move = moves->moves[moves->next_move_idx++];
-    return FALSE;
-}
 
-static inline void fc_solve_moves_processed_free(
-    fcs_moves_processed_t *const moves)
-{
-    free(moves->moves);
-    moves->moves = NULL;
-}
+    static inline void fc_solve_moves_processed_free(
+        fcs_moves_processed_t *const moves)
+    {
+        free(moves->moves);
+        moves->moves = NULL;
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/fcc_brfs.h b/fc-solve/source/fcc_brfs.h
index 41cbbd7c3..3fce17b9b 100644
--- a/fc-solve/source/fcc_brfs.h
+++ b/fc-solve/source/fcc_brfs.h
@@ -14,7 +14,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include <assert.h>
@@ -29,122 +30,124 @@ extern "C" {
 #include "dbm_solver.h"
 #include "dbm_calc_derived.h"
 
-typedef struct fcs_FCC_start_point_struct
-{
-    fcs_encoded_state_buffer_t enc_state;
-    fcs_fcc_moves_seq_t moves_seq;
-    struct fcs_FCC_start_point_struct *next;
-} fcs_FCC_start_point_t;
+    typedef struct fcs_FCC_start_point_struct
+    {
+        fcs_encoded_state_buffer_t enc_state;
+        fcs_fcc_moves_seq_t moves_seq;
+        struct fcs_FCC_start_point_struct *next;
+    } fcs_FCC_start_point_t;
 
-typedef struct
-{
-    fcs_FCC_start_point_t *list;
-    fcs_compact_allocator_t allocator;
-    fcs_FCC_start_point_t *recycle_bin;
-} fcs_FCC_start_points_list_t;
+    typedef struct
+    {
+        fcs_FCC_start_point_t *list;
+        fcs_compact_allocator_t allocator;
+        fcs_FCC_start_point_t *recycle_bin;
+    } fcs_FCC_start_points_list_t;
 
-static int fc_solve_compare_encoded_states(const void *const void_a,
-    const void *const void_b, void *const context GCC_UNUSED)
-{
+    static int fc_solve_compare_encoded_states(const void *const void_a,
+        const void *const void_b, void *const context GCC_UNUSED)
+    {
 #define GET_PARAM(p) ((const fcs_encoded_state_buffer_t *)p)
-    return memcmp(
-        GET_PARAM(void_a), GET_PARAM(void_b), sizeof(*(GET_PARAM(void_a))));
+        return memcmp(
+            GET_PARAM(void_a), GET_PARAM(void_b), sizeof(*(GET_PARAM(void_a))));
 #undef GET_PARAM
-}
-
-static inline void fc_solve_fcc_release_moves_seq(
-    fcs_fcc_moves_seq_t *const moves_seq,
-    fcs_fcc_moves_seq_allocator_t *const moves_list_allocator)
-{
-    fcs_fcc_moves_list_item_t *iter = moves_seq->moves_list;
-    fcs_fcc_moves_list_item_t *iter_next;
+    }
 
-    if (iter)
+    static inline void fc_solve_fcc_release_moves_seq(
+        fcs_fcc_moves_seq_t *const moves_seq,
+        fcs_fcc_moves_seq_allocator_t *const moves_list_allocator)
     {
-        for (iter_next = iter->next; iter_next;
-             iter = iter_next, iter_next = iter_next->next)
+        fcs_fcc_moves_list_item_t *iter = moves_seq->moves_list;
+        fcs_fcc_moves_list_item_t *iter_next;
+
+        if (iter)
         {
+            for (iter_next = iter->next; iter_next;
+                 iter = iter_next, iter_next = iter_next->next)
+            {
+                iter->next = moves_list_allocator->recycle_bin;
+                moves_list_allocator->recycle_bin = iter;
+            }
+            /* Fix for a leak - iter is still defined, and needs
+             * to be recycled.
+             * */
             iter->next = moves_list_allocator->recycle_bin;
             moves_list_allocator->recycle_bin = iter;
         }
-        /* Fix for a leak - iter is still defined, and needs
-         * to be recycled.
-         * */
-        iter->next = moves_list_allocator->recycle_bin;
-        moves_list_allocator->recycle_bin = iter;
+        moves_seq->moves_list = NULL;
+        moves_seq->count = -1;
     }
-    moves_seq->moves_list = NULL;
-    moves_seq->count = -1;
-}
-
-static inline void fc_solve__internal__copy_moves(
-    fcs_fcc_moves_seq_t *const moves_seq, int *const ptr_to_pos_in_moves,
-    fcs_fcc_moves_list_item_t ***const ptr_to_end_moves_iter,
-    const unsigned char extra_move,
-    fcs_fcc_moves_seq_allocator_t *const moves_list_allocator)
-{
-    int pos_in_moves = *ptr_to_pos_in_moves;
-    var_AUTO(end_moves_iter, *ptr_to_end_moves_iter);
-    const fcs_fcc_moves_list_item_t *copy_from_iter = moves_seq->moves_list;
-    const_SLOT(count, moves_seq);
 
-    for (int copy_from_idx = 0; copy_from_idx < count;)
+    static inline void fc_solve__internal__copy_moves(
+        fcs_fcc_moves_seq_t *const moves_seq, int *const ptr_to_pos_in_moves,
+        fcs_fcc_moves_list_item_t ***const ptr_to_end_moves_iter,
+        const unsigned char extra_move,
+        fcs_fcc_moves_seq_allocator_t *const moves_list_allocator)
     {
+        int pos_in_moves = *ptr_to_pos_in_moves;
+        var_AUTO(end_moves_iter, *ptr_to_end_moves_iter);
+        const fcs_fcc_moves_list_item_t *copy_from_iter = moves_seq->moves_list;
+        const_SLOT(count, moves_seq);
+
+        for (int copy_from_idx = 0; copy_from_idx < count;)
+        {
+            if (pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+            {
+                (*end_moves_iter) =
+                    fc_solve_fcc_alloc_moves_list_item(moves_list_allocator);
+            }
+            (*end_moves_iter)
+                ->data.s[pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM] =
+                copy_from_iter->data
+                    .s[copy_from_idx % FCS_FCC_NUM_MOVES_IN_ITEM];
+            if ((++pos_in_moves) % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+            {
+                end_moves_iter = &((*end_moves_iter)->next);
+            }
+            if ((++copy_from_idx) % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+            {
+                copy_from_iter = copy_from_iter->next;
+            }
+        }
+
+        /* Append the remaining moves. */
         if (pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
         {
             (*end_moves_iter) =
                 fc_solve_fcc_alloc_moves_list_item(moves_list_allocator);
         }
-        (*end_moves_iter)->data.s[pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM] =
-            copy_from_iter->data.s[copy_from_idx % FCS_FCC_NUM_MOVES_IN_ITEM];
-        if ((++pos_in_moves) % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
-        {
-            end_moves_iter = &((*end_moves_iter)->next);
-        }
-        if ((++copy_from_idx) % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
-        {
-            copy_from_iter = copy_from_iter->next;
-        }
+        (*end_moves_iter)
+            ->data.s[(pos_in_moves++) % FCS_FCC_NUM_MOVES_IN_ITEM] = extra_move;
+
+        *ptr_to_pos_in_moves = pos_in_moves;
+        *ptr_to_end_moves_iter = end_moves_iter;
     }
 
-    /* Append the remaining moves. */
-    if (pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+    static inline dict_t *fcc_brfs_kaz_tree_create(
+        fcs_meta_compact_allocator_t *const meta_alloc,
+        void **const tree_recycle_bin)
     {
-        (*end_moves_iter) =
-            fc_solve_fcc_alloc_moves_list_item(moves_list_allocator);
+        return fc_solve_kaz_tree_create(fc_solve_compare_encoded_states, NULL,
+            meta_alloc, tree_recycle_bin);
     }
-    (*end_moves_iter)->data.s[(pos_in_moves++) % FCS_FCC_NUM_MOVES_IN_ITEM] =
-        extra_move;
-
-    *ptr_to_pos_in_moves = pos_in_moves;
-    *ptr_to_end_moves_iter = end_moves_iter;
-}
 
-static inline dict_t *fcc_brfs_kaz_tree_create(
-    fcs_meta_compact_allocator_t *const meta_alloc,
-    void **const tree_recycle_bin)
-{
-    return fc_solve_kaz_tree_create(
-        fc_solve_compare_encoded_states, NULL, meta_alloc, tree_recycle_bin);
-}
-
-static inline void fcc_brfs_add_key_to_tree(
-    dict_t *const tree, const fcs_encoded_state_buffer_t *const val)
-{
-    fcs_encoded_state_buffer_t *key_to_add =
-        fcs_compact_alloc_ptr(&(tree->dict_allocator), sizeof(*key_to_add));
-    *key_to_add = *val;
-    fc_solve_kaz_tree_alloc_insert(tree, key_to_add);
-}
+    static inline void fcc_brfs_add_key_to_tree(
+        dict_t *const tree, const fcs_encoded_state_buffer_t *const val)
+    {
+        fcs_encoded_state_buffer_t *key_to_add =
+            fcs_compact_alloc_ptr(&(tree->dict_allocator), sizeof(*key_to_add));
+        *key_to_add = *val;
+        fc_solve_kaz_tree_alloc_insert(tree, key_to_add);
+    }
 
-static void perform_FCC_brfs(const fcs_dbm_variant_type_t local_variant,
-    /* The first state in the game, from which all states are encoded. */
-    fcs_state_keyval_pair_t *init_state,
-    /* The start state. */
-    fcs_encoded_state_buffer_t start_state,
-    /* The moves leading up to the state.
-     * */
-    const fcs_fcc_moves_seq_t *const start_state_moves_seq,
+    static void perform_FCC_brfs(const fcs_dbm_variant_type_t local_variant,
+        /* The first state in the game, from which all states are encoded. */
+        fcs_state_keyval_pair_t *init_state,
+        /* The start state. */
+        fcs_encoded_state_buffer_t start_state,
+        /* The moves leading up to the state.
+         * */
+        const fcs_fcc_moves_seq_t *const start_state_moves_seq,
 #if 0
     /* [Output]: FCC start points.
      * */
@@ -165,312 +168,317 @@ static void perform_FCC_brfs(const fcs_dbm_variant_type_t local_variant,
         const unsigned char extra_move, void *const context),
     void *add_start_point_context,
 #endif
-    /* [Output]: Is the min_by_sorting new.
-     * */
-    fcs_bool_t *is_min_by_sorting_new,
-    /* [Output]: The min_by_sorting.
-     * */
-    fcs_encoded_state_buffer_t *const min_by_sorting,
-    /* [Input/Output]: The ${next}_depth_FCCs.DoesExist
-     * (for the right depth based on the current depth and pruning.)
-     * Of type Map{min_by_sorting => Bool Exists} DoesExist.
-     */
-    dict_t *does_min_by_sorting_exist,
-    /* [Input/Output]: The LRU cache.
-     * Of type <<LRU_Map{any_state_in_the_FCCs => Bool Exists} Cache>>
-     * */
-    fcs_lru_cache_t *does_state_exist_in_any_FCC_cache,
-    /* [Output]: the number of new positions/states scanned in the FCC. If
-     * it's not new, this will be set to zero (0). It includes the initial
-     * position, but does not include the start points of the new FCC.
-     * */
-    long *const out_num_new_positions,
-    /* [Input/Output]: the list allocator. */
-    fcs_fcc_moves_seq_allocator_t *const moves_list_allocator,
-    /* [Input/Output]: The meta allocator - needed to allocate and free
-     * the compact allocators. */
-    fcs_meta_compact_allocator_t *const meta_alloc)
-{
-    void *tree_recycle_bin = NULL;
-    fcs_dbm_queue_item_t *queue_head, *queue_tail, *queue_recycle_bin = NULL,
-                                                   *extracted_item;
-    fcs_derived_state_t *derived_list_recycle_bin = NULL, *next_derived_iter;
-    fcs_state_keyval_pair_t state;
-    fcs_bool_t running_min_was_assigned = FALSE;
-    fcs_encoded_state_buffer_t running_min = {{0}};
-    long num_new_positions = 0;
-    DECLARE_IND_BUF_T(indirect_stacks_buffer)
+        /* [Output]: Is the min_by_sorting new.
+         * */
+        fcs_bool_t *is_min_by_sorting_new,
+        /* [Output]: The min_by_sorting.
+         * */
+        fcs_encoded_state_buffer_t *const min_by_sorting,
+        /* [Input/Output]: The ${next}_depth_FCCs.DoesExist
+         * (for the right depth based on the current depth and pruning.)
+         * Of type Map{min_by_sorting => Bool Exists} DoesExist.
+         */
+        dict_t *does_min_by_sorting_exist,
+        /* [Input/Output]: The LRU cache.
+         * Of type <<LRU_Map{any_state_in_the_FCCs => Bool Exists} Cache>>
+         * */
+        fcs_lru_cache_t *does_state_exist_in_any_FCC_cache,
+        /* [Output]: the number of new positions/states scanned in the FCC. If
+         * it's not new, this will be set to zero (0). It includes the initial
+         * position, but does not include the start points of the new FCC.
+         * */
+        long *const out_num_new_positions,
+        /* [Input/Output]: the list allocator. */
+        fcs_fcc_moves_seq_allocator_t *const moves_list_allocator,
+        /* [Input/Output]: The meta allocator - needed to allocate and free
+         * the compact allocators. */
+        fcs_meta_compact_allocator_t *const meta_alloc)
+    {
+        void *tree_recycle_bin = NULL;
+        fcs_dbm_queue_item_t *queue_head, *queue_tail,
+            *queue_recycle_bin = NULL, *extracted_item;
+        fcs_derived_state_t *derived_list_recycle_bin = NULL,
+                            *next_derived_iter;
+        fcs_state_keyval_pair_t state;
+        fcs_bool_t running_min_was_assigned = FALSE;
+        fcs_encoded_state_buffer_t running_min = {{0}};
+        long num_new_positions = 0;
+        DECLARE_IND_BUF_T(indirect_stacks_buffer)
 
 /* Some sanity checks. */
 #ifndef NDEBUG
-    assert(add_start_point);
-    assert(add_start_point_context);
-    assert(is_min_by_sorting_new);
-    assert(min_by_sorting);
-    assert(does_min_by_sorting_exist);
-    assert(does_state_exist_in_any_FCC_cache);
+        assert(add_start_point);
+        assert(add_start_point_context);
+        assert(is_min_by_sorting_new);
+        assert(min_by_sorting);
+        assert(does_min_by_sorting_exist);
+        assert(does_state_exist_in_any_FCC_cache);
 #endif
 
-    /* Initialize the allocators. */
-    fcs_compact_allocator_t queue_allocator, derived_list_allocator;
-    fc_solve_compact_allocator_init(&(queue_allocator), meta_alloc);
-    fc_solve_compact_allocator_init(&(derived_list_allocator), meta_alloc);
+        /* Initialize the allocators. */
+        fcs_compact_allocator_t queue_allocator, derived_list_allocator;
+        fc_solve_compact_allocator_init(&(queue_allocator), meta_alloc);
+        fc_solve_compact_allocator_init(&(derived_list_allocator), meta_alloc);
 
-    /* TODO : maybe pass delta_stater as an argument  */
-    fc_solve_delta_stater_t delta_stater;
-    fc_solve_delta_stater_init(
-        &delta_stater, &(init_state->s), STACKS_NUM, FREECELLS_NUM
+        /* TODO : maybe pass delta_stater as an argument  */
+        fc_solve_delta_stater_t delta_stater;
+        fc_solve_delta_stater_init(
+            &delta_stater, &(init_state->s), STACKS_NUM, FREECELLS_NUM
 #ifndef FCS_FREECELL_ONLY
-        ,
-        FCS_SEQ_BUILT_BY_ALTERNATE_COLOR
+            ,
+            FCS_SEQ_BUILT_BY_ALTERNATE_COLOR
 #endif
-    );
-    dict_t *traversed_states =
-        fcc_brfs_kaz_tree_create(meta_alloc, &tree_recycle_bin);
+        );
+        dict_t *traversed_states =
+            fcc_brfs_kaz_tree_create(meta_alloc, &tree_recycle_bin);
 
-    fcs_dbm_queue_item_t *new_item =
-        (fcs_dbm_queue_item_t *)fcs_compact_alloc_ptr(
-            &(queue_allocator), sizeof(*new_item));
-    *new_item = (typeof(*new_item)){.key = start_state,
-        .next = NULL,
-        .moves_seq = {.count = 0, .moves_list = NULL}};
-    queue_head = queue_tail = new_item;
+        fcs_dbm_queue_item_t *new_item =
+            (fcs_dbm_queue_item_t *)fcs_compact_alloc_ptr(
+                &(queue_allocator), sizeof(*new_item));
+        *new_item = (typeof(*new_item)){.key = start_state,
+            .next = NULL,
+            .moves_seq = {.count = 0, .moves_list = NULL}};
+        queue_head = queue_tail = new_item;
 
-    *out_num_new_positions = num_new_positions;
+        *out_num_new_positions = num_new_positions;
 
-    fc_solve_kaz_tree_alloc_insert(traversed_states, &(new_item->key));
+        fc_solve_kaz_tree_alloc_insert(traversed_states, &(new_item->key));
 
-    /* Extract an item from the queue. */
-    while ((extracted_item = queue_head))
-    {
-        num_new_positions++;
-        if (!(queue_head = extracted_item->next))
+        /* Extract an item from the queue. */
+        while ((extracted_item = queue_head))
         {
-            queue_tail = NULL;
-        }
-
-        /* Handle the min_by_sorting scan. */
-        if ((!running_min_was_assigned) ||
-            (memcmp(&(extracted_item->key), &running_min, sizeof(running_min)) <
-                0))
-        {
-            running_min_was_assigned = TRUE;
-            running_min = extracted_item->key;
-            if (cache_does_key_exist(
-                    does_state_exist_in_any_FCC_cache, &(running_min)))
+            num_new_positions++;
+            if (!(queue_head = extracted_item->next))
             {
-                *is_min_by_sorting_new = FALSE;
-                goto free_resources;
+                queue_tail = NULL;
             }
-            else
+
+            /* Handle the min_by_sorting scan. */
+            if ((!running_min_was_assigned) ||
+                (memcmp(&(extracted_item->key), &running_min,
+                     sizeof(running_min)) < 0))
             {
-                cache_insert(does_state_exist_in_any_FCC_cache, &(running_min),
-                    NULL, '\0');
+                running_min_was_assigned = TRUE;
+                running_min = extracted_item->key;
+                if (cache_does_key_exist(
+                        does_state_exist_in_any_FCC_cache, &(running_min)))
+                {
+                    *is_min_by_sorting_new = FALSE;
+                    goto free_resources;
+                }
+                else
+                {
+                    cache_insert(does_state_exist_in_any_FCC_cache,
+                        &(running_min), NULL, '\0');
+                }
             }
-        }
 
-        /* Calculate the derived list. */
-        fcs_derived_state_t *derived_list = NULL;
+            /* Calculate the derived list. */
+            fcs_derived_state_t *derived_list = NULL;
 
-        /* Handle item. */
-        fc_solve_delta_stater_decode_into_state(&delta_stater,
-            extracted_item->key.s, &(state), indirect_stacks_buffer);
+            /* Handle item. */
+            fc_solve_delta_stater_decode_into_state(&delta_stater,
+                extracted_item->key.s, &(state), indirect_stacks_buffer);
 
-        instance_solver_thread_calc_derived_states(local_variant, &state, NULL,
-            &derived_list, &derived_list_recycle_bin, &derived_list_allocator,
-            /* Horne's Prune should be disabled because that interferes
-             * with the FCC-depth. */
-            FALSE);
+            instance_solver_thread_calc_derived_states(local_variant, &state,
+                NULL, &derived_list, &derived_list_recycle_bin,
+                &derived_list_allocator,
+                /* Horne's Prune should be disabled because that interferes
+                 * with the FCC-depth. */
+                FALSE);
 
-        /* Allocate a spare 'new_item'. */
-        if (queue_recycle_bin)
-        {
-            new_item = queue_recycle_bin;
-            queue_recycle_bin = queue_recycle_bin->next;
-        }
-        else
-        {
-            new_item = (fcs_dbm_queue_item_t *)fcs_compact_alloc_ptr(
-                &(queue_allocator), sizeof(*new_item));
-        }
+            /* Allocate a spare 'new_item'. */
+            if (queue_recycle_bin)
+            {
+                new_item = queue_recycle_bin;
+                queue_recycle_bin = queue_recycle_bin->next;
+            }
+            else
+            {
+                new_item = (fcs_dbm_queue_item_t *)fcs_compact_alloc_ptr(
+                    &(queue_allocator), sizeof(*new_item));
+            }
 
-        /* Enqueue the new elements to the queue. */
-        for (var_AUTO(derived_iter, derived_list); derived_iter;
-             derived_iter = next_derived_iter)
-        {
-            const fcs_bool_t is_reversible =
-                (derived_iter->core_irreversible_moves_count == 0);
-            fcs_init_and_encode_state(&delta_stater, local_variant,
-                &(derived_iter->state), &(new_item->key));
-            const_AUTO(extra_move, derived_iter->move);
-
-            if (!(is_reversible
-                        ? (fc_solve_kaz_tree_lookup_value(
-                               traversed_states, &(new_item->key)) != NULL)
-                        : add_start_point(&(new_item->key),
-                              start_state_moves_seq,
-                              &(extracted_item->moves_seq), extra_move,
-                              add_start_point_context)))
+            /* Enqueue the new elements to the queue. */
+            for (var_AUTO(derived_iter, derived_list); derived_iter;
+                 derived_iter = next_derived_iter)
             {
-                if (is_reversible)
+                const fcs_bool_t is_reversible =
+                    (derived_iter->core_irreversible_moves_count == 0);
+                fcs_init_and_encode_state(&delta_stater, local_variant,
+                    &(derived_iter->state), &(new_item->key));
+                const_AUTO(extra_move, derived_iter->move);
+
+                if (!(is_reversible
+                            ? (fc_solve_kaz_tree_lookup_value(
+                                   traversed_states, &(new_item->key)) != NULL)
+                            : add_start_point(&(new_item->key),
+                                  start_state_moves_seq,
+                                  &(extracted_item->moves_seq), extra_move,
+                                  add_start_point_context)))
                 {
-                    fcc_brfs_add_key_to_tree(traversed_states, &new_item->key);
-                    fcs_fcc_moves_list_item_t *moves_list,
-                        **end_moves_iter = &moves_list;
-                    /* Fill in the moves. */
-                    int pos_in_moves = 0;
-                    fc_solve__internal__copy_moves(&(extracted_item->moves_seq),
-                        &pos_in_moves, &end_moves_iter, extra_move,
-                        moves_list_allocator);
-
-                    new_item->moves_seq.count = pos_in_moves;
-                    new_item->moves_seq.moves_list = moves_list;
-
-                    /* Enqueue the item in the queue. */
-                    new_item->next = NULL;
-                    if (queue_tail)
+                    if (is_reversible)
+                    {
+                        fcc_brfs_add_key_to_tree(
+                            traversed_states, &new_item->key);
+                        fcs_fcc_moves_list_item_t *moves_list,
+                            **end_moves_iter = &moves_list;
+                        /* Fill in the moves. */
+                        int pos_in_moves = 0;
+                        fc_solve__internal__copy_moves(
+                            &(extracted_item->moves_seq), &pos_in_moves,
+                            &end_moves_iter, extra_move, moves_list_allocator);
+
+                        new_item->moves_seq.count = pos_in_moves;
+                        new_item->moves_seq.moves_list = moves_list;
+
+                        /* Enqueue the item in the queue. */
+                        new_item->next = NULL;
+                        if (queue_tail)
+                        {
+                            queue_tail = queue_tail->next = new_item;
+                        }
+                        else
+                        {
+                            queue_head = queue_tail = new_item;
+                        }
+                    }
+
+                    /*
+                     * Allocate a new new_item.
+                     *
+                     * Note: we need to allocate it for both reversibles
+                     * and non-reversible moves because pointers to their keys
+                     * are kept inside the dict_t-s.
+                     * */
+                    if (queue_recycle_bin)
                     {
-                        queue_tail = queue_tail->next = new_item;
+                        new_item = queue_recycle_bin;
+                        queue_recycle_bin = queue_recycle_bin->next;
                     }
                     else
                     {
-                        queue_head = queue_tail = new_item;
+                        new_item =
+                            (fcs_dbm_queue_item_t *)fcs_compact_alloc_ptr(
+                                &(queue_allocator), sizeof(*new_item));
                     }
                 }
 
-                /*
-                 * Allocate a new new_item.
-                 *
-                 * Note: we need to allocate it for both reversibles
-                 * and non-reversible moves because pointers to their keys
-                 * are kept inside the dict_t-s.
-                 * */
-                if (queue_recycle_bin)
-                {
-                    new_item = queue_recycle_bin;
-                    queue_recycle_bin = queue_recycle_bin->next;
-                }
-                else
-                {
-                    new_item = (fcs_dbm_queue_item_t *)fcs_compact_alloc_ptr(
-                        &(queue_allocator), sizeof(*new_item));
-                }
+                /* Recycle derived_iter.  */
+                next_derived_iter = derived_iter->next;
+                derived_iter->next = derived_list_recycle_bin;
+                derived_list_recycle_bin = derived_iter;
             }
 
-            /* Recycle derived_iter.  */
-            next_derived_iter = derived_iter->next;
-            derived_iter->next = derived_list_recycle_bin;
-            derived_list_recycle_bin = derived_iter;
+            /* We always hold one new_item spare, so let's recycle it now. */
+            new_item->next = queue_recycle_bin;
+            queue_recycle_bin = new_item;
+
+            /* Clean up the extracted_item's resources. We no longer need them
+             * because we are interested only in those of the derived items.
+             * */
+            fc_solve_fcc_release_moves_seq(
+                &(extracted_item->moves_seq), moves_list_allocator);
         }
 
-        /* We always hold one new_item spare, so let's recycle it now. */
-        new_item->next = queue_recycle_bin;
-        queue_recycle_bin = new_item;
+        if ((*is_min_by_sorting_new = (!fc_solve_kaz_tree_lookup_value(
+                 does_min_by_sorting_exist, &(running_min)))))
+        {
+            *min_by_sorting = running_min;
+            *out_num_new_positions = num_new_positions;
+        }
 
-        /* Clean up the extracted_item's resources. We no longer need them
-         * because we are interested only in those of the derived items.
-         * */
-        fc_solve_fcc_release_moves_seq(
-            &(extracted_item->moves_seq), moves_list_allocator);
+    /* Free the allocated resources. */
+    free_resources:
+        fc_solve_compact_allocator_finish(&(queue_allocator));
+        fc_solve_compact_allocator_finish(&(derived_list_allocator));
+        fc_solve_delta_stater_release(&delta_stater);
+        fc_solve_kaz_tree_destroy(traversed_states);
     }
 
-    if ((*is_min_by_sorting_new = (!fc_solve_kaz_tree_lookup_value(
-             does_min_by_sorting_exist, &(running_min)))))
+    typedef struct
     {
-        *min_by_sorting = running_min;
-        *out_num_new_positions = num_new_positions;
-    }
-
-/* Free the allocated resources. */
-free_resources:
-    fc_solve_compact_allocator_finish(&(queue_allocator));
-    fc_solve_compact_allocator_finish(&(derived_list_allocator));
-    fc_solve_delta_stater_release(&delta_stater);
-    fc_solve_kaz_tree_destroy(traversed_states);
-}
+        fcs_FCC_start_points_list_t *next_start_points_list;
+        dict_t *do_next_fcc_start_points_exist;
+        fcs_fcc_moves_seq_allocator_t *moves_list_allocator;
+    } add_start_point_context_t;
 
-typedef struct
-{
-    fcs_FCC_start_points_list_t *next_start_points_list;
-    dict_t *do_next_fcc_start_points_exist;
-    fcs_fcc_moves_seq_allocator_t *moves_list_allocator;
-} add_start_point_context_t;
-
-/*
- * Returns if already exist (the NOT of if the state is new).
- */
-static fcs_bool_t fc_solve_add_start_point_in_mem(
-    const fcs_encoded_state_buffer_t *const enc_state,
-    const fcs_fcc_moves_seq_t *const start_state_moves_seq,
-    fcs_fcc_moves_seq_t *const after_start_moves_seq,
-    const unsigned char extra_move, void *const void_context)
-{
-    add_start_point_context_t *const context =
-        (add_start_point_context_t *)void_context;
-    dict_t *const tree = context->do_next_fcc_start_points_exist;
-
-    if (fc_solve_kaz_tree_lookup_value(tree, enc_state))
-    {
-        return TRUE;
-    }
-
-    fcc_brfs_add_key_to_tree(tree, enc_state);
-    /* Fill in the moves. */
-    fcs_fcc_moves_list_item_t *moves_list;
-    fcs_fcc_moves_list_item_t **end_moves_iter = &moves_list;
-    int pos_in_moves = 0;
     /*
-     * TODO : optimise the loop so the data will be copied
-     * in one go by jumps of FCS_FCC_NUM_MOVES_IN_ITEM
-     * */
-    const fcs_fcc_moves_list_item_t *start_iter =
-        start_state_moves_seq->moves_list;
-    const int count_start_state_moves = start_state_moves_seq->count;
-    fcs_fcc_moves_seq_allocator_t *const moves_list_allocator =
-        context->moves_list_allocator;
-    for (; pos_in_moves < count_start_state_moves;)
+     * Returns if already exist (the NOT of if the state is new).
+     */
+    static fcs_bool_t fc_solve_add_start_point_in_mem(
+        const fcs_encoded_state_buffer_t *const enc_state,
+        const fcs_fcc_moves_seq_t *const start_state_moves_seq,
+        fcs_fcc_moves_seq_t *const after_start_moves_seq,
+        const unsigned char extra_move, void *const void_context)
     {
-        if (pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+        add_start_point_context_t *const context =
+            (add_start_point_context_t *)void_context;
+        dict_t *const tree = context->do_next_fcc_start_points_exist;
+
+        if (fc_solve_kaz_tree_lookup_value(tree, enc_state))
         {
-            (*end_moves_iter) =
-                fc_solve_fcc_alloc_moves_list_item(moves_list_allocator);
+            return TRUE;
         }
-        (*end_moves_iter)->data.s[pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM] =
-            start_iter->data.s[pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM];
-        if ((++pos_in_moves) % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+
+        fcc_brfs_add_key_to_tree(tree, enc_state);
+        /* Fill in the moves. */
+        fcs_fcc_moves_list_item_t *moves_list;
+        fcs_fcc_moves_list_item_t **end_moves_iter = &moves_list;
+        int pos_in_moves = 0;
+        /*
+         * TODO : optimise the loop so the data will be copied
+         * in one go by jumps of FCS_FCC_NUM_MOVES_IN_ITEM
+         * */
+        const fcs_fcc_moves_list_item_t *start_iter =
+            start_state_moves_seq->moves_list;
+        const int count_start_state_moves = start_state_moves_seq->count;
+        fcs_fcc_moves_seq_allocator_t *const moves_list_allocator =
+            context->moves_list_allocator;
+        for (; pos_in_moves < count_start_state_moves;)
         {
-            end_moves_iter = &((*end_moves_iter)->next);
-            start_iter = start_iter->next;
+            if (pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+            {
+                (*end_moves_iter) =
+                    fc_solve_fcc_alloc_moves_list_item(moves_list_allocator);
+            }
+            (*end_moves_iter)
+                ->data.s[pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM] =
+                start_iter->data.s[pos_in_moves % FCS_FCC_NUM_MOVES_IN_ITEM];
+            if ((++pos_in_moves) % FCS_FCC_NUM_MOVES_IN_ITEM == 0)
+            {
+                end_moves_iter = &((*end_moves_iter)->next);
+                start_iter = start_iter->next;
+            }
         }
-    }
-    fc_solve__internal__copy_moves(after_start_moves_seq, &pos_in_moves,
-        &end_moves_iter, extra_move, moves_list_allocator);
-
-    /* Enqueue the new FCC start point. */
-    fcs_FCC_start_points_list_t *const fcc_start_points =
-        context->next_start_points_list;
-    fcs_FCC_start_point_t *new_start_point;
-    if (fcc_start_points->recycle_bin)
-    {
-        new_start_point = fcc_start_points->recycle_bin;
-        fcc_start_points->recycle_bin = fcc_start_points->recycle_bin->next;
-    }
-    else
-    {
-        new_start_point = (fcs_FCC_start_point_t *)fcs_compact_alloc_ptr(
-            &(fcc_start_points->allocator), sizeof(*new_start_point));
-    }
-    *new_start_point = (typeof(*new_start_point)){.enc_state = *enc_state,
-        .moves_seq = {.count = pos_in_moves, .moves_list = moves_list},
-        .next = fcc_start_points->list};
+        fc_solve__internal__copy_moves(after_start_moves_seq, &pos_in_moves,
+            &end_moves_iter, extra_move, moves_list_allocator);
+
+        /* Enqueue the new FCC start point. */
+        fcs_FCC_start_points_list_t *const fcc_start_points =
+            context->next_start_points_list;
+        fcs_FCC_start_point_t *new_start_point;
+        if (fcc_start_points->recycle_bin)
+        {
+            new_start_point = fcc_start_points->recycle_bin;
+            fcc_start_points->recycle_bin = fcc_start_points->recycle_bin->next;
+        }
+        else
+        {
+            new_start_point = (fcs_FCC_start_point_t *)fcs_compact_alloc_ptr(
+                &(fcc_start_points->allocator), sizeof(*new_start_point));
+        }
+        *new_start_point = (typeof(*new_start_point)){.enc_state = *enc_state,
+            .moves_seq = {.count = pos_in_moves, .moves_list = moves_list},
+            .next = fcc_start_points->list};
 
-    /*
-     * Enqueue the new start point - it won't work without it,
-     * retardo! */
-    fcc_start_points->list = new_start_point;
+        /*
+         * Enqueue the new start point - it won't work without it,
+         * retardo! */
+        fcc_start_points->list = new_start_point;
 
-    return FALSE;
-}
+        return FALSE;
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/fcc_brfs_test.h b/fc-solve/source/fcc_brfs_test.h
index f06137c4b..796d079ea 100644
--- a/fc-solve/source/fcc_brfs_test.h
+++ b/fc-solve/source/fcc_brfs_test.h
@@ -16,50 +16,52 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "dbm_common.h"
 
-typedef unsigned char fcs_fcc_move_t;
+    typedef unsigned char fcs_fcc_move_t;
 
 #define FCS_FCC_NUM_MOVES_IN_ITEM 8
 
-typedef struct fcs_fcc_moves_list_item_struct
-{
-    struct fcs_fcc_moves_list_item_struct *next;
-    struct
+    typedef struct fcs_fcc_moves_list_item_struct
     {
-        fcs_fcc_move_t s[FCS_FCC_NUM_MOVES_IN_ITEM];
-    } data;
-} fcs_fcc_moves_list_item_t;
+        struct fcs_fcc_moves_list_item_struct *next;
+        struct
+        {
+            fcs_fcc_move_t s[FCS_FCC_NUM_MOVES_IN_ITEM];
+        } data;
+    } fcs_fcc_moves_list_item_t;
 
-typedef struct
-{
-    int count;
-    fcs_fcc_moves_list_item_t *moves_list;
-} fcs_fcc_moves_seq_t;
+    typedef struct
+    {
+        int count;
+        fcs_fcc_moves_list_item_t *moves_list;
+    } fcs_fcc_moves_seq_t;
 
-typedef struct
-{
-    int count;
-    fcs_fcc_move_t *moves;
-    char *state_as_string;
-} fcs_FCC_start_point_result_t;
+    typedef struct
+    {
+        int count;
+        fcs_fcc_move_t *moves;
+        char *state_as_string;
+    } fcs_FCC_start_point_result_t;
 
-DLLEXPORT int fc_solve_user_INTERNAL_find_fcc_start_points(
-    fcs_dbm_variant_type_t, const char *, const int,
-    const fcs_fcc_move_t *const, fcs_FCC_start_point_result_t **, long *const);
+    DLLEXPORT int fc_solve_user_INTERNAL_find_fcc_start_points(
+        fcs_dbm_variant_type_t, const char *, const int,
+        const fcs_fcc_move_t *const, fcs_FCC_start_point_result_t **,
+        long *const);
 
-DLLEXPORT void fc_solve_user_INTERNAL_free_fcc_start_points(
-    fcs_FCC_start_point_result_t *const);
+    DLLEXPORT void fc_solve_user_INTERNAL_free_fcc_start_points(
+        fcs_FCC_start_point_result_t *const);
 
-DLLEXPORT int fc_solve_user_INTERNAL_is_fcc_new(fcs_dbm_variant_type_t,
-    const char *, const char *,
-    /* NULL-terminated */
-    const char **,
-    /* NULL-terminated */
-    const char **, fcs_bool_t *const);
+    DLLEXPORT int fc_solve_user_INTERNAL_is_fcc_new(fcs_dbm_variant_type_t,
+        const char *, const char *,
+        /* NULL-terminated */
+        const char **,
+        /* NULL-terminated */
+        const char **, fcs_bool_t *const);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/fcs_cl.h b/fc-solve/source/fcs_cl.h
index 8ae61bc28..923b6f809 100644
--- a/fc-solve/source/fcs_cl.h
+++ b/fc-solve/source/fcs_cl.h
@@ -18,52 +18,53 @@
 #include "fcs_back_compat.h"
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-typedef int (*freecell_solver_user_cmd_line_known_commands_callback_t)(
-    void *instance, int argc, freecell_solver_str_t argv[], int arg_index,
-    int *num_to_skip, int *ret, void *context);
+    typedef int (*freecell_solver_user_cmd_line_known_commands_callback_t)(
+        void *instance, int argc, freecell_solver_str_t argv[], int arg_index,
+        int *num_to_skip, int *ret, void *context);
 
-enum
-{
-    FCS_CMD_LINE_OK,
-    FCS_CMD_LINE_SKIP,
-    FCS_CMD_LINE_STOP,
-    FCS_CMD_LINE_UNRECOGNIZED_OPTION,
-    FCS_CMD_LINE_PARAM_WITH_NO_ARG,
-    FCS_CMD_LINE_ERROR_IN_ARG,
+    enum
+    {
+        FCS_CMD_LINE_OK,
+        FCS_CMD_LINE_SKIP,
+        FCS_CMD_LINE_STOP,
+        FCS_CMD_LINE_UNRECOGNIZED_OPTION,
+        FCS_CMD_LINE_PARAM_WITH_NO_ARG,
+        FCS_CMD_LINE_ERROR_IN_ARG,
 
-    FCS_CMD_LINE_USER = 0x10000
-};
+        FCS_CMD_LINE_USER = 0x10000
+    };
 
 /* One should use
  * freecell_solver_user_cmd_line_parse_args_with_file_nesting_count()
  * instead.
  * */
 #ifndef FC_SOLVE__REMOVE_OLD_API_1
-DLLEXPORT extern int freecell_solver_user_cmd_line_parse_args(void *instance,
-    int argc, freecell_solver_str_t argv[], int start_arg,
-    freecell_solver_str_t *known_parameters,
-    freecell_solver_user_cmd_line_known_commands_callback_t callback,
-    void *callback_context FCS__PASS_ERR_STR(char **error_string),
-    int *last_arg);
+    DLLEXPORT extern int freecell_solver_user_cmd_line_parse_args(
+        void *instance, int argc, freecell_solver_str_t argv[], int start_arg,
+        freecell_solver_str_t *known_parameters,
+        freecell_solver_user_cmd_line_known_commands_callback_t callback,
+        void *callback_context FCS__PASS_ERR_STR(char **error_string),
+        int *last_arg);
 #endif
 
-DLLEXPORT extern int
-freecell_solver_user_cmd_line_parse_args_with_file_nesting_count(void *instance,
-    int argc, freecell_solver_str_t argv[], int start_arg,
-    freecell_solver_str_t *known_parameters,
-    freecell_solver_user_cmd_line_known_commands_callback_t callback,
-    void *callback_context FCS__PASS_ERR_STR(char **error_string),
-    int *last_arg, int file_nesting_count,
-    freecell_solver_str_t opened_files_dir);
+    DLLEXPORT extern int
+    freecell_solver_user_cmd_line_parse_args_with_file_nesting_count(
+        void *instance, int argc, freecell_solver_str_t argv[], int start_arg,
+        freecell_solver_str_t *known_parameters,
+        freecell_solver_user_cmd_line_known_commands_callback_t callback,
+        void *callback_context FCS__PASS_ERR_STR(char **error_string),
+        int *last_arg, int file_nesting_count,
+        freecell_solver_str_t opened_files_dir);
 
-DLLEXPORT extern int freecell_solver_user_cmd_line_read_cmd_line_preset(
-    void *instance, const char *const preset_name,
-    freecell_solver_str_t *known_parameters FCS__PASS_ERR_STR(
-        char **error_string),
-    int file_nesting_count, freecell_solver_str_t opened_files_dir);
+    DLLEXPORT extern int freecell_solver_user_cmd_line_read_cmd_line_preset(
+        void *instance, const char *const preset_name,
+        freecell_solver_str_t *known_parameters FCS__PASS_ERR_STR(
+            char **error_string),
+        int file_nesting_count, freecell_solver_str_t opened_files_dir);
 
 #ifdef __cplusplus
 };
diff --git a/fc-solve/source/fcs_enums.h b/fc-solve/source/fcs_enums.h
index edb9f1354..3eeda42cb 100644
--- a/fc-solve/source/fcs_enums.h
+++ b/fc-solve/source/fcs_enums.h
@@ -12,60 +12,63 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-enum
-{
-    FCS_ES_FILLED_BY_ANY_CARD,
-    FCS_ES_FILLED_BY_KINGS_ONLY,
-    FCS_ES_FILLED_BY_NONE
-};
+    enum
+    {
+        FCS_ES_FILLED_BY_ANY_CARD,
+        FCS_ES_FILLED_BY_KINGS_ONLY,
+        FCS_ES_FILLED_BY_NONE
+    };
 
-enum
-{
-    FCS_SEQ_BUILT_BY_ALTERNATE_COLOR,
-    FCS_SEQ_BUILT_BY_SUIT,
-    FCS_SEQ_BUILT_BY_RANK
-};
+    enum
+    {
+        FCS_SEQ_BUILT_BY_ALTERNATE_COLOR,
+        FCS_SEQ_BUILT_BY_SUIT,
+        FCS_SEQ_BUILT_BY_RANK
+    };
 
-enum
-{
-    FCS_TALON_NONE,
-    FCS_TALON_GYPSY,
-    FCS_TALON_KLONDIKE
-};
+    enum
+    {
+        FCS_TALON_NONE,
+        FCS_TALON_GYPSY,
+        FCS_TALON_KLONDIKE
+    };
 
-typedef enum {
-    FCS_STATE_WAS_SOLVED,
-    FCS_STATE_IS_NOT_SOLVEABLE,
-    FCS_STATE_ALREADY_EXISTS,
-    FCS_STATE_EXCEEDS_MAX_NUM_TIMES,
-    FCS_STATE_BEGIN_SUSPEND_PROCESS,
-    FCS_STATE_SUSPEND_PROCESS,
-    FCS_STATE_EXCEEDS_MAX_DEPTH,
-    FCS_STATE_ORIGINAL_STATE_IS_NOT_SOLVEABLE,
-    FCS_STATE_INVALID_STATE,
-    FCS_STATE_NOT_BEGAN_YET,
-    FCS_STATE_DOES_NOT_EXIST,
-    FCS_STATE_OPTIMIZED,
-    FCS_STATE_FLARES_PLAN_ERROR
-} fc_solve_solve_process_ret_t;
+    typedef enum
+    {
+        FCS_STATE_WAS_SOLVED,
+        FCS_STATE_IS_NOT_SOLVEABLE,
+        FCS_STATE_ALREADY_EXISTS,
+        FCS_STATE_EXCEEDS_MAX_NUM_TIMES,
+        FCS_STATE_BEGIN_SUSPEND_PROCESS,
+        FCS_STATE_SUSPEND_PROCESS,
+        FCS_STATE_EXCEEDS_MAX_DEPTH,
+        FCS_STATE_ORIGINAL_STATE_IS_NOT_SOLVEABLE,
+        FCS_STATE_INVALID_STATE,
+        FCS_STATE_NOT_BEGAN_YET,
+        FCS_STATE_DOES_NOT_EXIST,
+        FCS_STATE_OPTIMIZED,
+        FCS_STATE_FLARES_PLAN_ERROR
+    } fc_solve_solve_process_ret_t;
 
-typedef enum {
-    FCS_PRESET_CODE_OK,
-    FCS_PRESET_CODE_NOT_FOUND,
-    FCS_PRESET_CODE_FREECELLS_EXCEED_MAX,
-    FCS_PRESET_CODE_STACKS_EXCEED_MAX,
-    FCS_PRESET_CODE_DECKS_EXCEED_MAX
-} fc_solve_preset_ret_code_t;
+    typedef enum
+    {
+        FCS_PRESET_CODE_OK,
+        FCS_PRESET_CODE_NOT_FOUND,
+        FCS_PRESET_CODE_FREECELLS_EXCEED_MAX,
+        FCS_PRESET_CODE_STACKS_EXCEED_MAX,
+        FCS_PRESET_CODE_DECKS_EXCEED_MAX
+    } fc_solve_preset_ret_code_t;
 
-enum
-{
-    FC_SOLVE__STANDARD_NOTATION_NO = 0,
-    FC_SOLVE__STANDARD_NOTATION_REGULAR = 1,
-    FC_SOLVE__STANDARD_NOTATION_EXTENDED = 2
-};
+    enum
+    {
+        FC_SOLVE__STANDARD_NOTATION_NO = 0,
+        FC_SOLVE__STANDARD_NOTATION_REGULAR = 1,
+        FC_SOLVE__STANDARD_NOTATION_EXTENDED = 2
+    };
 
 #define FCS_METHOD_HARD_DFS 0
 #define FCS_METHOD_SOFT_DFS 1
diff --git a/fc-solve/source/fcs_hash.h b/fc-solve/source/fcs_hash.h
index 03087a7ec..74c5e8376 100644
--- a/fc-solve/source/fcs_hash.h
+++ b/fc-solve/source/fcs_hash.h
@@ -14,72 +14,73 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "meta_alloc.h"
 #include "rinutils.h"
 
 #ifdef FCS_INLINED_HASH_COMPARISON
-enum FCS_INLINED_HASH_DATA_TYPE
-{
-    FCS_INLINED_HASH__COLUMNS,
-    FCS_INLINED_HASH__STATES,
-};
+    enum FCS_INLINED_HASH_DATA_TYPE
+    {
+        FCS_INLINED_HASH__COLUMNS,
+        FCS_INLINED_HASH__STATES,
+    };
 #endif
 
-typedef int fc_solve_hash_value_t;
+    typedef int fc_solve_hash_value_t;
 
-struct fc_solve_hash_symlink_item_struct
-{
-    /* A pointer to the data structure that is to be collected */
-    void *key;
-    /* We also store the hash value corresponding to this key for faster
-       comparisons */
-    fc_solve_hash_value_t hash_value;
+    struct fc_solve_hash_symlink_item_struct
+    {
+        /* A pointer to the data structure that is to be collected */
+        void *key;
+        /* We also store the hash value corresponding to this key for faster
+           comparisons */
+        fc_solve_hash_value_t hash_value;
 #ifdef FCS_ENABLE_SECONDARY_HASH_VALUE
-    /*
-     * We also store a secondary hash value, which is not used for indexing,
-     * but is used to speed up comparison.
-     * */
-    fc_solve_hash_value_t secondary_hash_value;
+        /*
+         * We also store a secondary hash value, which is not used for indexing,
+         * but is used to speed up comparison.
+         * */
+        fc_solve_hash_value_t secondary_hash_value;
 #endif
-    /* The next item in the list */
-    struct fc_solve_hash_symlink_item_struct *next;
-};
+        /* The next item in the list */
+        struct fc_solve_hash_symlink_item_struct *next;
+    };
 
-typedef struct fc_solve_hash_symlink_item_struct fcs_hash_item_t;
+    typedef struct fc_solve_hash_symlink_item_struct fcs_hash_item_t;
 
-typedef struct
-{
-    fcs_hash_item_t *first_item;
-} fc_solve_hash_symlink_t;
+    typedef struct
+    {
+        fcs_hash_item_t *first_item;
+    } fc_solve_hash_symlink_t;
 
-struct fc_solve_instance_struct;
+    struct fc_solve_instance_struct;
 
 #ifndef FCS_INLINED_HASH_COMPARISON
 #ifdef FCS_WITH_CONTEXT_VARIABLE
-typedef int (*fcs_hash_compare_function_t)(
-    const void *const, const void *const, void *context);
+    typedef int (*fcs_hash_compare_function_t)(
+        const void *const, const void *const, void *context);
 #else
-typedef int (*fcs_hash_compare_function_t)(
-    const void *const, const void *const);
+    typedef int (*fcs_hash_compare_function_t)(
+        const void *const, const void *const);
 #endif
 #endif
 
-typedef struct
-{
-    /* The vector of the hash table itself */
-    fc_solve_hash_symlink_t *entries;
+    typedef struct
+    {
+        /* The vector of the hash table itself */
+        fc_solve_hash_symlink_t *entries;
 #ifndef FCS_WITHOUT_TRIM_MAX_STORED_STATES
-    /* The list of vacant items as freed by the garbage collector. Use
-     * if before allocating more. */
-    fcs_hash_item_t *list_of_vacant_items;
+        /* The list of vacant items as freed by the garbage collector. Use
+         * if before allocating more. */
+        fcs_hash_item_t *list_of_vacant_items;
 #endif
 /* A comparison function that can be used for comparing two keys
    in the collection */
 #ifdef FCS_INLINED_HASH_COMPARISON
-    enum FCS_INLINED_HASH_DATA_TYPE hash_type;
+        enum FCS_INLINED_HASH_DATA_TYPE hash_type;
 #else
     fcs_hash_compare_function_t compare_function;
 #ifdef FCS_WITH_CONTEXT_VARIABLE
@@ -89,32 +90,33 @@ typedef struct
 #endif
 #endif
 
-    /* The size of the hash table */
-    int size;
+        /* The size of the hash table */
+        int size;
 
-    /* A bit mask that extract the lowest bits out of the hash value */
-    int size_bitmask;
-    /* The number of elements stored inside the hash */
-    fcs_int_limit_t num_elems;
+        /* A bit mask that extract the lowest bits out of the hash value */
+        int size_bitmask;
+        /* The number of elements stored inside the hash */
+        fcs_int_limit_t num_elems;
 
-    fcs_int_limit_t max_num_elems_before_resize;
+        fcs_int_limit_t max_num_elems_before_resize;
 
-    fcs_compact_allocator_t allocator;
+        fcs_compact_allocator_t allocator;
 #ifdef FCS_RCS_STATES
-    struct fc_solve_instance_struct *instance;
+        struct fc_solve_instance_struct *instance;
 #endif
-} fc_solve_hash_t;
+    } fc_solve_hash_t;
 
-static inline void fcs_hash_set_max_num_elems(
-    fc_solve_hash_t *const hash, const fcs_int_limit_t new_size)
-{
-    hash->max_num_elems_before_resize = (new_size << 1);
-}
+    static inline void fcs_hash_set_max_num_elems(
+        fc_solve_hash_t *const hash, const fcs_int_limit_t new_size)
+    {
+        hash->max_num_elems_before_resize = (new_size << 1);
+    }
 
-static inline void fc_solve_hash_init(
-    fcs_meta_compact_allocator_t *const meta_alloc, fc_solve_hash_t *const hash,
+    static inline void fc_solve_hash_init(
+        fcs_meta_compact_allocator_t *const meta_alloc,
+        fc_solve_hash_t *const hash,
 #ifdef FCS_INLINED_HASH_COMPARISON
-    const enum FCS_INLINED_HASH_DATA_TYPE hash_type
+        const enum FCS_INLINED_HASH_DATA_TYPE hash_type
 #else
     fcs_hash_compare_function_t compare_function
 #ifdef FCS_WITH_CONTEXT_VARIABLE
@@ -123,28 +125,28 @@ static inline void fc_solve_hash_init(
 #else
 #endif
 #endif
-)
-{
-    const typeof(hash->size) initial_hash_size = 2048;
+    )
+    {
+        const typeof(hash->size) initial_hash_size = 2048;
 
-    hash->size = initial_hash_size;
-    hash->size_bitmask = initial_hash_size - 1;
-    fcs_hash_set_max_num_elems(hash, initial_hash_size);
+        hash->size = initial_hash_size;
+        hash->size_bitmask = initial_hash_size - 1;
+        fcs_hash_set_max_num_elems(hash, initial_hash_size);
 
-    hash->num_elems = 0;
+        hash->num_elems = 0;
 
-    /* Allocate a table of size entries */
-    /* Initialize all the cells of the hash table to NULL, which indicate
-       that the end of each chain is right at the start. */
-    hash->entries = (fc_solve_hash_symlink_t *)calloc(
-        initial_hash_size, sizeof(hash->entries[0]));
+        /* Allocate a table of size entries */
+        /* Initialize all the cells of the hash table to NULL, which indicate
+           that the end of each chain is right at the start. */
+        hash->entries = (fc_solve_hash_symlink_t *)calloc(
+            initial_hash_size, sizeof(hash->entries[0]));
 
 #ifndef FCS_WITHOUT_TRIM_MAX_STORED_STATES
-    hash->list_of_vacant_items = NULL;
+        hash->list_of_vacant_items = NULL;
 #endif
 
 #ifdef FCS_INLINED_HASH_COMPARISON
-    hash->hash_type = hash_type;
+        hash->hash_type = hash_type;
 #else
     hash->compare_function = compare_function;
 #ifdef FCS_WITH_CONTEXT_VARIABLE
@@ -152,46 +154,46 @@ static inline void fc_solve_hash_init(
 #endif
 #endif
 
-    fc_solve_compact_allocator_init(&(hash->allocator), meta_alloc);
-}
+        fc_solve_compact_allocator_init(&(hash->allocator), meta_alloc);
+    }
 
-static inline void fc_solve_hash_free(fc_solve_hash_t *const hash)
-{
-    fc_solve_compact_allocator_finish(&(hash->allocator));
-    free(hash->entries);
-    hash->entries = NULL;
-}
+    static inline void fc_solve_hash_free(fc_solve_hash_t *const hash)
+    {
+        fc_solve_compact_allocator_finish(&(hash->allocator));
+        free(hash->entries);
+        hash->entries = NULL;
+    }
 
 #ifndef FCS_WITHOUT_TRIM_MAX_STORED_STATES
-static inline void fc_solve_hash_foreach(fc_solve_hash_t *const hash,
-    fcs_bool_t (*should_delete_ptr)(void *const key, void *const context),
-    void *const context)
-{
-    const_SLOT(size, hash);
-    var_AUTO(entries, hash->entries);
-    for (int i = 0; i < size; i++)
+    static inline void fc_solve_hash_foreach(fc_solve_hash_t *const hash,
+        fcs_bool_t (*should_delete_ptr)(void *const key, void *const context),
+        void *const context)
     {
-        fcs_hash_item_t **item = &(entries[i].first_item);
-        while ((*item) != NULL)
+        const_SLOT(size, hash);
+        var_AUTO(entries, hash->entries);
+        for (int i = 0; i < size; i++)
         {
-            if (should_delete_ptr((*item)->key, context))
+            fcs_hash_item_t **item = &(entries[i].first_item);
+            while ((*item) != NULL)
             {
-                fcs_hash_item_t *const next_item = (*item)->next;
-                /* Garbage collect (*item). */
-                (*item)->next = hash->list_of_vacant_items;
-                hash->list_of_vacant_items = (*item);
-                /* Skip the item in the chain. */
-                (*item) = next_item;
-
-                hash->num_elems--;
-            }
-            else
-            {
-                item = &((*item)->next);
+                if (should_delete_ptr((*item)->key, context))
+                {
+                    fcs_hash_item_t *const next_item = (*item)->next;
+                    /* Garbage collect (*item). */
+                    (*item)->next = hash->list_of_vacant_items;
+                    hash->list_of_vacant_items = (*item);
+                    /* Skip the item in the chain. */
+                    (*item) = next_item;
+
+                    hash->num_elems--;
+                }
+                else
+                {
+                    item = &((*item)->next);
+                }
             }
         }
     }
-}
 #endif
 
 #ifdef __cplusplus
diff --git a/fc-solve/source/fcs_move.h b/fc-solve/source/fcs_move.h
index d53a0085a..6b4087037 100644
--- a/fc-solve/source/fcs_move.h
+++ b/fc-solve/source/fcs_move.h
@@ -16,32 +16,33 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-enum
-{
-    FCS_MOVE_TYPE_STACK_TO_STACK,
-    FCS_MOVE_TYPE_STACK_TO_FREECELL,
-    FCS_MOVE_TYPE_FREECELL_TO_STACK,
-    FCS_MOVE_TYPE_FREECELL_TO_FREECELL,
-    FCS_MOVE_TYPE_STACK_TO_FOUNDATION,
-    FCS_MOVE_TYPE_FREECELL_TO_FOUNDATION,
-    FCS_MOVE_TYPE_FLIP_CARD,
-    FCS_MOVE_TYPE_DEAL_GYPSY_TALON,
-    FCS_MOVE_TYPE_KLONDIKE_TALON_TO_STACK,
-    FCS_MOVE_TYPE_KLONDIKE_FLIP_TALON,
-    FCS_MOVE_TYPE_KLONDIKE_REDEAL_TALON,
-    FCS_MOVE_TYPE_SEQ_TO_FOUNDATION,
-    FCS_MOVE_TYPE_CANONIZE,
-    FCS_MOVE_TYPE_SEPARATOR,
-    FCS_MOVE_TYPE_NULL
-};
+    enum
+    {
+        FCS_MOVE_TYPE_STACK_TO_STACK,
+        FCS_MOVE_TYPE_STACK_TO_FREECELL,
+        FCS_MOVE_TYPE_FREECELL_TO_STACK,
+        FCS_MOVE_TYPE_FREECELL_TO_FREECELL,
+        FCS_MOVE_TYPE_STACK_TO_FOUNDATION,
+        FCS_MOVE_TYPE_FREECELL_TO_FOUNDATION,
+        FCS_MOVE_TYPE_FLIP_CARD,
+        FCS_MOVE_TYPE_DEAL_GYPSY_TALON,
+        FCS_MOVE_TYPE_KLONDIKE_TALON_TO_STACK,
+        FCS_MOVE_TYPE_KLONDIKE_FLIP_TALON,
+        FCS_MOVE_TYPE_KLONDIKE_REDEAL_TALON,
+        FCS_MOVE_TYPE_SEQ_TO_FOUNDATION,
+        FCS_MOVE_TYPE_CANONIZE,
+        FCS_MOVE_TYPE_SEPARATOR,
+        FCS_MOVE_TYPE_NULL
+    };
 
-typedef struct
-{
-    unsigned char c[4];
-} fcs_move_t;
+    typedef struct
+    {
+        unsigned char c[4];
+    } fcs_move_t;
 
 #define FCS_MOVE_TYPE 0
 #define FCS_MOVE_SRC 1
@@ -75,11 +76,11 @@ typedef struct
 #define fcs_move_get_num_cards_in_seq(move)                                    \
     ((move).c[FCS_MOVE_NUM_CARDS_IN_SEQ])
 
-typedef struct
-{
-    int num_moves;
-    fcs_move_t *moves;
-} fcs_moves_sequence_t;
+    typedef struct
+    {
+        int num_moves;
+        fcs_move_t *moves;
+    } fcs_moves_sequence_t;
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/fcs_user.h b/fc-solve/source/fcs_user.h
index d0fd4876d..30ad8b0fb 100644
--- a/fc-solve/source/fcs_user.h
+++ b/fc-solve/source/fcs_user.h
@@ -22,351 +22,365 @@
 #include "fcs_back_compat.h"
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #ifdef FC_SOLVE_STRINGS_COMPAT
-typedef char *freecell_solver_str_t;
+    typedef char *freecell_solver_str_t;
 #else
 typedef const char *freecell_solver_str_t;
 #endif
 
-DLLEXPORT extern void *freecell_solver_user_alloc(void);
+    DLLEXPORT extern void *freecell_solver_user_alloc(void);
 
-DLLEXPORT extern int freecell_solver_user_apply_preset(
-    void *instance, const char *preset_name);
+    DLLEXPORT extern int freecell_solver_user_apply_preset(
+        void *instance, const char *preset_name);
 
-DLLEXPORT extern void freecell_solver_user_limit_iterations_long(
-    void *user_instance, fcs_int_limit_t max_iters);
+    DLLEXPORT extern void freecell_solver_user_limit_iterations_long(
+        void *user_instance, fcs_int_limit_t max_iters);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern void freecell_solver_user_limit_iterations(
-    void *user_instance, int max_iters);
+    DLLEXPORT extern void freecell_solver_user_limit_iterations(
+        void *user_instance, int max_iters);
 
-DLLEXPORT extern int freecell_solver_user_set_tests_order(void *user_instance,
-    const char *moves_order FCS__PASS_ERR_STR(char **error_string));
+    DLLEXPORT extern int freecell_solver_user_set_tests_order(
+        void *user_instance,
+        const char *moves_order FCS__PASS_ERR_STR(char **error_string));
 #endif
 
-DLLEXPORT extern int freecell_solver_user_solve_board(
-    void *user_instance, const char *state_as_string);
+    DLLEXPORT extern int freecell_solver_user_solve_board(
+        void *user_instance, const char *state_as_string);
 
-DLLEXPORT extern int freecell_solver_user_resume_solution(void *user_instance);
+    DLLEXPORT extern int freecell_solver_user_resume_solution(
+        void *user_instance);
 
-DLLEXPORT extern int freecell_solver_user_get_next_move(
-    void *user_instance, fcs_move_t *move);
+    DLLEXPORT extern int freecell_solver_user_get_next_move(
+        void *user_instance, fcs_move_t *move);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern char *freecell_solver_user_current_state_as_string(
-    void *user_instance
+    DLLEXPORT extern char *freecell_solver_user_current_state_as_string(
+        void *user_instance
 #ifndef FC_SOLVE_IMPLICIT_PARSABLE_OUTPUT
-    ,
-    int parseable_output
+        ,
+        int parseable_output
 #endif
-    ,
-    int canonized_order_output
+        ,
+        int canonized_order_output
 #ifndef FC_SOLVE_IMPLICIT_T_RANK
-    ,
-    int display_10_as_t
+        ,
+        int display_10_as_t
 #endif
-);
+    );
 #endif
 
-DLLEXPORT extern void freecell_solver_user_current_state_stringify(
-    void *user_instance, char *const output_string
+    DLLEXPORT extern void freecell_solver_user_current_state_stringify(
+        void *user_instance, char *const output_string
 #ifndef FC_SOLVE_IMPLICIT_PARSABLE_OUTPUT
-    ,
-    int parseable_output
+        ,
+        int parseable_output
 #endif
-    ,
-    int canonized_order_output
+        ,
+        int canonized_order_output
 #ifndef FC_SOLVE_IMPLICIT_T_RANK
-    ,
-    int display_10_as_t
+        ,
+        int display_10_as_t
 #endif
-);
+    );
 
-DLLEXPORT extern void freecell_solver_user_free(void *user_instance);
+    DLLEXPORT extern void freecell_solver_user_free(void *user_instance);
 
-DLLEXPORT extern int freecell_solver_user_get_current_depth(
-    void *user_instance);
+    DLLEXPORT extern int freecell_solver_user_get_current_depth(
+        void *user_instance);
 
-DLLEXPORT extern void freecell_solver_user_set_solving_method(
-    void *const user_instance, const int method);
+    DLLEXPORT extern void freecell_solver_user_set_solving_method(
+        void *const user_instance, const int method);
 
-DLLEXPORT extern fcs_int_limit_t freecell_solver_user_get_num_times_long(
-    void *user_instance);
+    DLLEXPORT extern fcs_int_limit_t freecell_solver_user_get_num_times_long(
+        void *user_instance);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern int freecell_solver_user_get_num_times(void *user_instance);
+    DLLEXPORT extern int freecell_solver_user_get_num_times(
+        void *user_instance);
 
-DLLEXPORT extern int freecell_solver_user_get_limit_iterations(
-    void *user_instance);
+    DLLEXPORT extern int freecell_solver_user_get_limit_iterations(
+        void *user_instance);
 #endif
 
-DLLEXPORT extern int freecell_solver_user_get_moves_left(void *user_instance);
+    DLLEXPORT extern int freecell_solver_user_get_moves_left(
+        void *user_instance);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern int freecell_solver_user_set_game(void *user_instance,
-    int freecells_num, int stacks_num, int decks_num,
-    int sequences_are_built_by, int unlimited_sequence_move,
-    int empty_stacks_fill);
+    DLLEXPORT extern int freecell_solver_user_set_game(void *user_instance,
+        int freecells_num, int stacks_num, int decks_num,
+        int sequences_are_built_by, int unlimited_sequence_move,
+        int empty_stacks_fill);
 #endif
 
-DLLEXPORT extern void freecell_solver_user_set_solution_optimization(
-    void *user_instance, int optimize);
+    DLLEXPORT extern void freecell_solver_user_set_solution_optimization(
+        void *user_instance, int optimize);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern char *freecell_solver_user_move_to_string(
-    fcs_move_t move, int standard_notation);
+    DLLEXPORT extern char *freecell_solver_user_move_to_string(
+        fcs_move_t move, int standard_notation);
 
-DLLEXPORT extern char *freecell_solver_user_move_to_string_w_state(
-    void *user_instance, fcs_move_t move, int standard_notation);
+    DLLEXPORT extern char *freecell_solver_user_move_to_string_w_state(
+        void *user_instance, fcs_move_t move, int standard_notation);
 #endif
 
-DLLEXPORT extern void freecell_solver_user_stringify_move_w_state(
-    void *user_instance, char *output_string, fcs_move_t move,
-    int standard_notation);
+    DLLEXPORT extern void freecell_solver_user_stringify_move_w_state(
+        void *user_instance, char *output_string, fcs_move_t move,
+        int standard_notation);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern void freecell_solver_user_limit_depth(
-    void *user_instance, int max_depth);
+    DLLEXPORT extern void freecell_solver_user_limit_depth(
+        void *user_instance, int max_depth);
 #endif
 
-DLLEXPORT extern int freecell_solver_user_set_num_freecells(
-    void *user_instance, int freecells_num);
+    DLLEXPORT extern int freecell_solver_user_set_num_freecells(
+        void *user_instance, int freecells_num);
 
-DLLEXPORT extern int freecell_solver_user_get_max_num_freecells(void);
+    DLLEXPORT extern int freecell_solver_user_get_max_num_freecells(void);
 
-DLLEXPORT extern int freecell_solver_user_set_num_stacks(
-    void *user_instance, int stacks_num);
+    DLLEXPORT extern int freecell_solver_user_set_num_stacks(
+        void *user_instance, int stacks_num);
 
-DLLEXPORT extern int freecell_solver_user_get_max_num_stacks(void);
+    DLLEXPORT extern int freecell_solver_user_get_max_num_stacks(void);
 
-DLLEXPORT extern int freecell_solver_user_set_num_decks(
-    void *user_instance, int decks_num);
+    DLLEXPORT extern int freecell_solver_user_set_num_decks(
+        void *user_instance, int decks_num);
 
-DLLEXPORT extern int freecell_solver_user_get_max_num_decks(void);
+    DLLEXPORT extern int freecell_solver_user_get_max_num_decks(void);
 
 #ifdef FCS_WITH_ERROR_STRS
-DLLEXPORT void freecell_solver_user_get_invalid_state_error_into_string(
-    void *const api_instance, char *const string
+    DLLEXPORT void freecell_solver_user_get_invalid_state_error_into_string(
+        void *const api_instance, char *const string
 #ifndef FC_SOLVE_IMPLICIT_T_RANK
-    ,
-    const int print_ts
+        ,
+        const int print_ts
 #endif
-);
+    );
 #endif
 
 #ifdef FCS_WITH_ERROR_STRS
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern char *freecell_solver_user_get_invalid_state_error_string(
-    void *user_instance
+    DLLEXPORT extern char *freecell_solver_user_get_invalid_state_error_string(
+        void *user_instance
 #ifndef FC_SOLVE_IMPLICIT_T_RANK
-    ,
-    int print_ts
+        ,
+        int print_ts
 #endif
-);
+    );
 #endif
 #endif
 
-DLLEXPORT extern int freecell_solver_user_set_sequences_are_built_by_type(
-    void *user_instance, int sequences_are_built_by);
+    DLLEXPORT extern int freecell_solver_user_set_sequences_are_built_by_type(
+        void *user_instance, int sequences_are_built_by);
 
-DLLEXPORT extern int freecell_solver_user_set_empty_stacks_filled_by(
-    void *user_instance, int es_fill);
+    DLLEXPORT extern int freecell_solver_user_set_empty_stacks_filled_by(
+        void *user_instance, int es_fill);
 
-DLLEXPORT extern int freecell_solver_user_set_sequence_move(
-    void *user_instance, int unlimited_sequence_move);
+    DLLEXPORT extern int freecell_solver_user_set_sequence_move(
+        void *user_instance, int unlimited_sequence_move);
 
-DLLEXPORT extern int freecell_solver_user_set_a_star_weight(
-    void *const user_instance, const int my_index, const double weight);
+    DLLEXPORT extern int freecell_solver_user_set_a_star_weight(
+        void *const user_instance, const int my_index, const double weight);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-typedef void (*freecell_solver_user_iter_handler_t)(void *user_instance,
-    int iter_num, int depth, void *ptr_state, int parent_iter_num,
-    void *context);
+    typedef void (*freecell_solver_user_iter_handler_t)(void *user_instance,
+        int iter_num, int depth, void *ptr_state, int parent_iter_num,
+        void *context);
 #endif
 
-typedef void (*freecell_solver_user_long_iter_handler_t)(void *user_instance,
-    fcs_int_limit_t iter_num, int depth, void *ptr_state,
-    fcs_int_limit_t parent_iter_num, void *context);
+    typedef void (*freecell_solver_user_long_iter_handler_t)(
+        void *user_instance, fcs_int_limit_t iter_num, int depth,
+        void *ptr_state, fcs_int_limit_t parent_iter_num, void *context);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern void freecell_solver_user_set_iter_handler(void *user_instance,
-    freecell_solver_user_iter_handler_t iter_handler,
-    void *iter_handler_context);
+    DLLEXPORT extern void freecell_solver_user_set_iter_handler(
+        void *user_instance, freecell_solver_user_iter_handler_t iter_handler,
+        void *iter_handler_context);
 #endif
 
-DLLEXPORT extern void freecell_solver_user_set_iter_handler_long(
-    void *user_instance, freecell_solver_user_long_iter_handler_t iter_handler,
-    void *iter_handler_context);
+    DLLEXPORT extern void freecell_solver_user_set_iter_handler_long(
+        void *user_instance,
+        freecell_solver_user_long_iter_handler_t iter_handler,
+        void *iter_handler_context);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern char *freecell_solver_user_iter_state_as_string(
-    void *const user_instance, void *const ptr_state
+    DLLEXPORT extern char *freecell_solver_user_iter_state_as_string(
+        void *const user_instance, void *const ptr_state
 #ifndef FC_SOLVE_IMPLICIT_PARSABLE_OUTPUT
-    ,
-    const int parseable_output
+        ,
+        const int parseable_output
 #endif
-    ,
-    const int canonized_order_output
+        ,
+        const int canonized_order_output
 #ifndef FC_SOLVE_IMPLICIT_T_RANK
-    ,
-    const int display_10_as_t
+        ,
+        const int display_10_as_t
 #endif
-);
+    );
 #endif
 
-DLLEXPORT extern void freecell_solver_user_iter_state_stringify(
-    void *const user_instance, char *output_string, void *const ptr_state
+    DLLEXPORT extern void freecell_solver_user_iter_state_stringify(
+        void *const user_instance, char *output_string, void *const ptr_state
 #ifndef FC_SOLVE_IMPLICIT_PARSABLE_OUTPUT
-    ,
-    const int parseable_output
+        ,
+        const int parseable_output
 #endif
-    ,
-    const int canonized_order_output
+        ,
+        const int canonized_order_output
 #ifndef FC_SOLVE_IMPLICIT_T_RANK
-    ,
-    const int display_10_as_t
+        ,
+        const int display_10_as_t
 #endif
-);
+    );
 
-DLLEXPORT extern void freecell_solver_user_set_random_seed(
-    void *const user_instance, const int seed);
+    DLLEXPORT extern void freecell_solver_user_set_random_seed(
+        void *const user_instance, const int seed);
 
 #ifndef FCS_DISABLE_NUM_STORED_STATES
-DLLEXPORT fcs_int_limit_t
-freecell_solver_user_get_num_states_in_collection_long(
-    void *const user_instance);
+    DLLEXPORT fcs_int_limit_t
+    freecell_solver_user_get_num_states_in_collection_long(
+        void *const user_instance);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern int freecell_solver_user_get_num_states_in_collection(
-    void *const user_instance);
+    DLLEXPORT extern int freecell_solver_user_get_num_states_in_collection(
+        void *const user_instance);
 #endif
 
-DLLEXPORT extern void freecell_solver_user_limit_num_states_in_collection_long(
-    void *user_instance, fcs_int_limit_t max_num_states);
+    DLLEXPORT extern void
+    freecell_solver_user_limit_num_states_in_collection_long(
+        void *user_instance, fcs_int_limit_t max_num_states);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern void freecell_solver_user_limit_num_states_in_collection(
-    void *user_instance, int max_num_states);
+    DLLEXPORT extern void freecell_solver_user_limit_num_states_in_collection(
+        void *user_instance, int max_num_states);
 #endif
 
-DLLEXPORT extern void freecell_solver_set_stored_states_trimming_limit(
-    void *user_instance, long max_num_states);
+    DLLEXPORT extern void freecell_solver_set_stored_states_trimming_limit(
+        void *user_instance, long max_num_states);
 #endif
 
-DLLEXPORT extern int freecell_solver_user_next_soft_thread(void *user_instance);
+    DLLEXPORT extern int freecell_solver_user_next_soft_thread(
+        void *user_instance);
 
-DLLEXPORT extern void freecell_solver_user_set_soft_thread_step(
-    void *const user_instance, const int checked_states_step);
+    DLLEXPORT extern void freecell_solver_user_set_soft_thread_step(
+        void *const user_instance, const int checked_states_step);
 
-DLLEXPORT extern int freecell_solver_user_next_hard_thread(
-    void *const user_instance);
+    DLLEXPORT extern int freecell_solver_user_next_hard_thread(
+        void *const user_instance);
 
-DLLEXPORT extern int freecell_solver_user_get_num_soft_threads_in_instance(
-    void *const user_instance);
+    DLLEXPORT extern int freecell_solver_user_get_num_soft_threads_in_instance(
+        void *const user_instance);
 
-DLLEXPORT extern void freecell_solver_user_set_calc_real_depth(
-    void *const user_instance, const int calc_real_depth);
+    DLLEXPORT extern void freecell_solver_user_set_calc_real_depth(
+        void *const user_instance, const int calc_real_depth);
 
-DLLEXPORT extern void freecell_solver_user_set_soft_thread_name(
-    void *const user_instance, freecell_solver_str_t name);
+    DLLEXPORT extern void freecell_solver_user_set_soft_thread_name(
+        void *const user_instance, freecell_solver_str_t name);
 
-DLLEXPORT extern void freecell_solver_user_set_flare_name(
-    void *const user_instance, freecell_solver_str_t name);
+    DLLEXPORT extern void freecell_solver_user_set_flare_name(
+        void *const user_instance, freecell_solver_str_t name);
 
-DLLEXPORT extern int freecell_solver_user_set_hard_thread_prelude(
-    void *const user_instance, freecell_solver_str_t prelude);
+    DLLEXPORT extern int freecell_solver_user_set_hard_thread_prelude(
+        void *const user_instance, freecell_solver_str_t prelude);
 
-DLLEXPORT extern int freecell_solver_user_set_flares_plan(
-    void *const api_instance, freecell_solver_str_t plan);
+    DLLEXPORT extern int freecell_solver_user_set_flares_plan(
+        void *const api_instance, freecell_solver_str_t plan);
 
-DLLEXPORT extern void freecell_solver_user_recycle(void *const user_instance);
+    DLLEXPORT extern void freecell_solver_user_recycle(
+        void *const user_instance);
 
-DLLEXPORT extern int freecell_solver_user_set_optimization_scan_tests_order(
-    void *const user_instance,
-    const char *const moves_order FCS__PASS_ERR_STR(char **const error_string));
+    DLLEXPORT extern int freecell_solver_user_set_optimization_scan_tests_order(
+        void *const user_instance,
+        const char *const moves_order FCS__PASS_ERR_STR(
+            char **const error_string));
 
-DLLEXPORT extern void freecell_solver_user_set_reparent_states(
-    void *const user_instance, const int to_reparent_states);
+    DLLEXPORT extern void freecell_solver_user_set_reparent_states(
+        void *const user_instance, const int to_reparent_states);
 
-DLLEXPORT extern void freecell_solver_user_set_scans_synergy(
-    void *const user_instance, const int synergy);
+    DLLEXPORT extern void freecell_solver_user_set_scans_synergy(
+        void *const user_instance, const int synergy);
 
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern void freecell_solver_user_limit_current_instance_iterations(
-    void *user_instance, int max_iters);
+    DLLEXPORT extern void
+    freecell_solver_user_limit_current_instance_iterations(
+        void *user_instance, int max_iters);
 #endif
 
-DLLEXPORT extern int freecell_solver_user_next_instance(
-    void *const user_instance);
+    DLLEXPORT extern int freecell_solver_user_next_instance(
+        void *const user_instance);
 
-DLLEXPORT extern int freecell_solver_user_next_flare(void *const api_instance);
+    DLLEXPORT extern int freecell_solver_user_next_flare(
+        void *const api_instance);
 
 /*
  * This function resets the user_instance, making it lose
  * all the previous command line arguments it encountered
  * */
 #ifndef FCS_BREAK_BACKWARD_COMPAT_1
-DLLEXPORT extern int freecell_solver_user_reset(void *const user_instance);
+    DLLEXPORT extern int freecell_solver_user_reset(void *const user_instance);
 
-DLLEXPORT const char *freecell_solver_user_get_lib_version(
-    void *const user_instance);
+    DLLEXPORT const char *freecell_solver_user_get_lib_version(
+        void *const user_instance);
 #endif
 
-DLLEXPORT const char *freecell_solver_user_get_current_soft_thread_name(
-    void *const user_instance);
+    DLLEXPORT const char *freecell_solver_user_get_current_soft_thread_name(
+        void *const user_instance);
 
 /*
  * This error string should be strdup()'ed or something if one wishes
  * to reuse it. Otherwise, it is constant.
  * */
 #ifdef FCS_WITH_ERROR_STRS
-DLLEXPORT const char *freecell_solver_user_get_last_error_string(
-    void *const api_instance);
+    DLLEXPORT const char *freecell_solver_user_get_last_error_string(
+        void *const api_instance);
 #endif
 
-/*
- * This sets the moves_order from min_depth onwards.
- * */
-DLLEXPORT extern int freecell_solver_user_set_depth_tests_order(
-    void *const user_instance, const int min_depth,
-    const char *const moves_order FCS__PASS_ERR_STR(char **const error_string));
+    /*
+     * This sets the moves_order from min_depth onwards.
+     * */
+    DLLEXPORT extern int freecell_solver_user_set_depth_tests_order(
+        void *const user_instance, const int min_depth,
+        const char *const moves_order FCS__PASS_ERR_STR(
+            char **const error_string));
 
 #ifndef FCS_ENABLE_PRUNE__R_TF__UNCOND
-DLLEXPORT extern int freecell_solver_user_set_pruning(void *const user_instance,
-    const char *const pruning FCS__PASS_ERR_STR(char **const error_string));
+    DLLEXPORT extern int freecell_solver_user_set_pruning(
+        void *const user_instance,
+        const char *const pruning FCS__PASS_ERR_STR(char **const error_string));
 #endif
 
-DLLEXPORT extern int freecell_solver_user_set_cache_limit(
-    void *const user_instance, long limit);
+    DLLEXPORT extern int freecell_solver_user_set_cache_limit(
+        void *const user_instance, long limit);
 
-DLLEXPORT extern int freecell_solver_user_get_moves_sequence(
-    void *const user_instance, fcs_moves_sequence_t *const moves_seq);
+    DLLEXPORT extern int freecell_solver_user_get_moves_sequence(
+        void *const user_instance, fcs_moves_sequence_t *const moves_seq);
 
-DLLEXPORT extern int freecell_solver_user_set_flares_choice(
-    void *const user_instance, const char *const new_flares_choice_string);
+    DLLEXPORT extern int freecell_solver_user_set_flares_choice(
+        void *const user_instance, const char *const new_flares_choice_string);
 
-DLLEXPORT extern void freecell_solver_user_set_flares_iters_factor(
-    void *const user_instance, const double new_factor);
+    DLLEXPORT extern void freecell_solver_user_set_flares_iters_factor(
+        void *const user_instance, const double new_factor);
 
-DLLEXPORT extern int freecell_solver_user_set_patsolve_x_param(
-    void *const api_instance, const int position,
-    const int x_param_val FCS__PASS_ERR_STR(char **const error_string));
+    DLLEXPORT extern int freecell_solver_user_set_patsolve_x_param(
+        void *const api_instance, const int position,
+        const int x_param_val FCS__PASS_ERR_STR(char **const error_string));
 
-DLLEXPORT extern int freecell_solver_user_set_patsolve_y_param(
-    void *const api_instance, const int position,
-    const double y_param_val FCS__PASS_ERR_STR(char **const error_string));
+    DLLEXPORT extern int freecell_solver_user_set_patsolve_y_param(
+        void *const api_instance, const int position,
+        const double y_param_val FCS__PASS_ERR_STR(char **const error_string));
 
-typedef struct
-{
-    size_t scan_idx;
-    size_t quota;
-} fc_solve_prelude_item;
+    typedef struct
+    {
+        size_t scan_idx;
+        size_t quota;
+    } fc_solve_prelude_item;
 
-DLLEXPORT extern void fc_solve_user_set_ht_compiled_prelude(
-    void *, size_t, const fc_solve_prelude_item *);
+    DLLEXPORT extern void fc_solve_user_set_ht_compiled_prelude(
+        void *, size_t, const fc_solve_prelude_item *);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/fcs_user_internal.h b/fc-solve/source/fcs_user_internal.h
index 9b85d53ef..6303a71cd 100644
--- a/fc-solve/source/fcs_user_internal.h
+++ b/fc-solve/source/fcs_user_internal.h
@@ -16,33 +16,34 @@
 #include "fcs_dllexport.h"
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #ifdef FCS_COMPILE_DEBUG_FUNCTIONS
-double DLLEXPORT fc_solve_user_INTERNAL_get_befs_weight(
-    void *api_instance, int my_index);
+    double DLLEXPORT fc_solve_user_INTERNAL_get_befs_weight(
+        void *api_instance, int my_index);
 
-int DLLEXPORT fc_solve_user_INTERNAL_compile_all_flares_plans(
-    void *api_instance, char **error_string);
+    int DLLEXPORT fc_solve_user_INTERNAL_compile_all_flares_plans(
+        void *api_instance, char **error_string);
 
-int DLLEXPORT fc_solve_user_INTERNAL_get_flares_plan_num_items(
-    void *api_instance);
+    int DLLEXPORT fc_solve_user_INTERNAL_get_flares_plan_num_items(
+        void *api_instance);
 
-const DLLEXPORT char *fc_solve_user_INTERNAL_get_flares_plan_item_type(
-    void *api_instance, int item_idx);
+    const DLLEXPORT char *fc_solve_user_INTERNAL_get_flares_plan_item_type(
+        void *api_instance, int item_idx);
 
-int DLLEXPORT fc_solve_user_INTERNAL_get_flares_plan_item_flare_idx(
-    void *api_instance, int item_idx);
+    int DLLEXPORT fc_solve_user_INTERNAL_get_flares_plan_item_flare_idx(
+        void *api_instance, int item_idx);
 
-int DLLEXPORT fc_solve_user_INTERNAL_get_flares_plan_item_iters_count(
-    void *api_instance, int item_idx);
+    int DLLEXPORT fc_solve_user_INTERNAL_get_flares_plan_item_iters_count(
+        void *api_instance, int item_idx);
 
-int DLLEXPORT fc_solve_user_INTERNAL_get_num_by_depth_tests_order(
-    void *api_instance);
+    int DLLEXPORT fc_solve_user_INTERNAL_get_num_by_depth_tests_order(
+        void *api_instance);
 
-int DLLEXPORT fc_solve_user_INTERNAL_get_by_depth_tests_max_depth(
-    void *const api_instance, const int depth_idx);
+    int DLLEXPORT fc_solve_user_INTERNAL_get_by_depth_tests_max_depth(
+        void *const api_instance, const int depth_idx);
 
 #endif
 
diff --git a/fc-solve/source/freecell.h b/fc-solve/source/freecell.h
index 27f6f1095..6d67c3752 100644
--- a/fc-solve/source/freecell.h
+++ b/fc-solve/source/freecell.h
@@ -12,28 +12,30 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "instance.h"
 
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_top_stack_cards_to_founds);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_freecell_cards_to_founds);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_freecell_cards_on_top_of_stacks);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_non_top_stack_cards_to_founds);
-DECLARE_MOVE_FUNCTION(
-    fc_solve_sfs_move_stack_cards_to_a_parent_on_the_same_stack);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_stack_cards_to_different_stacks);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_sequences_to_free_stacks);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_freecell_cards_to_empty_stack);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_cards_to_a_different_parent);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_empty_stack_into_freecells);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_atomic_move_card_to_empty_stack);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_atomic_move_card_to_parent);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_atomic_move_card_to_freecell);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_atomic_move_freecell_card_to_parent);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_atomic_move_freecell_card_to_empty_stack);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_fc_to_empty_and_put_on_top);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_top_stack_cards_to_founds);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_freecell_cards_to_founds);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_freecell_cards_on_top_of_stacks);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_non_top_stack_cards_to_founds);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_move_stack_cards_to_a_parent_on_the_same_stack);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_stack_cards_to_different_stacks);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_sequences_to_free_stacks);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_freecell_cards_to_empty_stack);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_cards_to_a_different_parent);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_empty_stack_into_freecells);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_atomic_move_card_to_empty_stack);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_atomic_move_card_to_parent);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_atomic_move_card_to_freecell);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_atomic_move_freecell_card_to_parent);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_atomic_move_freecell_card_to_empty_stack);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_move_fc_to_empty_and_put_on_top);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/game_type_params.h b/fc-solve/source/game_type_params.h
index 2944abeef..49c75b203 100644
--- a/fc-solve/source/game_type_params.h
+++ b/fc-solve/source/game_type_params.h
@@ -16,15 +16,15 @@
 typedef struct
 {
 #endif
-/*
- * The number of Freecells, Stacks and Foundations present in the game.
- *
- * freecells_num and stacks_num are variable and may be specified at
- * the beginning of the execution of the algorithm. However, there
- * is a maximal limit to them which is set in config.h.
- *
- * decks_num can be 1 or 2 .
- * */
+    /*
+     * The number of Freecells, Stacks and Foundations present in the game.
+     *
+     * freecells_num and stacks_num are variable and may be specified at
+     * the beginning of the execution of the algorithm. However, there
+     * is a maximal limit to them which is set in config.h.
+     *
+     * decks_num can be 1 or 2 .
+     * */
 
 #define SET_INSTANCE_GAME_PARAMS(instance) const_SLOT(game_params, instance)
 
@@ -61,17 +61,17 @@ typedef struct
 #define GET_INSTANCE_SEQUENCES_ARE_BUILT_BY(instance)                          \
     FCS_SEQ_BUILT_BY_ALTERNATE_COLOR
 #else
-    /* sequences_are_built_by - (bits 0:1) - what two adjacent cards in the
-     * same sequence can be.
-     *
-     * empty_stacks_fill (bits 2:3) - with what cards can empty stacks be
-     * filled with.
-     *
-     * unlimited_sequence_move - (bit 4) - whether an entire sequence can be
-     * moved from one place to the other regardless of the number of
-     * unoccupied Freecells there are.
-     * */
-    fcs_game_limit_t game_flags;
+/* sequences_are_built_by - (bits 0:1) - what two adjacent cards in the
+ * same sequence can be.
+ *
+ * empty_stacks_fill (bits 2:3) - with what cards can empty stacks be
+ * filled with.
+ *
+ * unlimited_sequence_move - (bit 4) - whether an entire sequence can be
+ * moved from one place to the other regardless of the number of
+ * unoccupied Freecells there are.
+ * */
+fcs_game_limit_t game_flags;
 
 #define INSTANCE_GAME_FLAGS (instance->game_params.game_flags)
 #define GET_INSTANCE_SEQUENCES_ARE_BUILT_BY(instance)                          \
diff --git a/fc-solve/source/gen_ms_boards__hll_iface.h b/fc-solve/source/gen_ms_boards__hll_iface.h
index ebaeb66a0..f8ca0f591 100644
--- a/fc-solve/source/gen_ms_boards__hll_iface.h
+++ b/fc-solve/source/gen_ms_boards__hll_iface.h
@@ -13,21 +13,22 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "gen_ms_boards__rand.h"
 
-typedef struct
-{
-    microsoft_rand_t deal_idx;
-    microsoft_rand_t seedx;
-} fc_solve__hll_ms_rand_t;
+    typedef struct
+    {
+        microsoft_rand_t deal_idx;
+        microsoft_rand_t seedx;
+    } fc_solve__hll_ms_rand_t;
 
-extern fc_solve__hll_ms_rand_t *fc_solve__hll_ms_rand__get_singleton(void);
-extern void fc_solve__hll_ms_rand__init(
-    fc_solve__hll_ms_rand_t *, const char *);
-extern int fc_solve__hll_ms_rand__mod_rand(fc_solve__hll_ms_rand_t *, int);
+    extern fc_solve__hll_ms_rand_t *fc_solve__hll_ms_rand__get_singleton(void);
+    extern void fc_solve__hll_ms_rand__init(
+        fc_solve__hll_ms_rand_t *, const char *);
+    extern int fc_solve__hll_ms_rand__mod_rand(fc_solve__hll_ms_rand_t *, int);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/gen_ms_boards__rand.h b/fc-solve/source/gen_ms_boards__rand.h
index 890588013..ed549def1 100644
--- a/fc-solve/source/gen_ms_boards__rand.h
+++ b/fc-solve/source/gen_ms_boards__rand.h
@@ -13,49 +13,50 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "rinutils.h"
 
-typedef uint32_t microsoft_rand_uint_t;
-
-typedef long long microsoft_rand_t;
+    typedef uint32_t microsoft_rand_uint_t;
 
-static inline microsoft_rand_t microsoft_rand__calc_init_seedx(
-    const microsoft_rand_t deal_idx)
-{
-    return (microsoft_rand_uint_t)(
-        (deal_idx < 0x100000000LL) ? deal_idx : (deal_idx - 0x100000000LL));
-}
+    typedef long long microsoft_rand_t;
 
-static inline microsoft_rand_uint_t microsoft_rand_rand(
-    microsoft_rand_t *const my_rand)
-{
-    *my_rand = ((*my_rand) * 214013 + 2531011);
-    return ((*my_rand) >> 16) & 0x7fff;
-}
+    static inline microsoft_rand_t microsoft_rand__calc_init_seedx(
+        const microsoft_rand_t deal_idx)
+    {
+        return (microsoft_rand_uint_t)(
+            (deal_idx < 0x100000000LL) ? deal_idx : (deal_idx - 0x100000000LL));
+    }
 
-static inline microsoft_rand_uint_t microsoft_rand_randp(
-    microsoft_rand_t *const my_rand)
-{
-    *my_rand = ((*my_rand) * 214013 + 2531011);
-    return ((*my_rand) >> 16) & 0xffff;
-}
+    static inline microsoft_rand_uint_t microsoft_rand_rand(
+        microsoft_rand_t *const my_rand)
+    {
+        *my_rand = ((*my_rand) * 214013 + 2531011);
+        return ((*my_rand) >> 16) & 0x7fff;
+    }
 
-static inline microsoft_rand_uint_t microsoft_rand__game_num_rand(
-    microsoft_rand_t *const seedx_ptr, const long long gnGameNumber)
-{
-    if (gnGameNumber < 0x100000000LL)
+    static inline microsoft_rand_uint_t microsoft_rand_randp(
+        microsoft_rand_t *const my_rand)
     {
-        const microsoft_rand_uint_t ret = microsoft_rand_rand(seedx_ptr);
-        return ((gnGameNumber < 0x80000000) ? ret : (ret | 0x8000));
+        *my_rand = ((*my_rand) * 214013 + 2531011);
+        return ((*my_rand) >> 16) & 0xffff;
     }
-    else
+
+    static inline microsoft_rand_uint_t microsoft_rand__game_num_rand(
+        microsoft_rand_t *const seedx_ptr, const long long gnGameNumber)
     {
-        return microsoft_rand_randp(seedx_ptr) + 1;
+        if (gnGameNumber < 0x100000000LL)
+        {
+            const microsoft_rand_uint_t ret = microsoft_rand_rand(seedx_ptr);
+            return ((gnGameNumber < 0x80000000) ? ret : (ret | 0x8000));
+        }
+        else
+        {
+            return microsoft_rand_randp(seedx_ptr) + 1;
+        }
     }
-}
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/google_hash.h b/fc-solve/source/google_hash.h
index df8e8a74d..1c531bdd7 100644
--- a/fc-solve/source/google_hash.h
+++ b/fc-solve/source/google_hash.h
@@ -13,7 +13,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "config.h"
@@ -21,45 +22,49 @@ extern "C" {
 
 #if (FCS_STATE_STORAGE == FCS_STATE_STORAGE_GOOGLE_DENSE_HASH)
 
-typedef void *fcs_states_google_hash_handle_t;
+    typedef void *fcs_states_google_hash_handle_t;
 
-extern fcs_states_google_hash_handle_t fc_solve_states_google_hash_new(void);
+    extern fcs_states_google_hash_handle_t fc_solve_states_google_hash_new(
+        void);
 
-/*
- * Returns 0 if the key is new and the key/val pair was inserted.
- *      - in that case *existing_key / *existing_val will be set to key
- *      and val respectively.
- * Returns 1 if the key is not new and *existing_key / *existing_val
- * was set to it.
- */
-extern fcs_bool_t fc_solve_states_google_hash_insert(
-    fcs_states_google_hash_handle_t hash, void *key, void **existing_key);
+    /*
+     * Returns 0 if the key is new and the key/val pair was inserted.
+     *      - in that case *existing_key / *existing_val will be set to key
+     *      and val respectively.
+     * Returns 1 if the key is not new and *existing_key / *existing_val
+     * was set to it.
+     */
+    extern fcs_bool_t fc_solve_states_google_hash_insert(
+        fcs_states_google_hash_handle_t hash, void *key, void **existing_key);
 
-void fc_solve_states_google_hash_free(fcs_states_google_hash_handle_t hash);
+    void fc_solve_states_google_hash_free(fcs_states_google_hash_handle_t hash);
 
-extern void fc_solve_states_google_hash_foreach(
-    fcs_states_google_hash_handle_t hash,
-    fcs_bool_t (*should_delete_ptr)(void *key, void *context), void *context);
+    extern void fc_solve_states_google_hash_foreach(
+        fcs_states_google_hash_handle_t hash,
+        fcs_bool_t (*should_delete_ptr)(void *key, void *context),
+        void *context);
 
 #endif
 
 #if (FCS_STACK_STORAGE == FCS_STACK_STORAGE_GOOGLE_DENSE_HASH)
 
-typedef void *fcs_columns_google_hash_handle_t;
+    typedef void *fcs_columns_google_hash_handle_t;
 
-extern fcs_columns_google_hash_handle_t fc_solve_columns_google_hash_new(void);
+    extern fcs_columns_google_hash_handle_t fc_solve_columns_google_hash_new(
+        void);
 
-/*
- * Returns 0 if the key is new and the key/val pair was inserted.
- *      - in that case *existing_key / *existing_val will be set to key
- *      and val respectively.
- * Returns 1 if the key is not new and *existing_key / *existing_val
- * was set to it.
- */
-extern fcs_bool_t fc_solve_columns_google_hash_insert(
-    fcs_columns_google_hash_handle_t hash, void *key, void **existing_key);
+    /*
+     * Returns 0 if the key is new and the key/val pair was inserted.
+     *      - in that case *existing_key / *existing_val will be set to key
+     *      and val respectively.
+     * Returns 1 if the key is not new and *existing_key / *existing_val
+     * was set to it.
+     */
+    extern fcs_bool_t fc_solve_columns_google_hash_insert(
+        fcs_columns_google_hash_handle_t hash, void *key, void **existing_key);
 
-void fc_solve_columns_google_hash_free(fcs_columns_google_hash_handle_t hash);
+    void fc_solve_columns_google_hash_free(
+        fcs_columns_google_hash_handle_t hash);
 
 #endif
 
diff --git a/fc-solve/source/handle_parsing.h b/fc-solve/source/handle_parsing.h
index 48701f3a9..32d81b727 100644
--- a/fc-solve/source/handle_parsing.h
+++ b/fc-solve/source/handle_parsing.h
@@ -12,7 +12,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "rinutils.h"
@@ -22,19 +23,20 @@ extern "C" {
 #include "fcs_user.h"
 #include "fc_solve__precompiled__theme.h"
 #endif
-enum
-{
-    EXIT_AND_RETURN_0 = FCS_CMD_LINE_USER
-};
+    enum
+    {
+        EXIT_AND_RETURN_0 = FCS_CMD_LINE_USER
+    };
 
-static inline void *alloc_instance_and_parse(const int argc, char **const argv,
-    int *const arg_ptr, freecell_solver_str_t *const known_parameters,
-    const freecell_solver_user_cmd_line_known_commands_callback_t callback,
-    void *const callback_context, const fcs_bool_t only_recognized)
-{
-    void *const instance = freecell_solver_user_alloc();
+    static inline void *alloc_instance_and_parse(const int argc,
+        char **const argv, int *const arg_ptr,
+        freecell_solver_str_t *const known_parameters,
+        const freecell_solver_user_cmd_line_known_commands_callback_t callback,
+        void *const callback_context, const fcs_bool_t only_recognized)
+    {
+        void *const instance = freecell_solver_user_alloc();
 #ifdef FCS_USE_PRECOMPILED_CMD_LINE_THEME
-    my_init_instance(instance);
+        my_init_instance(instance);
 #else
     FCS__DECL_ERR_PTR(error_string);
     switch (freecell_solver_user_cmd_line_parse_args_with_file_nesting_count(
@@ -73,24 +75,25 @@ static inline void *alloc_instance_and_parse(const int argc, char **const argv,
         exit(-1);
     }
 #endif
-    return instance;
-}
+        return instance;
+    }
 
-static inline void *simple_alloc_and_parse(
-    const int argc, char **const argv, int arg)
-{
-    return alloc_instance_and_parse(argc, argv, &arg, NULL, NULL, NULL, TRUE);
-}
+    static inline void *simple_alloc_and_parse(
+        const int argc, char **const argv, int arg)
+    {
+        return alloc_instance_and_parse(
+            argc, argv, &arg, NULL, NULL, NULL, TRUE);
+    }
 
-static inline void print_flares_plan_error(void *const instance)
-{
+    static inline void print_flares_plan_error(void *const instance)
+    {
 #ifdef FCS_WITH_ERROR_STRS
-    fprintf(stderr, "Flares Plan: %s\n",
-        freecell_solver_user_get_last_error_string(instance));
+        fprintf(stderr, "Flares Plan: %s\n",
+            freecell_solver_user_get_last_error_string(instance));
 #else
     fprintf(stderr, "%s\n", "Flares Plan Error");
 #endif
-}
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/instance.h b/fc-solve/source/instance.h
index b144c2523..ef2ce7232 100644
--- a/fc-solve/source/instance.h
+++ b/fc-solve/source/instance.h
@@ -12,7 +12,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include <math.h>
@@ -90,10 +91,10 @@ extern "C" {
 
 // We don't keep track of kings
 #define FCS_POS_BY_RANK_LEN (FCS_RANK_KING * FCS_POS_BY_RANK_WIDTH)
-typedef struct
-{
-    char col, height;
-} fcs_pos_by_rank_t;
+    typedef struct
+    {
+        char col, height;
+    } fcs_pos_by_rank_t;
 
 #ifndef FCS_DISABLE_SIMPLE_SIMON
 #define FCS_SS_POS_BY_RANK_WIDTH (FCS_RANK_KING + 1)
@@ -105,41 +106,41 @@ typedef struct
 #define FCS_BOTH__POS_BY_RANK__SIZE FCS_POS_BY_RANK_LEN
 #endif
 
-typedef int8_t fcs__positions_by_rank_t[FCS_BOTH__POS_BY_RANK__SIZE];
+    typedef int8_t fcs__positions_by_rank_t[FCS_BOTH__POS_BY_RANK__SIZE];
 
-/*
- * This is a linked list item that is used to implement a queue for the BFS
- * scan.
- * */
-typedef struct fcs_states_linked_list_item_struct
-{
-    fcs_collectible_state_t *s;
-    struct fcs_states_linked_list_item_struct *next;
-} fcs_states_linked_list_item_t;
+    /*
+     * This is a linked list item that is used to implement a queue for the BFS
+     * scan.
+     * */
+    typedef struct fcs_states_linked_list_item_struct
+    {
+        fcs_collectible_state_t *s;
+        struct fcs_states_linked_list_item_struct *next;
+    } fcs_states_linked_list_item_t;
 
-/*
- * Declare these structures because they will be used within
- * fc_solve_instance, and they will contain a pointer to it.
- * */
-struct fc_solve_hard_thread_struct;
-struct fc_solve_soft_thread_struct;
-struct fc_solve_instance_struct;
+    /*
+     * Declare these structures because they will be used within
+     * fc_solve_instance, and they will contain a pointer to it.
+     * */
+    struct fc_solve_hard_thread_struct;
+    struct fc_solve_soft_thread_struct;
+    struct fc_solve_instance_struct;
 
-typedef void (*fc_solve_solve_for_state_move_func_t)(
-    struct fc_solve_soft_thread_struct *, fcs_kv_state_t,
-    fcs_derived_states_list_t *);
+    typedef void (*fc_solve_solve_for_state_move_func_t)(
+        struct fc_solve_soft_thread_struct *, fcs_kv_state_t,
+        fcs_derived_states_list_t *);
 
 #ifdef FCS_SINGLE_HARD_THREAD
-typedef struct fc_solve_instance_struct fc_solve_hard_thread_t;
+    typedef struct fc_solve_instance_struct fc_solve_hard_thread_t;
 #else
 typedef struct fc_solve_hard_thread_struct fc_solve_hard_thread_t;
 #endif
 
-extern fcs_bool_t fc_solve_check_and_add_state(
-    fc_solve_hard_thread_t *, fcs_kv_state_t *, fcs_kv_state_t *);
+    extern fcs_bool_t fc_solve_check_and_add_state(
+        fc_solve_hard_thread_t *, fcs_kv_state_t *, fcs_kv_state_t *);
 
 #if (FCS_STATE_STORAGE == FCS_STATE_STORAGE_GLIB_HASH)
-extern guint fc_solve_hash_function(gconstpointer key);
+    extern guint fc_solve_hash_function(gconstpointer key);
 #endif
 #include "move_funcs_maps.h"
 
@@ -166,53 +167,54 @@ extern guint fc_solve_hash_function(gconstpointer key);
     for (; soft_thread < end_soft_thread; ++soft_thread)
 #define MOVES_GROW_BY 16
 
-typedef struct
-{
-    double weights[FCS_NUM_BEFS_WEIGHTS];
-} fcs_default_weights_t;
-typedef struct
-{
-    fcs_bool_t should_go_over_stacks;
-    double max_sequence_move_factor, cards_under_sequences_factor,
-        seqs_over_renegade_cards_factor, depth_factor,
-        num_cards_not_on_parents_factor;
-
-    double num_cards_out_lookup_table[14];
-    // The BeFS weights of the different BeFS tests. Those
-    // weights determine the commulative priority of the state.
-    fcs_default_weights_t befs_weights;
-} fc_solve_state_weighting_t;
-
-typedef enum {
-    FCS_NO_SHUFFLING,
-    FCS_RAND,
-    FCS_WEIGHTING,
-} fcs_moves_group_kind;
-
-typedef union {
-    fc_solve_solve_for_state_move_func_t f;
-    uint_fast32_t idx;
-} fcs_move_func;
-
-typedef struct
-{
-    fcs_move_func *move_funcs;
-    uint_fast32_t num;
-    fcs_moves_group_kind shuffling_type;
-    fc_solve_state_weighting_t weighting;
-} fcs_moves_group;
+    typedef struct
+    {
+        double weights[FCS_NUM_BEFS_WEIGHTS];
+    } fcs_default_weights_t;
+    typedef struct
+    {
+        fcs_bool_t should_go_over_stacks;
+        double max_sequence_move_factor, cards_under_sequences_factor,
+            seqs_over_renegade_cards_factor, depth_factor,
+            num_cards_not_on_parents_factor;
+
+        double num_cards_out_lookup_table[14];
+        // The BeFS weights of the different BeFS tests. Those
+        // weights determine the commulative priority of the state.
+        fcs_default_weights_t befs_weights;
+    } fc_solve_state_weighting_t;
+
+    typedef enum
+    {
+        FCS_NO_SHUFFLING,
+        FCS_RAND,
+        FCS_WEIGHTING,
+    } fcs_moves_group_kind;
 
-typedef struct
-{
-    uint_fast32_t num;
-    fcs_moves_group *groups;
-} fcs_moves_order;
+    typedef union {
+        fc_solve_solve_for_state_move_func_t f;
+        uint_fast32_t idx;
+    } fcs_move_func;
 
-typedef struct
-{
-    ssize_t max_depth;
-    fcs_moves_order moves_order;
-} fcs_by_depth_moves_order;
+    typedef struct
+    {
+        fcs_move_func *move_funcs;
+        uint_fast32_t num;
+        fcs_moves_group_kind shuffling_type;
+        fc_solve_state_weighting_t weighting;
+    } fcs_moves_group;
+
+    typedef struct
+    {
+        uint_fast32_t num;
+        fcs_moves_group *groups;
+    } fcs_moves_order;
+
+    typedef struct
+    {
+        ssize_t max_depth;
+        fcs_moves_order moves_order;
+    } fcs_by_depth_moves_order;
 
 #define STRUCT_CLEAR_FLAG(instance, flag) (instance)->flag = FALSE
 #define STRUCT_TURN_ON_FLAG(instance, flag) (instance)->flag = TRUE
@@ -220,360 +222,361 @@ typedef struct
 #define STRUCT_SET_FLAG_TO(instance, flag, value) (instance)->flag = (value)
 
 #ifdef FCS_RCS_STATES
-struct fcs_cache_key_info_struct
-{
-    const fcs_collectible_state_t *val_ptr;
-    fcs_state_t key;
-    /* lower_pri and higher_pri form a doubly linked list.
-     *
-     * pri == priority.
-     * */
-    struct fcs_cache_key_info_struct *lower_pri, *higher_pri;
-};
-
-typedef struct fcs_cache_key_info_struct fcs_cache_key_info_t;
-
-typedef struct
-{
+    struct fcs_cache_key_info_struct
+    {
+        const fcs_collectible_state_t *val_ptr;
+        fcs_state_t key;
+        /* lower_pri and higher_pri form a doubly linked list.
+         *
+         * pri == priority.
+         * */
+        struct fcs_cache_key_info_struct *lower_pri, *higher_pri;
+    };
+
+    typedef struct fcs_cache_key_info_struct fcs_cache_key_info_t;
+
+    typedef struct
+    {
 #if (FCS_RCS_CACHE_STORAGE == FCS_RCS_CACHE_STORAGE_JUDY)
-    Pvoid_t states_values_to_keys_map;
+        Pvoid_t states_values_to_keys_map;
 #elif (FCS_RCS_CACHE_STORAGE == FCS_RCS_CACHE_STORAGE_KAZ_TREE)
-    dict_t *kaz_tree;
+        dict_t *kaz_tree;
 #else
 #error Unknown FCS_RCS_CACHE_STORAGE
 #endif
-    fcs_compact_allocator_t states_values_to_keys_allocator;
-    fcs_int_limit_t count_elements_in_cache, max_num_elements_in_cache;
+        fcs_compact_allocator_t states_values_to_keys_allocator;
+        fcs_int_limit_t count_elements_in_cache, max_num_elements_in_cache;
 
-    fcs_cache_key_info_t *lowest_pri, *highest_pri, *recycle_bin;
-} fcs_lru_cache_t;
+        fcs_cache_key_info_t *lowest_pri, *highest_pri, *recycle_bin;
+    } fcs_lru_cache_t;
 
 #endif
 
 #ifndef FCS_WITHOUT_ITER_HANDLER
-typedef void *fcs_instance_debug_iter_output_context_t;
+    typedef void *fcs_instance_debug_iter_output_context_t;
 
-typedef void (*fcs_instance_debug_iter_output_func_t)(
-    fcs_instance_debug_iter_output_context_t, fcs_int_limit_t, int, void *,
-    fcs_kv_state_t *, fcs_int_limit_t);
+    typedef void (*fcs_instance_debug_iter_output_func_t)(
+        fcs_instance_debug_iter_output_context_t, fcs_int_limit_t, int, void *,
+        fcs_kv_state_t *, fcs_int_limit_t);
 #endif
 
-typedef struct fc_solve_soft_thread_struct fc_solve_soft_thread_t;
-typedef struct fc_solve_instance_struct fc_solve_instance_t;
+    typedef struct fc_solve_soft_thread_struct fc_solve_soft_thread_t;
+    typedef struct fc_solve_instance_struct fc_solve_instance_t;
 
-struct fc_solve_hard_thread_struct
-{
+    struct fc_solve_hard_thread_struct
+    {
 #ifndef FCS_SINGLE_HARD_THREAD
-    fc_solve_instance_t *instance;
+        fc_solve_instance_t *instance;
 #endif
 
-    struct fc_solve_soft_thread_struct *soft_threads;
+        struct fc_solve_soft_thread_struct *soft_threads;
 
 #ifndef FCS_SINGLE_HARD_THREAD
-    /*
-     * The hard thread count of how many states he checked himself. The
-     * instance num_checked_states can be confusing because other threads
-     * modify it too.
-     *
-     * Thus, the soft thread switching should be done based on this variable
-     * */
-    fcs_int_limit_t ht__num_checked_states;
-
-#endif
-    /*
-     * The maximal limit for num_checked_states.
-     * */
-    fcs_int_limit_t ht__max_num_checked_states;
-
-    /*
-     * The index for the soft-thread that is currently processed
-     * */
-    int_fast32_t st_idx;
-    /*
-     * This is the mechanism used to allocate memory for stacks, states
-     * and move stacks.
-     * */
-    fcs_compact_allocator_t allocator;
+        /*
+         * The hard thread count of how many states he checked himself. The
+         * instance num_checked_states can be confusing because other threads
+         * modify it too.
+         *
+         * Thus, the soft thread switching should be done based on this variable
+         * */
+        fcs_int_limit_t ht__num_checked_states;
+
+#endif
+        /*
+         * The maximal limit for num_checked_states.
+         * */
+        fcs_int_limit_t ht__max_num_checked_states;
+
+        /*
+         * The index for the soft-thread that is currently processed
+         * */
+        int_fast32_t st_idx;
+        /*
+         * This is the mechanism used to allocate memory for stacks, states
+         * and move stacks.
+         * */
+        fcs_compact_allocator_t allocator;
 
 #ifdef FCS_WITH_MOVES
-    /*
-     * This is a move stack that is used and re-used by the
-     * moves functions of this hard thread
-     * */
-    fcs_move_stack_t reusable_move_stack;
+        /*
+         * This is a move stack that is used and re-used by the
+         * moves functions of this hard thread
+         * */
+        fcs_move_stack_t reusable_move_stack;
 #endif
 
-    /*
-     * This is a buffer used to temporarily store the stacks of the
-     * duplicated state.
-     * */
-    DECLARE_IND_BUF_T(indirect_stacks_buffer)
+        /*
+         * This is a buffer used to temporarily store the stacks of the
+         * duplicated state.
+         * */
+        DECLARE_IND_BUF_T(indirect_stacks_buffer)
 
-    size_t prelude_num_items;
-    size_t prelude_idx;
+        size_t prelude_num_items;
+        size_t prelude_idx;
 #ifndef FCS_USE_PRECOMPILED_CMD_LINE_THEME
-    fc_solve_prelude_item *prelude;
+        fc_solve_prelude_item *prelude;
 #else
     const fc_solve_prelude_item *prelude;
 #endif
 
-    fcs_bool_t allocated_from_list;
-    int_fast32_t num_soft_threads;
+        fcs_bool_t allocated_from_list;
+        int_fast32_t num_soft_threads;
 
-    /*
-     * A counter that determines how many of the soft threads that belong
-     * to this hard thread have already finished. If it becomes
-     * num_soft_threads this thread is skipped.
-     * */
-    int num_soft_threads_finished;
+        /*
+         * A counter that determines how many of the soft threads that belong
+         * to this hard thread have already finished. If it becomes
+         * num_soft_threads this thread is skipped.
+         * */
+        int num_soft_threads_finished;
 
 #ifndef FCS_USE_PRECOMPILED_CMD_LINE_THEME
-    char *prelude_as_string;
+        char *prelude_as_string;
 #endif
-};
+    };
 
-/********************************************/
+    /********************************************/
 
-typedef struct
-{
-    int idx;
-    pq_rating_t rating;
-} fcs_rating_with_index_t;
+    typedef struct
+    {
+        int idx;
+        pq_rating_t rating;
+    } fcs_rating_with_index_t;
 
-typedef struct
-{
-    fcs_collectible_state_t *state;
-    fcs_derived_states_list_t derived_states_list;
-    size_t move_func_list_idx;
-    size_t current_state_index;
-    size_t move_func_idx;
-    size_t derived_states_random_indexes_max_size;
-    fcs_rating_with_index_t *derived_states_random_indexes;
-    fcs__positions_by_rank_t positions_by_rank;
-    fcs_game_limit_t num_vacant_stacks;
-    fcs_game_limit_t num_vacant_freecells;
-} fcs_soft_dfs_stack_item_t;
-
-typedef struct
-{
-    ssize_t max_depth;
-    fcs_moves_order move_funcs;
-} fcs_moves_by_depth_unit_t;
+    typedef struct
+    {
+        fcs_collectible_state_t *state;
+        fcs_derived_states_list_t derived_states_list;
+        size_t move_func_list_idx;
+        size_t current_state_index;
+        size_t move_func_idx;
+        size_t derived_states_random_indexes_max_size;
+        fcs_rating_with_index_t *derived_states_random_indexes;
+        fcs__positions_by_rank_t positions_by_rank;
+        fcs_game_limit_t num_vacant_stacks;
+        fcs_game_limit_t num_vacant_freecells;
+    } fcs_soft_dfs_stack_item_t;
+
+    typedef struct
+    {
+        ssize_t max_depth;
+        fcs_moves_order move_funcs;
+    } fcs_moves_by_depth_unit_t;
 
-typedef struct
-{
-    size_t num_units;
-    fcs_moves_by_depth_unit_t *by_depth_units;
-} fcs_moves_by_depth_array;
+    typedef struct
+    {
+        size_t num_units;
+        fcs_moves_by_depth_unit_t *by_depth_units;
+    } fcs_moves_by_depth_array;
 
-typedef enum {
-    FCS_SUPER_METHOD_DFS,
-    FCS_SUPER_METHOD_BEFS_BRFS,
+    typedef enum
+    {
+        FCS_SUPER_METHOD_DFS,
+        FCS_SUPER_METHOD_BEFS_BRFS,
 #ifndef FCS_DISABLE_PATSOLVE
-    FCS_SUPER_METHOD_PATSOLVE,
+        FCS_SUPER_METHOD_PATSOLVE,
 #endif
-} fcs_super_method_type_t;
-
-struct fc_solve__patsolve_thread_struct;
-struct fc_solve_soft_thread_struct
-{
-    fc_solve_hard_thread_t *hard_thread;
+    } fcs_super_method_type_t;
 
-    /*
-     * The ID of the soft thread inside the instance.
-     * Used for the state-specific flags.
-     * */
-    int id;
-
-    // The moves' order indicates which move funcs to run.
-    struct
+    struct fc_solve__patsolve_thread_struct;
+    struct fc_solve_soft_thread_struct
     {
-        size_t num;
-        fcs_by_depth_moves_order *by_depth_moves;
-    } by_depth_moves_order;
+        fc_solve_hard_thread_t *hard_thread;
 
-    /* The super-method type - can be  */
-    fcs_super_method_type_t super_method_type;
+        /*
+         * The ID of the soft thread inside the instance.
+         * Used for the state-specific flags.
+         * */
+        int id;
 
-    struct
-    {
+        // The moves' order indicates which move funcs to run.
         struct
         {
-            /*
-             * The (temporary) max depth of the Soft-DFS scans)
-             * */
-            ssize_t dfs_max_depth;
-
-            /*
-             * Soft-DFS uses a stack of fcs_soft_dfs_stack_item_t s.
-             *
-             * derived_states_list - a list of states to be checked next.
-             * Not all of them will be checked because it is possible that
-             * future states already visited them.
-             *
-             * current_state_index - the index of the last checked state
-             * in depth i.
-             *
-             * move_func_list_idx - the index of the move list that is
-             * performed. FCS performs each move separately, so
-             * states_to_check and friends will not be overpopulated.
-             *
-             * num_vacant_stacks - the number of unoccpied stacks that
-             * correspond
-             * to solution_states.
-             *
-             * num_vacant_freecells - ditto for the freecells.
-             *
-             * */
-            fcs_soft_dfs_stack_item_t *soft_dfs_info;
-
-            /* The depth of the DFS stacks */
-            ssize_t depth;
-
-            /*
-             * A pseudo-random number generator for use in the random-DFS
-             * scan
-             * */
-            fcs_rand_t rand_gen;
-
-            /*
-             * The initial seed of this random number generator
-             * */
-            int rand_seed;
-
-            /*
-             * The moves to be performed in a preprocessed form.
-             * */
-            fcs_moves_by_depth_array moves_by_depth;
-        } soft_dfs;
+            size_t num;
+            fcs_by_depth_moves_order *by_depth_moves;
+        } by_depth_moves_order;
+
+        /* The super-method type - can be  */
+        fcs_super_method_type_t super_method_type;
+
         struct
         {
-            fcs__positions_by_rank_t befs_positions_by_rank;
-            fcs_move_func *moves_list, *moves_list_end;
             struct
             {
+                /*
+                 * The (temporary) max depth of the Soft-DFS scans)
+                 * */
+                ssize_t dfs_max_depth;
+
+                /*
+                 * Soft-DFS uses a stack of fcs_soft_dfs_stack_item_t s.
+                 *
+                 * derived_states_list - a list of states to be checked next.
+                 * Not all of them will be checked because it is possible that
+                 * future states already visited them.
+                 *
+                 * current_state_index - the index of the last checked state
+                 * in depth i.
+                 *
+                 * move_func_list_idx - the index of the move list that is
+                 * performed. FCS performs each move separately, so
+                 * states_to_check and friends will not be overpopulated.
+                 *
+                 * num_vacant_stacks - the number of unoccpied stacks that
+                 * correspond
+                 * to solution_states.
+                 *
+                 * num_vacant_freecells - ditto for the freecells.
+                 *
+                 * */
+                fcs_soft_dfs_stack_item_t *soft_dfs_info;
+
+                /* The depth of the DFS stacks */
+                ssize_t depth;
+
+                /*
+                 * A pseudo-random number generator for use in the random-DFS
+                 * scan
+                 * */
+                fcs_rand_t rand_gen;
+
+                /*
+                 * The initial seed of this random number generator
+                 * */
+                int rand_seed;
+
+                /*
+                 * The moves to be performed in a preprocessed form.
+                 * */
+                fcs_moves_by_depth_array moves_by_depth;
+            } soft_dfs;
+            struct
+            {
+                fcs__positions_by_rank_t befs_positions_by_rank;
+                fcs_move_func *moves_list, *moves_list_end;
                 struct
                 {
-                    /*
-                     * A linked list that serves as the queue for the BFS
-                     * scan.
-                     * */
-                    fcs_states_linked_list_item_t *bfs_queue;
-                    /*
-                     * The last item in the linked list, so new items can be
-                     * added at
-                     * it, thus making it a queue.
-                     * */
-                    fcs_states_linked_list_item_t *bfs_queue_last_item;
-                    /*
-                     * A linked list of items that were freed from
-                     * the queue and should be reused before allocating new
-                     * items.
-                     * */
-                    fcs_states_linked_list_item_t *recycle_bin;
-                } brfs;
-                struct
-                {
-                    /*
-                     * The priority queue of the BeFS scan
-                     * */
-                    pri_queue_t pqueue;
-                    fc_solve_state_weighting_t weighting;
-                } befs;
-            } meth;
-            /*
-             * The first state to be checked by the scan. It is a kind of
-             * bootstrap for the algorithm.
-             * */
-            fcs_collectible_state_t *first_state_to_check;
-        } befs;
-    } method_specific;
-
-    fcs_bool_t FCS_SOFT_THREAD_IS_FINISHED, FCS_SOFT_THREAD_INITIALIZED,
-        FCS_SOFT_THREAD_IS_A_COMPLETE_SCAN;
-
-    // The numbers of vacant stacks and freecells in the current state - is
-    // read by the move functions in freecell.c .
-    fcs_game_limit_t num_vacant_stacks, num_vacant_freecells;
-
-    /*
-     * The number of iterations with which to process this scan
-     * */
-    fcs_int_limit_t checked_states_step;
+                    struct
+                    {
+                        /*
+                         * A linked list that serves as the queue for the BFS
+                         * scan.
+                         * */
+                        fcs_states_linked_list_item_t *bfs_queue;
+                        /*
+                         * The last item in the linked list, so new items can be
+                         * added at
+                         * it, thus making it a queue.
+                         * */
+                        fcs_states_linked_list_item_t *bfs_queue_last_item;
+                        /*
+                         * A linked list of items that were freed from
+                         * the queue and should be reused before allocating new
+                         * items.
+                         * */
+                        fcs_states_linked_list_item_t *recycle_bin;
+                    } brfs;
+                    struct
+                    {
+                        /*
+                         * The priority queue of the BeFS scan
+                         * */
+                        pri_queue_t pqueue;
+                        fc_solve_state_weighting_t weighting;
+                    } befs;
+                } meth;
+                /*
+                 * The first state to be checked by the scan. It is a kind of
+                 * bootstrap for the algorithm.
+                 * */
+                fcs_collectible_state_t *first_state_to_check;
+            } befs;
+        } method_specific;
+
+        fcs_bool_t FCS_SOFT_THREAD_IS_FINISHED, FCS_SOFT_THREAD_INITIALIZED,
+            FCS_SOFT_THREAD_IS_A_COMPLETE_SCAN;
+
+        // The numbers of vacant stacks and freecells in the current state - is
+        // read by the move functions in freecell.c .
+        fcs_game_limit_t num_vacant_stacks, num_vacant_freecells;
+
+        /*
+         * The number of iterations with which to process this scan
+         * */
+        fcs_int_limit_t checked_states_step;
 
 #ifndef FCS_USE_PRECOMPILED_CMD_LINE_THEME
-    // A string that serves as an identification for the user.
-    char name[FCS_MAX_IDENT_LEN];
+        // A string that serves as an identification for the user.
+        char name[FCS_MAX_IDENT_LEN];
 #endif
 
 #ifndef FCS_ENABLE_PRUNE__R_TF__UNCOND
-    /*
-     * Whether pruning should be done.
-     * This variable is temporary - there should be a better pruning
-     * abstraction with several optional prunes.
-     * */
-    fcs_bool_t enable_pruning;
+        /*
+         * Whether pruning should be done.
+         * This variable is temporary - there should be a better pruning
+         * abstraction with several optional prunes.
+         * */
+        fcs_bool_t enable_pruning;
 #endif
 
 #ifndef FCS_DISABLE_PATSOLVE
-    /*
-     * The patsolve soft_thread that is associated with this soft_thread.
-     * */
-    struct fc_solve__patsolve_thread_struct *pats_scan;
-#endif
-    /*
-     * Differentiates between SOFT_DFS and RANDOM_DFS.
-     * */
-    fcs_bool_t master_to_randomize;
-    fcs_bool_t is_befs
+        /*
+         * The patsolve soft_thread that is associated with this soft_thread.
+         * */
+        struct fc_solve__patsolve_thread_struct *pats_scan;
+#endif
+        /*
+         * Differentiates between SOFT_DFS and RANDOM_DFS.
+         * */
+        fcs_bool_t master_to_randomize;
+        fcs_bool_t is_befs
 #ifdef FCS_WITH_MOVES
-        ,
-        is_optimize_scan
+            ,
+            is_optimize_scan
 #endif
-        ;
-};
+            ;
+    };
 
-struct fc_solve_instance_struct
-{
+    struct fc_solve_instance_struct
+    {
 // The parameters of the game - see the declaration of fcs_game_type_params_t .
 #ifndef FCS_FREECELL_ONLY
-    fcs_game_type_params_t game_params;
+        fcs_game_type_params_t game_params;
 #ifndef FCS_DISABLE_PATSOLVE
-    fcs_card_t game_variant_suit_mask;
-    fcs_card_t game_variant_desired_suit_value;
+        fcs_card_t game_variant_suit_mask;
+        fcs_card_t game_variant_desired_suit_value;
 #endif
 #endif
 
-    /* The number of states that were checked by the solving algorithm. */
-    fcs_int_limit_t i__num_checked_states;
+        /* The number of states that were checked by the solving algorithm. */
+        fcs_int_limit_t i__num_checked_states;
 
 #ifndef FCS_WITHOUT_MAX_NUM_STATES
-    /*
-     * Limit for the maximal number of checked states.
-     * max_num_checked_states is useful because it can limit the amount of
-     * consumed memory (and time).
-     *
-     * This is the effective number that enables the process to work without
-     * checking if it's zero.
-     *
-     * Normally should be used instead.
-     * */
-    fcs_int_limit_t effective_max_num_checked_states;
+        /*
+         * Limit for the maximal number of checked states.
+         * max_num_checked_states is useful because it can limit the amount of
+         * consumed memory (and time).
+         *
+         * This is the effective number that enables the process to work without
+         * checking if it's zero.
+         *
+         * Normally should be used instead.
+         * */
+        fcs_int_limit_t effective_max_num_checked_states;
 #endif
 #ifndef FCS_DISABLE_NUM_STORED_STATES
-    fcs_int_limit_t effective_max_num_states_in_collection;
+        fcs_int_limit_t effective_max_num_states_in_collection;
 #ifndef FCS_WITHOUT_TRIM_MAX_STORED_STATES
-    fcs_int_limit_t effective_trim_states_in_collection_from;
+        fcs_int_limit_t effective_trim_states_in_collection_from;
 #endif
 #endif
-    fc_solve_seq_cards_power_type_t initial_cards_under_sequences_value;
+        fc_solve_seq_cards_power_type_t initial_cards_under_sequences_value;
 /*
  * tree is the balanced binary tree that is used to store and index
  * the checked states.
  *
  * */
 #if (FCS_STATE_STORAGE == FCS_STATE_STORAGE_LIBREDBLACK_TREE)
-    struct rbtree *tree;
+        struct rbtree *tree;
 #elif (FCS_STATE_STORAGE == FCS_STATE_STORAGE_JUDY)
     Pvoid_t judy_array;
 #elif (FCS_STATE_STORAGE == FCS_STATE_STORAGE_LIBAVL2_TREE)
@@ -589,7 +592,7 @@ struct fc_solve_instance_struct
  * states of the scan.
  * */
 #if (FCS_STATE_STORAGE == FCS_STATE_STORAGE_GLIB_HASH)
-    GHashTable *hash;
+        GHashTable *hash;
 #elif (FCS_STATE_STORAGE == FCS_STATE_STORAGE_INTERNAL_HASH)
     fc_solve_hash_t hash;
 #elif (FCS_STATE_STORAGE == FCS_STATE_STORAGE_GOOGLE_DENSE_HASH)
@@ -602,49 +605,50 @@ struct fc_solve_instance_struct
  * used.
  * */
 #if (FCS_STACK_STORAGE == FCS_STACK_STORAGE_INTERNAL_HASH)
-    fc_solve_hash_t stacks_hash;
+        fc_solve_hash_t stacks_hash;
 #elif (FCS_STACK_STORAGE == FCS_STACK_STORAGE_LIBAVL2_TREE)
-    fcs_libavl2_stacks_tree_table_t *stacks_tree;
+        fcs_libavl2_stacks_tree_table_t *stacks_tree;
 #elif (FCS_STACK_STORAGE == FCS_STACK_STORAGE_LIBREDBLACK_TREE)
-    struct rbtree *stacks_tree;
+        struct rbtree *stacks_tree;
 #elif (FCS_STACK_STORAGE == FCS_STACK_STORAGE_GLIB_TREE)
-    GTree *stacks_tree;
+        GTree *stacks_tree;
 #elif (FCS_STACK_STORAGE == FCS_STACK_STORAGE_GLIB_HASH)
-    GHashTable *stacks_hash;
+        GHashTable *stacks_hash;
 #elif (FCS_STACK_STORAGE == FCS_STACK_STORAGE_GOOGLE_DENSE_HASH)
-    fcs_columns_google_hash_handle_t stacks_hash;
+        fcs_columns_google_hash_handle_t stacks_hash;
 #elif (FCS_STACK_STORAGE == FCS_STACK_STORAGE_JUDY)
-    Pvoid_t stacks_judy_array;
+        Pvoid_t stacks_judy_array;
 #else
 #error FCS_STACK_STORAGE is not set to a good value.
 #endif
 #endif
 
-    fcs_collectible_state_t *list_of_vacant_states;
+        fcs_collectible_state_t *list_of_vacant_states;
 /*
  * Storing using Berkeley DB is not operational for some reason so
  * pay no attention to it for the while
  * */
 #if (FCS_STATE_STORAGE == FCS_STATE_STORAGE_DB_FILE)
-    DB *db;
+        DB *db;
 #endif
 
 #ifndef FCS_HARD_CODE_CALC_REAL_DEPTH_AS_FALSE
-    fcs_bool_t FCS_RUNTIME_CALC_REAL_DEPTH;
+        fcs_bool_t FCS_RUNTIME_CALC_REAL_DEPTH;
 #endif
 #ifndef FCS_HARD_CODE_REPARENT_STATES_AS_FALSE
-    fcs_bool_t FCS_RUNTIME_TO_REPARENT_STATES_REAL;
+        fcs_bool_t FCS_RUNTIME_TO_REPARENT_STATES_REAL;
 #endif
 #ifndef FCS_HARD_CODE_SCANS_SYNERGY_AS_TRUE
-    fcs_bool_t FCS_RUNTIME_SCANS_SYNERGY;
+        fcs_bool_t FCS_RUNTIME_SCANS_SYNERGY;
 #endif
 #ifndef FCS_HARD_CODE_REPARENT_STATES_AS_FALSE
-    fcs_bool_t FCS_RUNTIME_TO_REPARENT_STATES_PROTO;
+        fcs_bool_t FCS_RUNTIME_TO_REPARENT_STATES_PROTO;
 #endif
-    ;
+        ;
 #ifdef FCS_WITH_MOVES
-    fcs_bool_t FCS_RUNTIME_OPTIMIZE_SOLUTION_PATH,
-        FCS_RUNTIME_IN_OPTIMIZATION_THREAD, FCS_RUNTIME_OPT_TESTS_ORDER_WAS_SET;
+        fcs_bool_t FCS_RUNTIME_OPTIMIZE_SOLUTION_PATH,
+            FCS_RUNTIME_IN_OPTIMIZATION_THREAD,
+            FCS_RUNTIME_OPT_TESTS_ORDER_WAS_SET;
 #endif
 
 /*
@@ -654,16 +658,16 @@ struct fc_solve_instance_struct
  * */
 #ifndef FCS_DISABLE_NUM_STORED_STATES
 #ifndef FCS_WITHOUT_TRIM_MAX_STORED_STATES
-    fcs_int_limit_t active_num_states_in_collection;
+        fcs_int_limit_t active_num_states_in_collection;
 #endif
-    fcs_int_limit_t num_states_in_collection;
+        fcs_int_limit_t num_states_in_collection;
 #endif
 
 #ifdef FCS_SINGLE_HARD_THREAD
-    struct fc_solve_hard_thread_struct hard_thread;
+        struct fc_solve_hard_thread_struct hard_thread;
 #ifdef FCS_WITH_MOVES
-    fcs_bool_t is_optimization_st;
-    struct fc_solve_soft_thread_struct optimization_soft_thread;
+        fcs_bool_t is_optimization_st;
+        struct fc_solve_soft_thread_struct optimization_soft_thread;
 #endif
 #else
     uint_fast32_t num_hard_threads;
@@ -681,105 +685,105 @@ struct fc_solve_instance_struct
 #endif
 #endif
 
-    // The master moves' order. It is used to initialize all the new
-    // Soft-Threads.
-    fcs_moves_order instance_moves_order;
+        // The master moves' order. It is used to initialize all the new
+        // Soft-Threads.
+        fcs_moves_order instance_moves_order;
 
-    /*
-     * A counter that determines how many of the hard threads that belong
-     * to this hard thread have already finished. If it becomes
-     * num_hard_threads the instance terminates.
-     * */
-    int num_hard_threads_finished;
+        /*
+         * A counter that determines how many of the hard threads that belong
+         * to this hard thread have already finished. If it becomes
+         * num_hard_threads the instance terminates.
+         * */
+        int num_hard_threads_finished;
 
 #ifdef FCS_WITH_MOVES
-    // The moves for the optimization scan, as specified by the user.
-    fcs_moves_order opt_moves;
+        // The moves for the optimization scan, as specified by the user.
+        fcs_moves_order opt_moves;
 #endif
 
 #ifdef FCS_RCS_STATES
-    fcs_lru_cache_t rcs_states_cache;
+        fcs_lru_cache_t rcs_states_cache;
 
 #if ((FCS_STATE_STORAGE == FCS_STATE_STORAGE_LIBAVL2_TREE) ||                  \
      (FCS_STATE_STORAGE == FCS_STATE_STORAGE_KAZ_TREE))
-    fcs_state_t *tree_new_state_key;
-    fcs_collectible_state_t *tree_new_state;
+        fcs_state_t *tree_new_state_key;
+        fcs_collectible_state_t *tree_new_state;
 #endif
 
 #endif
 
 #ifndef FCS_WITHOUT_ITER_HANDLER
-    /*
-     * The debug_iter_output variables provide a programmer programmable way
-     * to debug the algorithm while it is running. This works well for DFS
-     * and Soft-DFS scans but at present support for BeFS and BFS is not
-     * too good, as its hard to tell which state came from which parent
-     * state.
-     *
-     * debug_iter_output_func is a pointer to the function that performs the
-     * debugging. If NULL, this feature is not used.
-     *
-     * debug_iter_output_context is a user-specified context for it, that
-     * may include data that is not included in the instance structure.
-     *
-     * This feature is used by the "-s" and "-i" flags of fc-solve-debug.
-     * */
-    fcs_instance_debug_iter_output_func_t debug_iter_output_func;
-    fcs_instance_debug_iter_output_context_t debug_iter_output_context;
-#endif
-
-    /*
-     * The next ID to allocate for a soft-thread.
-     * */
-    int next_soft_thread_id;
-
-    /* This is the initial state */
-    fcs_state_keyval_pair_t state_copy;
+        /*
+         * The debug_iter_output variables provide a programmer programmable way
+         * to debug the algorithm while it is running. This works well for DFS
+         * and Soft-DFS scans but at present support for BeFS and BFS is not
+         * too good, as its hard to tell which state came from which parent
+         * state.
+         *
+         * debug_iter_output_func is a pointer to the function that performs the
+         * debugging. If NULL, this feature is not used.
+         *
+         * debug_iter_output_context is a user-specified context for it, that
+         * may include data that is not included in the instance structure.
+         *
+         * This feature is used by the "-s" and "-i" flags of fc-solve-debug.
+         * */
+        fcs_instance_debug_iter_output_func_t debug_iter_output_func;
+        fcs_instance_debug_iter_output_context_t debug_iter_output_context;
+#endif
+
+        /*
+         * The next ID to allocate for a soft-thread.
+         * */
+        int next_soft_thread_id;
+
+        /* This is the initial state */
+        fcs_state_keyval_pair_t state_copy;
 
 #ifdef FCS_WITH_MOVES
-    /* This is the final state that the scan recommends to the
-     * interface
-     * */
-    fcs_collectible_state_t *final_state;
+        /* This is the final state that the scan recommends to the
+         * interface
+         * */
+        fcs_collectible_state_t *final_state;
 
-    /*
-     * A move stack that contains the moves leading to the solution.
-     *
-     * It is created only after the solution was found by swallowing
-     * all the stacks of each depth.
-     * */
-    fcs_move_stack_t solution_moves;
+        /*
+         * A move stack that contains the moves leading to the solution.
+         *
+         * It is created only after the solution was found by swallowing
+         * all the stacks of each depth.
+         * */
+        fcs_move_stack_t solution_moves;
 #endif
 
-    /*
-     * The meta allocator - see meta_alloc.h.
-     * */
-    fcs_meta_compact_allocator_t *meta_alloc;
+        /*
+         * The meta allocator - see meta_alloc.h.
+         * */
+        fcs_meta_compact_allocator_t *meta_alloc;
 
 #if (defined(FCS_WITH_MOVES) && (!defined(FCS_DISABLE_PATSOLVE)))
-    /*
-     * The soft_thread that solved the state.
-     *
-     * Needed to trace the patsolve solutions.
-     * */
-    fc_solve_soft_thread_t *solving_soft_thread;
+        /*
+         * The soft_thread that solved the state.
+         *
+         * Needed to trace the patsolve solutions.
+         * */
+        fc_solve_soft_thread_t *solving_soft_thread;
 #endif
 #ifndef FCS_DISABLE_PATSOLVE
-    /*
-     * This is intended to be used by the patsolve scan which is
-     * sensitive to the ordering of the columns/stacks. This is an ugly hack
-     * but hopefully it will work.
-     * */
-    fcs_state_keyval_pair_t *initial_non_canonized_state;
+        /*
+         * This is intended to be used by the patsolve scan which is
+         * sensitive to the ordering of the columns/stacks. This is an ugly hack
+         * but hopefully it will work.
+         * */
+        fcs_state_keyval_pair_t *initial_non_canonized_state;
 #endif
 
 #ifndef FCS_DISABLE_SIMPLE_SIMON
-    /*
-     * Whether or not this is a Simple Simon-like game.
-     * */
-    fcs_bool_t is_simple_simon;
+        /*
+         * Whether or not this is a Simple Simon-like game.
+         * */
+        fcs_bool_t is_simple_simon;
 #endif
-};
+    };
 
 #ifdef FCS_SINGLE_HARD_THREAD
 #define HT_FIELD(ht, field) (ht)->hard_thread.field
@@ -814,134 +818,139 @@ struct fc_solve_instance_struct
 #include "pat.h"
 #endif
 
-extern fc_solve_solve_process_ret_t fc_solve_befs_or_bfs_do_solve(
-    fc_solve_soft_thread_t *const soft_thread);
+    extern fc_solve_solve_process_ret_t fc_solve_befs_or_bfs_do_solve(
+        fc_solve_soft_thread_t *const soft_thread);
 
-static inline void *memdup(const void *const src, const size_t my_size)
-{
-    void *const dest = malloc(my_size);
-    if (dest == NULL)
+    static inline void *memdup(const void *const src, const size_t my_size)
     {
-        return NULL;
-    }
+        void *const dest = malloc(my_size);
+        if (dest == NULL)
+        {
+            return NULL;
+        }
 
-    memcpy(dest, src, my_size);
+        memcpy(dest, src, my_size);
 
-    return dest;
-}
+        return dest;
+    }
 
-static inline int update_col_cards_under_sequences(
+    static inline int update_col_cards_under_sequences(
 #ifndef FCS_FREECELL_ONLY
-    const int sequences_are_built_by,
+        const int sequences_are_built_by,
 #endif
-    const fcs_const_cards_column_t col,
-    int d /* One less than cards_num of col. */
-)
-{
-    fcs_card_t this_card = fcs_col_get_card(col, d);
-    fcs_card_t prev_card;
-    for (; (d > 0) && ({
-             prev_card = fcs_col_get_card(col, d - 1);
-             fcs_is_parent_card(this_card, prev_card);
-         });
-         d--, this_card = prev_card)
+        const fcs_const_cards_column_t col,
+        int d /* One less than cards_num of col. */
+    )
     {
+        fcs_card_t this_card = fcs_col_get_card(col, d);
+        fcs_card_t prev_card;
+        for (; (d > 0) && ({
+                 prev_card = fcs_col_get_card(col, d - 1);
+                 fcs_is_parent_card(this_card, prev_card);
+             });
+             d--, this_card = prev_card)
+        {
+        }
+        return d;
     }
-    return d;
-}
 
-extern fcs_collectible_state_t *fc_solve_sfs_raymond_prune(
-    fc_solve_soft_thread_t *, fcs_kv_state_t);
+    extern fcs_collectible_state_t *fc_solve_sfs_raymond_prune(
+        fc_solve_soft_thread_t *, fcs_kv_state_t);
 
 #ifdef FCS_RCS_STATES
-fcs_state_t *fc_solve_lookup_state_key_from_val(fc_solve_instance_t *instance,
-    const fcs_collectible_state_t *orig_ptr_state_val);
+    fcs_state_t *fc_solve_lookup_state_key_from_val(
+        fc_solve_instance_t *instance,
+        const fcs_collectible_state_t *orig_ptr_state_val);
 
-extern int fc_solve_compare_lru_cache_keys(const void *, const void *, void *);
+    extern int fc_solve_compare_lru_cache_keys(
+        const void *, const void *, void *);
 
 #endif
 
-extern void fc_solve_soft_thread_init_befs_or_bfs(
-    fc_solve_soft_thread_t *const soft_thread);
+    extern void fc_solve_soft_thread_init_befs_or_bfs(
+        fc_solve_soft_thread_t *const soft_thread);
 
-extern void fc_solve_instance__init_hard_thread(
+    extern void fc_solve_instance__init_hard_thread(
 #ifndef FCS_SINGLE_HARD_THREAD
-    fc_solve_instance_t *const instance,
+        fc_solve_instance_t *const instance,
 #endif
-    fc_solve_hard_thread_t *const hard_thread);
-
-extern void fc_solve_free_soft_thread_by_depth_move_array(
-    fc_solve_soft_thread_t *const soft_thread);
+        fc_solve_hard_thread_t *const hard_thread);
 
-static inline fcs_moves_order moves_order_dup(fcs_moves_order *const orig)
-{
-    const_SLOT(num, orig);
-    fcs_moves_order ret = (fcs_moves_order){.num = num,
-        .groups = memdup(orig->groups,
-            sizeof(orig->groups[0]) *
-                ((num & (~(MOVES_GROW_BY - 1))) + MOVES_GROW_BY))};
+    extern void fc_solve_free_soft_thread_by_depth_move_array(
+        fc_solve_soft_thread_t *const soft_thread);
 
-    for (size_t i = 0; i < num; ++i)
+    static inline fcs_moves_order moves_order_dup(fcs_moves_order *const orig)
     {
-        ret.groups[i].move_funcs = memdup(ret.groups[i].move_funcs,
-            sizeof(ret.groups[i].move_funcs[0]) *
-                ((ret.groups[i].num & (~(MOVES_GROW_BY - 1))) + MOVES_GROW_BY));
-    }
+        const_SLOT(num, orig);
+        fcs_moves_order ret = (fcs_moves_order){.num = num,
+            .groups = memdup(orig->groups,
+                sizeof(orig->groups[0]) *
+                    ((num & (~(MOVES_GROW_BY - 1))) + MOVES_GROW_BY))};
 
-    return ret;
-}
+        for (size_t i = 0; i < num; ++i)
+        {
+            ret.groups[i].move_funcs = memdup(ret.groups[i].move_funcs,
+                sizeof(ret.groups[i].move_funcs[0]) *
+                    ((ret.groups[i].num & (~(MOVES_GROW_BY - 1))) +
+                        MOVES_GROW_BY));
+        }
+
+        return ret;
+    }
 
-extern fc_solve_soft_thread_t *fc_solve_new_soft_thread(
-    fc_solve_hard_thread_t *const hard_thread);
+    extern fc_solve_soft_thread_t *fc_solve_new_soft_thread(
+        fc_solve_hard_thread_t *const hard_thread);
 
-/* This is the commmon code from fc_solve_instance__init_hard_thread() and
- * recycle_hard_thread() */
-static inline void fc_solve_reset_hard_thread(
-    fc_solve_hard_thread_t *const hard_thread)
-{
+    /* This is the commmon code from fc_solve_instance__init_hard_thread() and
+     * recycle_hard_thread() */
+    static inline void fc_solve_reset_hard_thread(
+        fc_solve_hard_thread_t *const hard_thread)
+    {
 #ifndef FCS_SINGLE_HARD_THREAD
-    HT_FIELD(hard_thread, ht__num_checked_states) = 0;
+        HT_FIELD(hard_thread, ht__num_checked_states) = 0;
 #endif
-    HT_FIELD(hard_thread, ht__max_num_checked_states) = FCS_INT_LIMIT_MAX;
-    HT_FIELD(hard_thread, num_soft_threads_finished) = 0;
-}
+        HT_FIELD(hard_thread, ht__max_num_checked_states) = FCS_INT_LIMIT_MAX;
+        HT_FIELD(hard_thread, num_soft_threads_finished) = 0;
+    }
 
-static inline void fc_solve_reset_soft_thread(
-    fc_solve_soft_thread_t *const soft_thread)
-{
-    STRUCT_CLEAR_FLAG(soft_thread, FCS_SOFT_THREAD_IS_FINISHED);
-    STRUCT_CLEAR_FLAG(soft_thread, FCS_SOFT_THREAD_INITIALIZED);
-}
+    static inline void fc_solve_reset_soft_thread(
+        fc_solve_soft_thread_t *const soft_thread)
+    {
+        STRUCT_CLEAR_FLAG(soft_thread, FCS_SOFT_THREAD_IS_FINISHED);
+        STRUCT_CLEAR_FLAG(soft_thread, FCS_SOFT_THREAD_INITIALIZED);
+    }
 
-typedef enum {
-    FOREACH_SOFT_THREAD_CLEAN_SOFT_DFS,
-    FOREACH_SOFT_THREAD_FREE_INSTANCE,
-    FOREACH_SOFT_THREAD_ACCUM_TESTS_ORDER,
-    FOREACH_SOFT_THREAD_DETERMINE_SCAN_COMPLETENESS
-} fcs_foreach_st_callback_choice_t;
+    typedef enum
+    {
+        FOREACH_SOFT_THREAD_CLEAN_SOFT_DFS,
+        FOREACH_SOFT_THREAD_FREE_INSTANCE,
+        FOREACH_SOFT_THREAD_ACCUM_TESTS_ORDER,
+        FOREACH_SOFT_THREAD_DETERMINE_SCAN_COMPLETENESS
+    } fcs_foreach_st_callback_choice_t;
 
-extern void fc_solve_foreach_soft_thread(fc_solve_instance_t *const instance,
-    const fcs_foreach_st_callback_choice_t callback_choice,
-    void *const context);
+    extern void fc_solve_foreach_soft_thread(
+        fc_solve_instance_t *const instance,
+        const fcs_foreach_st_callback_choice_t callback_choice,
+        void *const context);
 
-/*
-    This function is the last function that should be called in the
-    sequence of operations on instance, and it is meant for de-allocating
-    whatever memory was allocated by alloc_instance().
-  */
+    /*
+        This function is the last function that should be called in the
+        sequence of operations on instance, and it is meant for de-allocating
+        whatever memory was allocated by alloc_instance().
+      */
 
-static inline void moves_order__free(fcs_moves_order *moves_order)
-{
-    const_SLOT(groups, moves_order);
-    const_SLOT(num, moves_order);
-    for (size_t group_idx = 0; group_idx < num; ++group_idx)
+    static inline void moves_order__free(fcs_moves_order *moves_order)
     {
-        free(groups[group_idx].move_funcs);
+        const_SLOT(groups, moves_order);
+        const_SLOT(num, moves_order);
+        for (size_t group_idx = 0; group_idx < num; ++group_idx)
+        {
+            free(groups[group_idx].move_funcs);
+        }
+        free(groups);
+        moves_order->groups = NULL;
+        moves_order->num = 0;
     }
-    free(groups);
-    moves_order->groups = NULL;
-    moves_order->num = 0;
-}
 
     /***********************************************************/
 
@@ -951,22 +960,23 @@ static inline void moves_order__free(fcs_moves_order *moves_order)
         fcs_derived_states_list_t *const derived_states_list)
 
 #ifdef FCS_SINGLE_HARD_THREAD
-extern void fc_solve_init_soft_thread(fc_solve_hard_thread_t *const hard_thread,
-    fc_solve_soft_thread_t *const soft_thread);
+    extern void fc_solve_init_soft_thread(
+        fc_solve_hard_thread_t *const hard_thread,
+        fc_solve_soft_thread_t *const soft_thread);
 #endif
 
 #ifndef FCS_HARD_CODE_CALC_REAL_DEPTH_AS_FALSE
-static inline fcs_bool_t fcs_get_calc_real_depth(
-    const fc_solve_instance_t *const instance)
-{
-    return STRUCT_QUERY_FLAG(instance, FCS_RUNTIME_CALC_REAL_DEPTH);
-}
+    static inline fcs_bool_t fcs_get_calc_real_depth(
+        const fc_solve_instance_t *const instance)
+    {
+        return STRUCT_QUERY_FLAG(instance, FCS_RUNTIME_CALC_REAL_DEPTH);
+    }
 #endif
 
 #ifdef FCS_WITH_MOVES
-extern void fc_solve_trace_solution(fc_solve_instance_t *const instance);
+    extern void fc_solve_trace_solution(fc_solve_instance_t *const instance);
 #endif
-extern void fc_solve_finish_instance(fc_solve_instance_t *const instance);
+    extern void fc_solve_finish_instance(fc_solve_instance_t *const instance);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/instance_for_lib.h b/fc-solve/source/instance_for_lib.h
index ce1845311..623473ec3 100644
--- a/fc-solve/source/instance_for_lib.h
+++ b/fc-solve/source/instance_for_lib.h
@@ -14,78 +14,79 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 #include "scans_impl.h"
 #include "preset.h"
 #include "move_funcs_order.h"
 
-static inline void fcs_free_moves_list(
-    fc_solve_soft_thread_t *const soft_thread)
-{
-    /* Free the BeFS data. */
-    free(BEFS_M_VAR(soft_thread, moves_list));
-    BEFS_M_VAR(soft_thread, moves_list) = NULL;
-
-    /* Free the DFS data. */
-    fcs_moves_by_depth_array *const arr =
-        &(DFS_VAR(soft_thread, moves_by_depth));
-    const_SLOT(num_units, arr);
-    for (size_t unit_idx = 0; unit_idx < num_units; unit_idx++)
+    static inline void fcs_free_moves_list(
+        fc_solve_soft_thread_t *const soft_thread)
     {
-        if (arr->by_depth_units[unit_idx].move_funcs.groups)
-        {
-            fcs_moves_group *const groups =
-                arr->by_depth_units[unit_idx].move_funcs.groups;
-            const_AUTO(num, arr->by_depth_units[unit_idx].move_funcs.num);
+        /* Free the BeFS data. */
+        free(BEFS_M_VAR(soft_thread, moves_list));
+        BEFS_M_VAR(soft_thread, moves_list) = NULL;
 
-            for (typeof(arr->by_depth_units[unit_idx].move_funcs.num) i = 0;
-                 i < num; i++)
+        /* Free the DFS data. */
+        fcs_moves_by_depth_array *const arr =
+            &(DFS_VAR(soft_thread, moves_by_depth));
+        const_SLOT(num_units, arr);
+        for (size_t unit_idx = 0; unit_idx < num_units; unit_idx++)
+        {
+            if (arr->by_depth_units[unit_idx].move_funcs.groups)
             {
-                free(groups[i].move_funcs);
+                fcs_moves_group *const groups =
+                    arr->by_depth_units[unit_idx].move_funcs.groups;
+                const_AUTO(num, arr->by_depth_units[unit_idx].move_funcs.num);
+
+                for (typeof(arr->by_depth_units[unit_idx].move_funcs.num) i = 0;
+                     i < num; i++)
+                {
+                    free(groups[i].move_funcs);
+                }
+                free(groups);
             }
-            free(groups);
         }
+        free(arr->by_depth_units);
+        arr->by_depth_units = NULL;
     }
-    free(arr->by_depth_units);
-    arr->by_depth_units = NULL;
-}
 
 #ifdef FCS_WITH_MOVES
-static inline void instance_free_solution_moves(
-    fc_solve_instance_t *const instance)
-{
-    if (instance->solution_moves.moves)
+    static inline void instance_free_solution_moves(
+        fc_solve_instance_t *const instance)
     {
-        fcs_move_stack_static_destroy(instance->solution_moves);
-        instance->solution_moves.moves = NULL;
+        if (instance->solution_moves.moves)
+        {
+            fcs_move_stack_static_destroy(instance->solution_moves);
+            instance->solution_moves.moves = NULL;
+        }
     }
-}
 #endif
 
-static inline void st_free_pq(fc_solve_soft_thread_t *const soft_thread)
-{
-    fc_solve_PQueueFree(&(BEFS_VAR(soft_thread, pqueue)));
-}
+    static inline void st_free_pq(fc_solve_soft_thread_t *const soft_thread)
+    {
+        fc_solve_PQueueFree(&(BEFS_VAR(soft_thread, pqueue)));
+    }
 
-static inline void fc_solve_free_instance_soft_thread_callback(
-    fc_solve_soft_thread_t *const soft_thread)
-{
-    st_free_pq(soft_thread);
-    fcs_free_moves_list(soft_thread);
-    fc_solve_free_soft_thread_by_depth_move_array(soft_thread);
+    static inline void fc_solve_free_instance_soft_thread_callback(
+        fc_solve_soft_thread_t *const soft_thread)
+    {
+        st_free_pq(soft_thread);
+        fcs_free_moves_list(soft_thread);
+        fc_solve_free_soft_thread_by_depth_move_array(soft_thread);
 #ifndef FCS_DISABLE_PATSOLVE
-    const_SLOT(pats_scan, soft_thread);
+        const_SLOT(pats_scan, soft_thread);
 
-    if (pats_scan)
-    {
-        fc_solve_pats__recycle_soft_thread(pats_scan);
-        fc_solve_pats__destroy_soft_thread(pats_scan);
-        free(pats_scan);
-        soft_thread->pats_scan = NULL;
-    }
+        if (pats_scan)
+        {
+            fc_solve_pats__recycle_soft_thread(pats_scan);
+            fc_solve_pats__destroy_soft_thread(pats_scan);
+            free(pats_scan);
+            soft_thread->pats_scan = NULL;
+        }
 #endif
-}
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/internal_move_struct.h b/fc-solve/source/internal_move_struct.h
index 3353ca95d..bb0efa140 100644
--- a/fc-solve/source/internal_move_struct.h
+++ b/fc-solve/source/internal_move_struct.h
@@ -13,7 +13,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "config.h"
@@ -23,15 +24,15 @@ extern "C" {
 #include "fcs_move.h"
 
 #ifdef FCS_USE_COMPACT_MOVE_TOKENS
-typedef struct
-{
-    unsigned int type : 4;
-    unsigned int src : 4;
-    unsigned int dest : 4;
-    unsigned int num_cards_in_seq : 4;
-} fcs_internal_move_t;
+    typedef struct
+    {
+        unsigned int type : 4;
+        unsigned int src : 4;
+        unsigned int dest : 4;
+        unsigned int num_cards_in_seq : 4;
+    } fcs_internal_move_t;
 #else
-typedef fcs_move_t fcs_internal_move_t;
+    typedef fcs_move_t fcs_internal_move_t;
 #endif
 
 #ifdef FCS_USE_COMPACT_MOVE_TOKENS
@@ -66,11 +67,11 @@ typedef fcs_move_t fcs_internal_move_t;
 
 #endif
 
-typedef struct
-{
-    fcs_internal_move_t *moves;
-    size_t num_moves;
-} fcs_move_stack_t;
+    typedef struct
+    {
+        fcs_internal_move_t *moves;
+        size_t num_moves;
+    } fcs_move_stack_t;
 
 #endif
 
diff --git a/fc-solve/source/kaz_tree.c b/fc-solve/source/kaz_tree.c
index d9fcfe4db..978c675ed 100644
--- a/fc-solve/source/kaz_tree.c
+++ b/fc-solve/source/kaz_tree.c
@@ -277,9 +277,9 @@ static int verify_dict_has_node(dnode_t *nil, dnode_t *root, dnode_t *node)
 }
 #endif
 
-    /*
-     * Dynamically allocate and initialize a dictionary object.
-     */
+/*
+ * Dynamically allocate and initialize a dictionary object.
+ */
 
 #ifdef NO_FC_SOLVE
 dict_t *dict_create(dictcount_t maxcount, dict_comp_t comp, void *context)
@@ -405,9 +405,9 @@ void dict_free(dict_t *dict)
 }
 #endif
 
-    /*
-     * Initialize a user-supplied dictionary object.
-     */
+/*
+ * Initialize a user-supplied dictionary object.
+ */
 
 #ifdef NO_FC_SOLVE
 dict_t *dict_init(dict_t *dict, dictcount_t maxcount, dict_comp_t comp)
@@ -1146,10 +1146,10 @@ static inline dnode_t *dnode_init(dnode_t *dnode)
     return dnode;
 }
 
-    /*
-     * Allocate a node using the dictionary's allocator routine, give it
-     * the data item.
-     */
+/*
+ * Allocate a node using the dictionary's allocator routine, give it
+ * the data item.
+ */
 
 #ifdef NO_FC_SOLVE
 dict_ret_key_t fc_solve_kaz_tree_alloc_insert(
diff --git a/fc-solve/source/kaz_tree.h b/fc-solve/source/kaz_tree.h
index 2ea0adc8d..907758546 100644
--- a/fc-solve/source/kaz_tree.h
+++ b/fc-solve/source/kaz_tree.h
@@ -39,25 +39,30 @@
  */
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-typedef unsigned long dictcount_t;
+    typedef unsigned long dictcount_t;
 #define DICTCOUNT_T_MAX ULONG_MAX
 
-/*
- * The dictionary is implemented as a red-black tree
- */
+    /*
+     * The dictionary is implemented as a red-black tree
+     */
 
-typedef enum { dnode_red, dnode_black } dnode_color_t;
+    typedef enum
+    {
+        dnode_red,
+        dnode_black
+    } dnode_color_t;
 
 /*
  * This is set by dbm_kaztree.c to conserve space when used in the delta-states
  * nodes.
  */
 #ifdef FCS_KAZ_TREE_USE_RECORD_DICT_KEY
-typedef fcs_dbm_record_t dict_key_t;
-typedef dict_key_t *dict_ret_key_t;
+    typedef fcs_dbm_record_t dict_key_t;
+    typedef dict_key_t *dict_ret_key_t;
 #else
 typedef void *dict_key_t;
 typedef dict_key_t dict_ret_key_t;
@@ -65,69 +70,69 @@ typedef dict_key_t dict_ret_key_t;
 
 #define DNODE_NEXT(node) ((node)->dict_left)
 
-typedef struct dnode_t
-{
+    typedef struct dnode_t
+    {
 #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
-    struct dnode_t *dict_left;
-    struct dnode_t *dict_right;
-    struct dnode_t *dict_parent;
-    dnode_color_t dict_color;
-    dict_key_t dict_key;
+        struct dnode_t *dict_left;
+        struct dnode_t *dict_right;
+        struct dnode_t *dict_parent;
+        dnode_color_t dict_color;
+        dict_key_t dict_key;
 #ifdef NO_FC_SOLVE
-    void *dict_data;
+        void *dict_data;
 #endif
 #else
     int dict_dummy;
 #endif
-} dnode_t;
+    } dnode_t;
 
-typedef int (*dict_comp_t)(const void *, const void *, void *);
+    typedef int (*dict_comp_t)(const void *, const void *, void *);
 /* Removed from fc-solve */
 #if 0
 typedef dnode_t *(*dnode_alloc_t)(void *);
 typedef void (*dnode_free_t)(dnode_t *, void *);
 #endif
 
-typedef struct dict_t
-{
+    typedef struct dict_t
+    {
 #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
-    dnode_t dict_nilnode;
+        dnode_t dict_nilnode;
 #ifdef NO_FC_SOLVE
-    dictcount_t dict_nodecount;
-    dictcount_t dict_maxcount;
+        dictcount_t dict_nodecount;
+        dictcount_t dict_maxcount;
 #endif
-    dict_comp_t dict_compare;
+        dict_comp_t dict_compare;
 /* Removed from fc-solve */
 #if 0
     dnode_alloc_t dict_allocnode;
     dnode_free_t dict_free_node;
 #else
-    fcs_compact_allocator_t dict_allocator;
-    dnode_t *dict_recycle_bin;
+        fcs_compact_allocator_t dict_allocator;
+        dnode_t *dict_recycle_bin;
 #endif
-    void *dict_context;
+        void *dict_context;
 #ifdef NO_FC_SOLVE
-    int dict_dupes;
+        int dict_dupes;
 #endif
 #else
     int dict_dummy;
 #endif
-} dict_t;
+    } dict_t;
 
-typedef void (*dnode_process_t)(dict_t *, dnode_t *, void *);
+    typedef void (*dnode_process_t)(dict_t *, dnode_t *, void *);
 
-typedef struct dict_load_t
-{
+    typedef struct dict_load_t
+    {
 #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
-    dict_t *dict_dictptr;
-    dnode_t dict_nilnode;
+        dict_t *dict_dictptr;
+        dnode_t dict_nilnode;
 #else
     int dict_dummy;
 #endif
-} dict_load_t;
+    } dict_load_t;
 
 #ifdef NO_FC_SOLVE
-extern dict_t *dict_create(dictcount_t, dict_comp_t, void *);
+    extern dict_t *dict_create(dictcount_t, dict_comp_t, void *);
 #else
 extern dict_t *fc_solve_kaz_tree_create(
     dict_comp_t, void *, fcs_meta_compact_allocator_t *);
@@ -135,64 +140,65 @@ extern dict_t *fc_solve_kaz_tree_create(
 #if 0
 extern void dict_set_allocator(dict_t *, dnode_alloc_t, dnode_free_t, void *);
 #endif
-extern void fc_solve_kaz_tree_destroy(dict_t *);
-extern void fc_solve_kaz_tree_free_nodes(dict_t *);
+    extern void fc_solve_kaz_tree_destroy(dict_t *);
+    extern void fc_solve_kaz_tree_free_nodes(dict_t *);
 #ifdef NO_FC_SOLVE
-extern void dict_free(dict_t *);
-extern dict_t *dict_init(dict_t *, dictcount_t, dict_comp_t);
+    extern void dict_free(dict_t *);
+    extern dict_t *dict_init(dict_t *, dictcount_t, dict_comp_t);
 #else
 extern dict_t *dict_init(dict_t *, dict_comp_t, fcs_meta_compact_allocator_t *);
 #endif
 #ifdef NO_FC_SOLVE
-extern void dict_init_like(dict_t *, const dict_t *);
-extern dict_t *dict_init_alloc(
-    dict_t *, dictcount_t, dict_comp_t, dnode_alloc_t, dnode_free_t, void *);
+    extern void dict_init_like(dict_t *, const dict_t *);
+    extern dict_t *dict_init_alloc(dict_t *, dictcount_t, dict_comp_t,
+        dnode_alloc_t, dnode_free_t, void *);
 #endif
 #ifdef NO_FC_SOLVE
-extern int dict_verify(dict_t *);
-extern int dict_similar(const dict_t *, const dict_t *);
-extern dnode_t *dict_lower_bound(dict_t *, const void *);
-extern dnode_t *dict_upper_bound(dict_t *, const void *);
-extern dnode_t *dict_strict_lower_bound(dict_t *, const void *);
-extern dnode_t *dict_strict_upper_bound(dict_t *, const void *);
-#endif
-extern dict_ret_key_t fc_solve_kaz_tree_insert(dict_t *, dnode_t *, dict_key_t);
+    extern int dict_verify(dict_t *);
+    extern int dict_similar(const dict_t *, const dict_t *);
+    extern dnode_t *dict_lower_bound(dict_t *, const void *);
+    extern dnode_t *dict_upper_bound(dict_t *, const void *);
+    extern dnode_t *dict_strict_lower_bound(dict_t *, const void *);
+    extern dnode_t *dict_strict_upper_bound(dict_t *, const void *);
+#endif
+    extern dict_ret_key_t fc_solve_kaz_tree_insert(
+        dict_t *, dnode_t *, dict_key_t);
 #ifdef NO_FC_SOLVE
-extern dnode_t *fc_solve_kaz_tree_delete(dict_t *, dnode_t *);
+    extern dnode_t *fc_solve_kaz_tree_delete(dict_t *, dnode_t *);
 #endif
-extern dict_ret_key_t fc_solve_kaz_tree_alloc_insert(dict_t *, dict_key_t);
-extern void fc_solve_kaz_tree_delete_free(dict_t *, dnode_t *);
-extern dnode_t *fc_solve_kaz_tree_lookup(dict_t *, dict_key_t);
-dict_key_t fc_solve_kaz_tree_lookup_value(dict_t *dict, dict_key_t key);
+    extern dict_ret_key_t fc_solve_kaz_tree_alloc_insert(dict_t *, dict_key_t);
+    extern void fc_solve_kaz_tree_delete_free(dict_t *, dnode_t *);
+    extern dnode_t *fc_solve_kaz_tree_lookup(dict_t *, dict_key_t);
+    dict_key_t fc_solve_kaz_tree_lookup_value(dict_t *dict, dict_key_t key);
 
-extern dnode_t *fc_solve_kaz_tree_first(dict_t *);
-extern dnode_t *fc_solve_kaz_tree_next(dict_t *, dnode_t *);
+    extern dnode_t *fc_solve_kaz_tree_first(dict_t *);
+    extern dnode_t *fc_solve_kaz_tree_next(dict_t *, dnode_t *);
 #ifdef NO_FC_SOLVE
-extern dnode_t *dict_last(dict_t *);
-extern dnode_t *dict_prev(dict_t *, dnode_t *);
-extern dictcount_t dict_count(dict_t *);
-extern int dict_isempty(dict_t *);
-extern int dict_isfull(dict_t *);
-extern int dict_contains(dict_t *, dnode_t *);
+    extern dnode_t *dict_last(dict_t *);
+    extern dnode_t *dict_prev(dict_t *, dnode_t *);
+    extern dictcount_t dict_count(dict_t *);
+    extern int dict_isempty(dict_t *);
+    extern int dict_isfull(dict_t *);
+    extern int dict_contains(dict_t *, dnode_t *);
 #endif
 #ifdef NO_FC_SOLVE
-extern void dict_allow_dupes(dict_t *);
+    extern void dict_allow_dupes(dict_t *);
 #endif
 #ifdef NO_FC_SOLVE
-extern int dnode_is_in_a_dict(dnode_t *);
-extern dnode_t *dnode_create(void *);
-extern dnode_t *dnode_init(dnode_t *, void *);
-extern void dnode_destroy(dnode_t *);
-extern void *dnode_get(dnode_t *);
-extern dict_key_t *dnode_getkey(dnode_t *);
-extern void dnode_put(dnode_t *, void *);
+    extern int dnode_is_in_a_dict(dnode_t *);
+    extern dnode_t *dnode_create(void *);
+    extern dnode_t *dnode_init(dnode_t *, void *);
+    extern void dnode_destroy(dnode_t *);
+    extern void *dnode_get(dnode_t *);
+    extern dict_key_t *dnode_getkey(dnode_t *);
+    extern void dnode_put(dnode_t *, void *);
 #endif
 #ifdef NO_FC_SOLVE
-extern void dict_process(dict_t *, void *, dnode_process_t);
-extern void dict_load_begin(dict_load_t *, dict_t *);
-extern void dict_load_next(dict_load_t *, dnode_t *, const void *);
-extern void dict_load_end(dict_load_t *);
-extern void dict_merge(dict_t *, dict_t *);
+    extern void dict_process(dict_t *, void *, dnode_process_t);
+    extern void dict_load_begin(dict_load_t *, dict_t *);
+    extern void dict_load_next(dict_load_t *, dnode_t *, const void *);
+    extern void dict_load_end(dict_load_t *);
+    extern void dict_merge(dict_t *, dict_t *);
 #endif
 
 #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
diff --git a/fc-solve/source/lib.c b/fc-solve/source/lib.c
index 65636da68..5780f2b51 100644
--- a/fc-solve/source/lib.c
+++ b/fc-solve/source/lib.c
@@ -1923,14 +1923,16 @@ typedef struct
 } fcs_flare_item_t;
 
 #ifdef FCS_WITH_FLARES
-typedef enum {
+typedef enum
+{
     FLARES_PLAN_RUN_INDEFINITELY,
     FLARES_PLAN_RUN_COUNT_ITERS,
     FLARES_PLAN_CHECKPOINT,
 } flares_plan_type_t;
 
 #ifndef FCS_WITHOUT_FC_PRO_MOVES_COUNT
-typedef enum {
+typedef enum
+{
     FLARES_CHOICE_FC_SOLVE_SOLUTION_LEN,
     FLARES_CHOICE_FCPRO_SOLUTION_LEN
 } flares_choice_type_t;
@@ -2528,7 +2530,8 @@ int DLLEXPORT freecell_solver_user_set_tests_order(void *api_instance,
 }
 #endif
 
-typedef enum {
+typedef enum
+{
     FCS_COMPILE_FLARES_RET_OK = 0,
     FCS_COMPILE_FLARES_RET_COLON_NOT_FOUND,
     FCS_COMPILE_FLARES_RET_RUN_AT_SIGN_NOT_FOUND,
diff --git a/fc-solve/source/lock.h b/fc-solve/source/lock.h
index 1b39724a6..c56167aca 100644
--- a/fc-solve/source/lock.h
+++ b/fc-solve/source/lock.h
@@ -13,16 +13,17 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include <pthread.h>
 
-/*
- * Define FCS_DBM_USE_RWLOCK to use the pthread FCFS RWLock which appears
- * to improve CPU utilisations of the various worker threads and possibly
- * overall performance.
- * #define FCS_DBM_USE_RWLOCK 1 */
+    /*
+     * Define FCS_DBM_USE_RWLOCK to use the pthread FCFS RWLock which appears
+     * to improve CPU utilisations of the various worker threads and possibly
+     * overall performance.
+     * #define FCS_DBM_USE_RWLOCK 1 */
 
 #ifdef FCS_DBM_USE_RWLOCK
 #include <pthread/rwlock_fcfs.h>
@@ -32,11 +33,11 @@ extern "C" {
 
 #ifdef FCS_DBM_SINGLE_THREAD
 
-typedef fcs_bool_t fcs_lock_t;
-static inline void fcs_lock_lock(fcs_lock_t *const lock) {}
-static inline void fcs_lock_unlock(fcs_lock_t *const lock) {}
-static inline void fcs_lock_init(fcs_lock_t *const lock) {}
-static inline void fcs_lock_destroy(fcs_lock_t *const lock) {}
+    typedef fcs_bool_t fcs_lock_t;
+    static inline void fcs_lock_lock(fcs_lock_t *const lock) {}
+    static inline void fcs_lock_unlock(fcs_lock_t *const lock) {}
+    static inline void fcs_lock_init(fcs_lock_t *const lock) {}
+    static inline void fcs_lock_destroy(fcs_lock_t *const lock) {}
 #elif defined(FCS_DBM_USE_RWLOCK)
 
 typedef pthread_rwlock_fcfs_t *fcs_lock_t;
diff --git a/fc-solve/source/meta_alloc.h b/fc-solve/source/meta_alloc.h
index f8b6323b6..6faebb5ef 100644
--- a/fc-solve/source/meta_alloc.h
+++ b/fc-solve/source/meta_alloc.h
@@ -17,90 +17,91 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "state.h"
 
-typedef struct
-{
-    char *recycle_bin;
-} fcs_meta_compact_allocator_t;
+    typedef struct
+    {
+        char *recycle_bin;
+    } fcs_meta_compact_allocator_t;
 
-typedef struct
-{
-    char *old_list;
-    char *max_ptr;
-    char *ptr;
-    char *rollback_ptr;
-    fcs_meta_compact_allocator_t *meta;
-} fcs_compact_allocator_t;
-
-extern void fc_solve_compact_allocator_extend(fcs_compact_allocator_t *);
-
-/* To be called after the meta_alloc was set. */
-static inline void fc_solve_compact_allocator_init_helper(
-    fcs_compact_allocator_t *const allocator)
-{
-    allocator->old_list = NULL;
-    fc_solve_compact_allocator_extend(allocator);
-}
+    typedef struct
+    {
+        char *old_list;
+        char *max_ptr;
+        char *ptr;
+        char *rollback_ptr;
+        fcs_meta_compact_allocator_t *meta;
+    } fcs_compact_allocator_t;
+
+    extern void fc_solve_compact_allocator_extend(fcs_compact_allocator_t *);
+
+    /* To be called after the meta_alloc was set. */
+    static inline void fc_solve_compact_allocator_init_helper(
+        fcs_compact_allocator_t *const allocator)
+    {
+        allocator->old_list = NULL;
+        fc_solve_compact_allocator_extend(allocator);
+    }
 
-static inline void fc_solve_meta_compact_allocator_init(
-    fcs_meta_compact_allocator_t *const meta)
-{
-    meta->recycle_bin = NULL;
-}
+    static inline void fc_solve_meta_compact_allocator_init(
+        fcs_meta_compact_allocator_t *const meta)
+    {
+        meta->recycle_bin = NULL;
+    }
 
-extern void fc_solve_meta_compact_allocator_finish(
-    fcs_meta_compact_allocator_t *);
+    extern void fc_solve_meta_compact_allocator_finish(
+        fcs_meta_compact_allocator_t *);
 
-extern void fc_solve_compact_allocator_init(
-    fcs_compact_allocator_t *, fcs_meta_compact_allocator_t *);
+    extern void fc_solve_compact_allocator_init(
+        fcs_compact_allocator_t *, fcs_meta_compact_allocator_t *);
 
-static inline void *fcs_compact_alloc_ptr(
-    fcs_compact_allocator_t *const allocator, const size_t how_much_proto)
-{
-    /* Round ptr to the next pointer boundary */
-    const size_t how_much =
-        how_much_proto +
-        ((sizeof(char *) - ((how_much_proto) & (sizeof(char *) - 1))) &
-            (sizeof(char *) - 1));
-
-    if ((size_t)(allocator->max_ptr - allocator->ptr) < how_much)
+    static inline void *fcs_compact_alloc_ptr(
+        fcs_compact_allocator_t *const allocator, const size_t how_much_proto)
     {
-        fc_solve_compact_allocator_extend(allocator);
+        /* Round ptr to the next pointer boundary */
+        const size_t how_much =
+            how_much_proto +
+            ((sizeof(char *) - ((how_much_proto) & (sizeof(char *) - 1))) &
+                (sizeof(char *) - 1));
+
+        if ((size_t)(allocator->max_ptr - allocator->ptr) < how_much)
+        {
+            fc_solve_compact_allocator_extend(allocator);
+        }
+        else
+        {
+            allocator->rollback_ptr = allocator->ptr;
+        }
+        allocator->ptr += how_much;
+
+        return allocator->rollback_ptr;
     }
-    else
+
+    static inline void fcs_compact_alloc_release(
+        fcs_compact_allocator_t *const allocator)
     {
-        allocator->rollback_ptr = allocator->ptr;
+        allocator->ptr = allocator->rollback_ptr;
     }
-    allocator->ptr += how_much;
-
-    return allocator->rollback_ptr;
-}
-
-static inline void fcs_compact_alloc_release(
-    fcs_compact_allocator_t *const allocator)
-{
-    allocator->ptr = allocator->rollback_ptr;
-}
 
-extern void fc_solve_compact_allocator_finish(fcs_compact_allocator_t *);
+    extern void fc_solve_compact_allocator_finish(fcs_compact_allocator_t *);
 
-static inline fcs_collectible_state_t *fcs_state_ia_alloc_into_var(
-    fcs_compact_allocator_t *const allocator)
-{
-    return (fcs_collectible_state_t *)fcs_compact_alloc_ptr(
-        allocator, sizeof(fcs_collectible_state_t));
-}
+    static inline fcs_collectible_state_t *fcs_state_ia_alloc_into_var(
+        fcs_compact_allocator_t *const allocator)
+    {
+        return (fcs_collectible_state_t *)fcs_compact_alloc_ptr(
+            allocator, sizeof(fcs_collectible_state_t));
+    }
 
-static inline void fc_solve_compact_allocator_recycle(
-    fcs_compact_allocator_t *const allocator)
-{
-    fc_solve_compact_allocator_finish(allocator);
-    fc_solve_compact_allocator_init_helper(allocator);
-}
+    static inline void fc_solve_compact_allocator_recycle(
+        fcs_compact_allocator_t *const allocator)
+    {
+        fc_solve_compact_allocator_finish(allocator);
+        fc_solve_compact_allocator_init_helper(allocator);
+    }
 
 #ifdef __cplusplus
 };
diff --git a/fc-solve/source/meta_move_funcs_helpers.h b/fc-solve/source/meta_move_funcs_helpers.h
index 429b349e4..51f50e6fb 100644
--- a/fc-solve/source/meta_move_funcs_helpers.h
+++ b/fc-solve/source/meta_move_funcs_helpers.h
@@ -16,10 +16,11 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-static inline int max0(const int e) { return max(e, 0); }
+    static inline int max0(const int e) { return max(e, 0); }
 #ifdef FCS_FREECELL_ONLY
 #define calc_max_sequence_move(num_freecells, num_empty_cols)                  \
     (((num_freecells) + 1) << (num_empty_cols))
@@ -62,15 +63,15 @@ static inline size_t calc_max_simple_simon_seq_move(const int num_empty_cols)
             &pass_new_state FCS__pass_moves(moves)),                           \
         state_context_value)
 
-static inline void fc_solve_move_sequence_function(
-    fcs_state_t *const s FCS__pass_moves(fcs_move_stack_t *const moves),
-    const size_t dest_col_i, const size_t src_col_i, const size_t cards_num)
-{
-    fcs_col_transfer_cards(fcs_state_get_col(*s, dest_col_i),
-        fcs_state_get_col(*s, src_col_i), cards_num);
-    fcs_move_stack_params_push(
-        moves, FCS_MOVE_TYPE_STACK_TO_STACK, src_col_i, dest_col_i, cards_num);
-}
+    static inline void fc_solve_move_sequence_function(
+        fcs_state_t *const s FCS__pass_moves(fcs_move_stack_t *const moves),
+        const size_t dest_col_i, const size_t src_col_i, const size_t cards_num)
+    {
+        fcs_col_transfer_cards(fcs_state_get_col(*s, dest_col_i),
+            fcs_state_get_col(*s, src_col_i), cards_num);
+        fcs_move_stack_params_push(moves, FCS_MOVE_TYPE_STACK_TO_STACK,
+            src_col_i, dest_col_i, cards_num);
+    }
 
 #define fcs_move_sequence(to, from, cards_num)                                 \
     fc_solve_move_sequence_function(                                           \
diff --git a/fc-solve/source/move.h b/fc-solve/source/move.h
index 948ec1532..901eea449 100644
--- a/fc-solve/source/move.h
+++ b/fc-solve/source/move.h
@@ -14,7 +14,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "state.h"
@@ -22,323 +23,333 @@ extern "C" {
 #include "indirect_buffer.h"
 
 #ifdef FCS_WITH_MOVES
-extern const fcs_internal_move_t fc_solve_empty_move;
+    extern const fcs_internal_move_t fc_solve_empty_move;
 #endif
 
 #define FCS_MOVE_STACK_GROW_BY 16
 
 #ifdef FCS_WITH_MOVES
-static inline void fcs_move_stack_push(
-    fcs_move_stack_t *const stack, const fcs_internal_move_t move)
-{
-    /* If all the moves inside the stack are taken then
-       resize the move vector */
-    const size_t pos = ++stack->num_moves;
-
-    if (!(pos & (FCS_MOVE_STACK_GROW_BY - 1)))
+    static inline void fcs_move_stack_push(
+        fcs_move_stack_t *const stack, const fcs_internal_move_t move)
     {
-        stack->moves = SREALLOC(stack->moves, pos + FCS_MOVE_STACK_GROW_BY);
-    }
+        /* If all the moves inside the stack are taken then
+           resize the move vector */
+        const size_t pos = ++stack->num_moves;
 
-    stack->moves[pos - 1] = move;
-}
+        if (!(pos & (FCS_MOVE_STACK_GROW_BY - 1)))
+        {
+            stack->moves = SREALLOC(stack->moves, pos + FCS_MOVE_STACK_GROW_BY);
+        }
 
-static inline void fcs_move_stack_params_push(fcs_move_stack_t *const stack,
-    const int type, const int src, const int dest, const int num_cards_in_seq)
-{
-    fcs_internal_move_t temp_move;
+        stack->moves[pos - 1] = move;
+    }
 
-    fcs_int_move_set_type(temp_move, type);
-    fcs_int_move_set_src(temp_move, src);
-    fcs_int_move_set_dest(temp_move, dest);
-    fcs_int_move_set_num_cards_in_seq(temp_move, num_cards_in_seq);
+    static inline void fcs_move_stack_params_push(fcs_move_stack_t *const stack,
+        const int type, const int src, const int dest,
+        const int num_cards_in_seq)
+    {
+        fcs_internal_move_t temp_move;
 
-    fcs_move_stack_push(stack, temp_move);
-}
+        fcs_int_move_set_type(temp_move, type);
+        fcs_int_move_set_src(temp_move, src);
+        fcs_int_move_set_dest(temp_move, dest);
+        fcs_int_move_set_num_cards_in_seq(temp_move, num_cards_in_seq);
 
-static inline void fcs_move_stack_non_seq_push(fcs_move_stack_t *const stack,
-    const int type, const int src, const int dest)
-{
-    fcs_move_stack_params_push(stack, type, src, dest, 1);
-}
+        fcs_move_stack_push(stack, temp_move);
+    }
 
-static inline void fcs_push_1card_seq(
-    fcs_move_stack_t *const stack, const int src, const int dest)
-{
-    fcs_move_stack_params_push(
-        stack, FCS_MOVE_TYPE_STACK_TO_STACK, src, dest, 1);
-}
+    static inline void fcs_move_stack_non_seq_push(
+        fcs_move_stack_t *const stack, const int type, const int src,
+        const int dest)
+    {
+        fcs_move_stack_params_push(stack, type, src, dest, 1);
+    }
 
-static inline fcs_bool_t fc_solve_move_stack_pop(
-    fcs_move_stack_t *const stack, fcs_internal_move_t *const move)
-{
-    if (stack->num_moves > 0)
+    static inline void fcs_push_1card_seq(
+        fcs_move_stack_t *const stack, const int src, const int dest)
     {
-        *move = stack->moves[--stack->num_moves];
-        return FALSE;
+        fcs_move_stack_params_push(
+            stack, FCS_MOVE_TYPE_STACK_TO_STACK, src, dest, 1);
     }
-    else
+
+    static inline fcs_bool_t fc_solve_move_stack_pop(
+        fcs_move_stack_t *const stack, fcs_internal_move_t *const move)
     {
-        return TRUE;
+        if (stack->num_moves > 0)
+        {
+            *move = stack->moves[--stack->num_moves];
+            return FALSE;
+        }
+        else
+        {
+            return TRUE;
+        }
     }
-}
 
 #define fcs_move_stack_static_destroy(stack) free((stack).moves)
 #define fcs_move_stack_reset(stack) (stack)->num_moves = 0
 
-void fc_solve_apply_move(fcs_state_t *const ptr_state_key,
-    fcs_state_locs_struct_t *const locs,
-    const fcs_internal_move_t move FREECELLS_AND_STACKS_ARGS());
-
-/*
-    The purpose of this function is to convert the moves from using
-    the canonized positions of the stacks and freecells to their
-    user positions.
-*/
+    void fc_solve_apply_move(fcs_state_t *const ptr_state_key,
+        fcs_state_locs_struct_t *const locs,
+        const fcs_internal_move_t move FREECELLS_AND_STACKS_ARGS());
 
-static inline fcs_move_stack_t fcs_move_stack__new(void)
-{
-    return (fcs_move_stack_t){.num_moves = 0,
-        .moves = malloc(sizeof(fcs_move_t) * FCS_MOVE_STACK_GROW_BY)};
-}
+    /*
+        The purpose of this function is to convert the moves from using
+        the canonized positions of the stacks and freecells to their
+        user positions.
+    */
 
-static inline void fc_solve_move_stack_swallow_stack(
-    fcs_move_stack_t *const stack, fcs_move_stack_t *const src_stack)
-{
-    fcs_internal_move_t move;
-    while (!fc_solve_move_stack_pop(src_stack, &move))
+    static inline fcs_move_stack_t fcs_move_stack__new(void)
     {
-        fcs_move_stack_push(stack, move);
+        return (fcs_move_stack_t){.num_moves = 0,
+            .moves = malloc(sizeof(fcs_move_t) * FCS_MOVE_STACK_GROW_BY)};
     }
-}
 
-static inline void fc_solve_move_stack_normalize(fcs_move_stack_t *const moves,
-    const fcs_state_keyval_pair_t *const init_state,
-    fcs_state_locs_struct_t *const locs FREECELLS_AND_STACKS_ARGS())
-{
-    fcs_internal_move_t in_move;
-    fcs_state_keyval_pair_t s_and_info;
-    DECLARE_IND_BUF_T(indirect_stacks_buffer)
-    fcs_internal_move_t out_move = fc_solve_empty_move;
-    FCS_STATE__DUP_keyval_pair(s_and_info, *init_state);
-
-#ifdef INDIRECT_STACK_STATES
-    for (size_t i = 0; i < STACKS_NUM__VAL; i++)
+    static inline void fc_solve_move_stack_swallow_stack(
+        fcs_move_stack_t *const stack, fcs_move_stack_t *const src_stack)
     {
-        fcs_copy_stack(
-            s_and_info.s, s_and_info.info, i, indirect_stacks_buffer);
+        fcs_internal_move_t move;
+        while (!fc_solve_move_stack_pop(src_stack, &move))
+        {
+            fcs_move_stack_push(stack, move);
+        }
     }
-#endif
-
-    fcs_move_stack_t temp_moves = fcs_move_stack__new();
 
-    while (!fc_solve_move_stack_pop(moves, &in_move))
+    static inline void fc_solve_move_stack_normalize(
+        fcs_move_stack_t *const moves,
+        const fcs_state_keyval_pair_t *const init_state,
+        fcs_state_locs_struct_t *const locs FREECELLS_AND_STACKS_ARGS())
     {
-        fc_solve_apply_move(&(s_and_info.s), locs,
-            in_move PASS_FREECELLS(freecells_num) PASS_STACKS(stacks_num));
+        fcs_internal_move_t in_move;
+        fcs_state_keyval_pair_t s_and_info;
+        DECLARE_IND_BUF_T(indirect_stacks_buffer)
+        fcs_internal_move_t out_move = fc_solve_empty_move;
+        FCS_STATE__DUP_keyval_pair(s_and_info, *init_state);
 
-        const int move_type = fcs_int_move_get_type(in_move);
-
-        if (move_type == FCS_MOVE_TYPE_CANONIZE)
+#ifdef INDIRECT_STACK_STATES
+        for (size_t i = 0; i < STACKS_NUM__VAL; i++)
         {
-            continue;
+            fcs_copy_stack(
+                s_and_info.s, s_and_info.info, i, indirect_stacks_buffer);
         }
+#endif
 
-        fcs_int_move_set_type(out_move, move_type);
+        fcs_move_stack_t temp_moves = fcs_move_stack__new();
 
-        switch (move_type)
+        while (!fc_solve_move_stack_pop(moves, &in_move))
         {
-        case FCS_MOVE_TYPE_STACK_TO_STACK:
-        case FCS_MOVE_TYPE_STACK_TO_FREECELL:
-        case FCS_MOVE_TYPE_STACK_TO_FOUNDATION:
-        case FCS_MOVE_TYPE_SEQ_TO_FOUNDATION:
-            fcs_int_move_set_src(
-                out_move, locs->stack_locs[(int)fcs_int_move_get_src(in_move)]);
-            break;
-        case FCS_MOVE_TYPE_FREECELL_TO_STACK:
-        case FCS_MOVE_TYPE_FREECELL_TO_FREECELL:
-        case FCS_MOVE_TYPE_FREECELL_TO_FOUNDATION:
-            fcs_int_move_set_src(
-                out_move, locs->fc_locs[(int)fcs_int_move_get_src(in_move)]);
-            break;
-        default:
-            break;
+            fc_solve_apply_move(&(s_and_info.s), locs,
+                in_move PASS_FREECELLS(freecells_num) PASS_STACKS(stacks_num));
+
+            const int move_type = fcs_int_move_get_type(in_move);
+
+            if (move_type == FCS_MOVE_TYPE_CANONIZE)
+            {
+                continue;
+            }
+
+            fcs_int_move_set_type(out_move, move_type);
+
+            switch (move_type)
+            {
+            case FCS_MOVE_TYPE_STACK_TO_STACK:
+            case FCS_MOVE_TYPE_STACK_TO_FREECELL:
+            case FCS_MOVE_TYPE_STACK_TO_FOUNDATION:
+            case FCS_MOVE_TYPE_SEQ_TO_FOUNDATION:
+                fcs_int_move_set_src(out_move,
+                    locs->stack_locs[(int)fcs_int_move_get_src(in_move)]);
+                break;
+            case FCS_MOVE_TYPE_FREECELL_TO_STACK:
+            case FCS_MOVE_TYPE_FREECELL_TO_FREECELL:
+            case FCS_MOVE_TYPE_FREECELL_TO_FOUNDATION:
+                fcs_int_move_set_src(out_move,
+                    locs->fc_locs[(int)fcs_int_move_get_src(in_move)]);
+                break;
+            default:
+                break;
+            }
+
+            switch (move_type)
+            {
+            case FCS_MOVE_TYPE_STACK_TO_STACK:
+            case FCS_MOVE_TYPE_FREECELL_TO_STACK:
+                fcs_int_move_set_dest(out_move,
+                    locs->stack_locs[(int)fcs_int_move_get_dest(in_move)]);
+                break;
+
+            case FCS_MOVE_TYPE_STACK_TO_FREECELL:
+            case FCS_MOVE_TYPE_FREECELL_TO_FREECELL:
+                fcs_int_move_set_dest(out_move,
+                    locs->fc_locs[(int)fcs_int_move_get_dest(in_move)]);
+                break;
+
+            case FCS_MOVE_TYPE_STACK_TO_FOUNDATION:
+            case FCS_MOVE_TYPE_FREECELL_TO_FOUNDATION:
+            case FCS_MOVE_TYPE_SEQ_TO_FOUNDATION:
+                fcs_int_move_set_dest(out_move, fcs_int_move_get_dest(in_move));
+                break;
+            default:
+                break;
+            }
+            if (move_type == FCS_MOVE_TYPE_STACK_TO_STACK)
+            {
+                fcs_int_move_set_num_cards_in_seq(
+                    out_move, fcs_int_move_get_num_cards_in_seq(in_move));
+            }
+
+            fcs_move_stack_push((&temp_moves), out_move);
         }
 
-        switch (move_type)
-        {
-        case FCS_MOVE_TYPE_STACK_TO_STACK:
-        case FCS_MOVE_TYPE_FREECELL_TO_STACK:
-            fcs_int_move_set_dest(out_move,
-                locs->stack_locs[(int)fcs_int_move_get_dest(in_move)]);
-            break;
-
-        case FCS_MOVE_TYPE_STACK_TO_FREECELL:
-        case FCS_MOVE_TYPE_FREECELL_TO_FREECELL:
-            fcs_int_move_set_dest(
-                out_move, locs->fc_locs[(int)fcs_int_move_get_dest(in_move)]);
-            break;
-
-        case FCS_MOVE_TYPE_STACK_TO_FOUNDATION:
-        case FCS_MOVE_TYPE_FREECELL_TO_FOUNDATION:
-        case FCS_MOVE_TYPE_SEQ_TO_FOUNDATION:
-            fcs_int_move_set_dest(out_move, fcs_int_move_get_dest(in_move));
-            break;
-        default:
-            break;
-        }
-        if (move_type == FCS_MOVE_TYPE_STACK_TO_STACK)
-        {
-            fcs_int_move_set_num_cards_in_seq(
-                out_move, fcs_int_move_get_num_cards_in_seq(in_move));
-        }
+        /*
+         * temp_moves contain the needed moves in reverse order. So let's use
+         * swallow_stack to put them in the original in the correct order.
+         *
+         * */
+        fcs_move_stack_reset(moves);
 
-        fcs_move_stack_push((&temp_moves), out_move);
+        fc_solve_move_stack_swallow_stack(moves, (&temp_moves));
+        fcs_move_stack_static_destroy(temp_moves);
     }
 
-    /*
-     * temp_moves contain the needed moves in reverse order. So let's use
-     * swallow_stack to put them in the original in the correct order.
-     *
-     * */
-    fcs_move_stack_reset(moves);
-
-    fc_solve_move_stack_swallow_stack(moves, (&temp_moves));
-    fcs_move_stack_static_destroy(temp_moves);
-}
-
-static inline int fc_solve_move__convert_freecell_num(const int fc_idx)
-{
-    return (fc_idx >= 7) ? (fc_idx + 3) : fc_idx;
-}
+    static inline int fc_solve_move__convert_freecell_num(const int fc_idx)
+    {
+        return (fc_idx >= 7) ? (fc_idx + 3) : fc_idx;
+    }
 
-static inline char fc_solve__freecell_to_char(const int fc_idx)
-{
-    return 'a' + fc_solve_move__convert_freecell_num(fc_idx);
-}
-static inline void fc_solve_move_to_string_w_state(char *const string,
-    fcs_state_keyval_pair_t *const state, const fcs_move_t move,
-    const int standard_notation)
-{
-#define state_key (&(state->s))
-    switch (fcs_move_get_type(move))
+    static inline char fc_solve__freecell_to_char(const int fc_idx)
     {
-    case FCS_MOVE_TYPE_STACK_TO_STACK:
-        if ((standard_notation == FC_SOLVE__STANDARD_NOTATION_EXTENDED) &&
-            /* More than one card was moved */
-            (fcs_move_get_num_cards_in_seq(move) > 1) &&
-            /* It was a move to an empty stack */
-            (fcs_state_col_len(*state_key, fcs_move_get_dest_stack(move)) ==
-                fcs_move_get_num_cards_in_seq(move)))
-        {
-            sprintf(string, "%d%dv%x", 1 + fcs_move_get_src_stack(move),
-                1 + fcs_move_get_dest_stack(move),
-                fcs_move_get_num_cards_in_seq(move));
-        }
-        else if (standard_notation)
-        {
-            sprintf(string, "%d%d", 1 + fcs_move_get_src_stack(move),
-                1 + fcs_move_get_dest_stack(move));
-        }
-        else
+        return 'a' + fc_solve_move__convert_freecell_num(fc_idx);
+    }
+    static inline void fc_solve_move_to_string_w_state(char *const string,
+        fcs_state_keyval_pair_t *const state, const fcs_move_t move,
+        const int standard_notation)
+    {
+#define state_key (&(state->s))
+        switch (fcs_move_get_type(move))
         {
-            sprintf(string, "Move %d cards from stack %d to stack %d",
-                fcs_move_get_num_cards_in_seq(move),
-                fcs_move_get_src_stack(move), fcs_move_get_dest_stack(move));
-        }
-        break;
+        case FCS_MOVE_TYPE_STACK_TO_STACK:
+            if ((standard_notation == FC_SOLVE__STANDARD_NOTATION_EXTENDED) &&
+                /* More than one card was moved */
+                (fcs_move_get_num_cards_in_seq(move) > 1) &&
+                /* It was a move to an empty stack */
+                (fcs_state_col_len(*state_key, fcs_move_get_dest_stack(move)) ==
+                    fcs_move_get_num_cards_in_seq(move)))
+            {
+                sprintf(string, "%d%dv%x", 1 + fcs_move_get_src_stack(move),
+                    1 + fcs_move_get_dest_stack(move),
+                    fcs_move_get_num_cards_in_seq(move));
+            }
+            else if (standard_notation)
+            {
+                sprintf(string, "%d%d", 1 + fcs_move_get_src_stack(move),
+                    1 + fcs_move_get_dest_stack(move));
+            }
+            else
+            {
+                sprintf(string, "Move %d cards from stack %d to stack %d",
+                    fcs_move_get_num_cards_in_seq(move),
+                    fcs_move_get_src_stack(move),
+                    fcs_move_get_dest_stack(move));
+            }
+            break;
 
-    case FCS_MOVE_TYPE_FREECELL_TO_STACK:
-        if (standard_notation)
-        {
-            sprintf(string, "%c%i",
-                fc_solve__freecell_to_char(fcs_move_get_src_freecell(move)),
-                1 + fcs_move_get_dest_stack(move));
-        }
-        else
-        {
-            sprintf(string, "Move a card from freecell %i to stack %i",
-                fcs_move_get_src_freecell(move), fcs_move_get_dest_stack(move));
-        }
+        case FCS_MOVE_TYPE_FREECELL_TO_STACK:
+            if (standard_notation)
+            {
+                sprintf(string, "%c%i",
+                    fc_solve__freecell_to_char(fcs_move_get_src_freecell(move)),
+                    1 + fcs_move_get_dest_stack(move));
+            }
+            else
+            {
+                sprintf(string, "Move a card from freecell %i to stack %i",
+                    fcs_move_get_src_freecell(move),
+                    fcs_move_get_dest_stack(move));
+            }
 
-        break;
+            break;
 
-    case FCS_MOVE_TYPE_FREECELL_TO_FREECELL:
-        if (standard_notation)
-        {
-            sprintf(string, "%c%c",
-                fc_solve__freecell_to_char(fcs_move_get_src_freecell(move)),
-                fc_solve__freecell_to_char(fcs_move_get_dest_freecell(move)));
-        }
-        else
-        {
-            sprintf(string, "Move a card from freecell %i to freecell %i",
-                fcs_move_get_src_freecell(move),
-                fcs_move_get_dest_freecell(move));
-        }
+        case FCS_MOVE_TYPE_FREECELL_TO_FREECELL:
+            if (standard_notation)
+            {
+                sprintf(string, "%c%c",
+                    fc_solve__freecell_to_char(fcs_move_get_src_freecell(move)),
+                    fc_solve__freecell_to_char(
+                        fcs_move_get_dest_freecell(move)));
+            }
+            else
+            {
+                sprintf(string, "Move a card from freecell %i to freecell %i",
+                    fcs_move_get_src_freecell(move),
+                    fcs_move_get_dest_freecell(move));
+            }
 
-        break;
+            break;
 
-    case FCS_MOVE_TYPE_STACK_TO_FREECELL:
-        if (standard_notation)
-        {
-            sprintf(string, "%d%c", 1 + fcs_move_get_src_stack(move),
-                fc_solve__freecell_to_char(fcs_move_get_dest_freecell(move)));
-        }
-        else
-        {
-            sprintf(string, "Move a card from stack %d to freecell %d",
-                fcs_move_get_src_stack(move), fcs_move_get_dest_freecell(move));
-        }
+        case FCS_MOVE_TYPE_STACK_TO_FREECELL:
+            if (standard_notation)
+            {
+                sprintf(string, "%d%c", 1 + fcs_move_get_src_stack(move),
+                    fc_solve__freecell_to_char(
+                        fcs_move_get_dest_freecell(move)));
+            }
+            else
+            {
+                sprintf(string, "Move a card from stack %d to freecell %d",
+                    fcs_move_get_src_stack(move),
+                    fcs_move_get_dest_freecell(move));
+            }
 
-        break;
+            break;
 
-    case FCS_MOVE_TYPE_STACK_TO_FOUNDATION:
-        if (standard_notation)
-        {
-            sprintf(string, "%dh", 1 + fcs_move_get_src_stack(move));
-        }
-        else
-        {
-            sprintf(string, "Move a card from stack %d to the foundations",
-                fcs_move_get_src_stack(move));
-        }
+        case FCS_MOVE_TYPE_STACK_TO_FOUNDATION:
+            if (standard_notation)
+            {
+                sprintf(string, "%dh", 1 + fcs_move_get_src_stack(move));
+            }
+            else
+            {
+                sprintf(string, "Move a card from stack %d to the foundations",
+                    fcs_move_get_src_stack(move));
+            }
 
-        break;
+            break;
 
-    case FCS_MOVE_TYPE_FREECELL_TO_FOUNDATION:
-        if (standard_notation)
-        {
-            sprintf(string, "%ch",
-                fc_solve__freecell_to_char(fcs_move_get_src_freecell(move)));
-        }
-        else
-        {
-            sprintf(string, "Move a card from freecell %i to the foundations",
-                fcs_move_get_src_freecell(move));
-        }
+        case FCS_MOVE_TYPE_FREECELL_TO_FOUNDATION:
+            if (standard_notation)
+            {
+                sprintf(string, "%ch",
+                    fc_solve__freecell_to_char(
+                        fcs_move_get_src_freecell(move)));
+            }
+            else
+            {
+                sprintf(string,
+                    "Move a card from freecell %i to the foundations",
+                    fcs_move_get_src_freecell(move));
+            }
 
-        break;
+            break;
 
-    case FCS_MOVE_TYPE_SEQ_TO_FOUNDATION:
-        if (standard_notation)
-        {
-            sprintf(string, "%dh", fcs_move_get_src_stack(move));
-        }
-        else
-        {
-            sprintf(string,
-                "Move the sequence on top of Stack %d to the foundations",
-                fcs_move_get_src_stack(move));
-        }
-        break;
+        case FCS_MOVE_TYPE_SEQ_TO_FOUNDATION:
+            if (standard_notation)
+            {
+                sprintf(string, "%dh", fcs_move_get_src_stack(move));
+            }
+            else
+            {
+                sprintf(string,
+                    "Move the sequence on top of Stack %d to the foundations",
+                    fcs_move_get_src_stack(move));
+            }
+            break;
 
-    default:
-        string[0] = '\0';
-        break;
-    }
+        default:
+            string[0] = '\0';
+            break;
+        }
 #undef state_key
-}
+    }
 #define FCS__pass_moves(x) , x
 #else
 #define fcs_move_stack_params_push(a, b, c, d, e)
@@ -350,24 +361,24 @@ static inline void fc_solve_move_to_string_w_state(char *const string,
 
 #endif
 
-typedef struct
-{
-    fcs_collectible_state_t *state_ptr;
-    union {
-        void *ptr;
-        int i;
-        char c[sizeof(void *) / sizeof(char)];
-    } context;
-} fcs_derived_states_list_item_t;
-
-typedef struct
-{
-    size_t num_states;
-    fcs_derived_states_list_item_t *states;
-} fcs_derived_states_list_t;
+    typedef struct
+    {
+        fcs_collectible_state_t *state_ptr;
+        union {
+            void *ptr;
+            int i;
+            char c[sizeof(void *) / sizeof(char)];
+        } context;
+    } fcs_derived_states_list_item_t;
+
+    typedef struct
+    {
+        size_t num_states;
+        fcs_derived_states_list_item_t *states;
+    } fcs_derived_states_list_t;
 
-extern void fc_solve_derived_states_list_add_state(
-    fcs_derived_states_list_t *, fcs_collectible_state_t *, int);
+    extern void fc_solve_derived_states_list_add_state(
+        fcs_derived_states_list_t *, fcs_collectible_state_t *, int);
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/move_funcs_order.h b/fc-solve/source/move_funcs_order.h
index 6d285fc06..8e1d85fa4 100644
--- a/fc-solve/source/move_funcs_order.h
+++ b/fc-solve/source/move_funcs_order.h
@@ -11,19 +11,20 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "fcs_back_compat.h"
 #include "instance.h"
 
-static inline int fc_solve_string_to_move_num(const char needle)
-{
-    return fc_solve_sfs_move_funcs_aliases[(size_t)(uint8_t)needle];
-}
+    static inline int fc_solve_string_to_move_num(const char needle)
+    {
+        return fc_solve_sfs_move_funcs_aliases[(size_t)(uint8_t)needle];
+    }
 
-extern int fc_solve_apply_moves_order(
-    fcs_moves_order *, const char *FCS__PASS_ERR_STR(char *));
+    extern int fc_solve_apply_moves_order(
+        fcs_moves_order *, const char *FCS__PASS_ERR_STR(char *));
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/offloading_queue.h b/fc-solve/source/offloading_queue.h
index 51015793b..2d9a3cf01 100644
--- a/fc-solve/source/offloading_queue.h
+++ b/fc-solve/source/offloading_queue.h
@@ -11,7 +11,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "rinutils.h"
@@ -19,119 +20,120 @@ extern "C" {
 #include <fcntl.h>
 #endif
 
-typedef const unsigned char *fcs_offloading_queue_item_t;
+    typedef const unsigned char *fcs_offloading_queue_item_t;
 
-typedef struct
-{
-    long num_inserted, num_items_in_queue, num_extracted;
-} fcs_queue_stats_t;
+    typedef struct
+    {
+        long num_inserted, num_items_in_queue, num_extracted;
+    } fcs_queue_stats_t;
 
-static inline void fcs_queue_stats_init(fcs_queue_stats_t *const q)
-{
-    *q = (typeof(*q)){
-        .num_inserted = 0, .num_items_in_queue = 0, .num_extracted = 0};
-}
+    static inline void fcs_queue_stats_init(fcs_queue_stats_t *const q)
+    {
+        *q = (typeof(*q)){
+            .num_inserted = 0, .num_items_in_queue = 0, .num_extracted = 0};
+    }
 
-static inline void q_stats_insert(fcs_queue_stats_t *const q)
-{
-    q->num_inserted++;
-    q->num_items_in_queue++;
-}
+    static inline void q_stats_insert(fcs_queue_stats_t *const q)
+    {
+        q->num_inserted++;
+        q->num_items_in_queue++;
+    }
 
-static inline void q_stats_extract(fcs_queue_stats_t *const q)
-{
-    q->num_items_in_queue--;
-    q->num_extracted++;
-}
+    static inline void q_stats_extract(fcs_queue_stats_t *const q)
+    {
+        q->num_items_in_queue--;
+        q->num_extracted++;
+    }
 
-static inline fcs_bool_t q_stats_is_empty(fcs_queue_stats_t *const q)
-{
-    return (q->num_items_in_queue == 0);
-}
+    static inline fcs_bool_t q_stats_is_empty(fcs_queue_stats_t *const q)
+    {
+        return (q->num_items_in_queue == 0);
+    }
 
 #if !defined(FCS_DBM_USE_OFFLOADING_QUEUE)
 
-typedef struct fcs_Q_item_wrapper_struct
-{
-    fcs_offloading_queue_item_t datum;
-    struct fcs_Q_item_wrapper_struct *next;
-} fcs_Q_item_wrapper_t;
-
-typedef struct
-{
-    fcs_compact_allocator_t queue_allocator;
-    fcs_Q_item_wrapper_t *queue_head, *queue_tail, *queue_recycle_bin;
-    fcs_queue_stats_t stats;
-} fcs_offloading_queue_t;
-
-static inline void fcs_offloading_queue__init(
-    fcs_offloading_queue_t *const queue,
-    fcs_meta_compact_allocator_t *const meta_alloc)
-{
-    fc_solve_compact_allocator_init(&(queue->queue_allocator), meta_alloc);
-
-    queue->queue_head = queue->queue_tail = queue->queue_recycle_bin = NULL;
-    fcs_queue_stats_init(&queue->stats);
-}
+    typedef struct fcs_Q_item_wrapper_struct
+    {
+        fcs_offloading_queue_item_t datum;
+        struct fcs_Q_item_wrapper_struct *next;
+    } fcs_Q_item_wrapper_t;
 
-static inline void fcs_offloading_queue__destroy(
-    fcs_offloading_queue_t *const queue)
-{
-    fc_solve_compact_allocator_finish(&(queue->queue_allocator));
-}
+    typedef struct
+    {
+        fcs_compact_allocator_t queue_allocator;
+        fcs_Q_item_wrapper_t *queue_head, *queue_tail, *queue_recycle_bin;
+        fcs_queue_stats_t stats;
+    } fcs_offloading_queue_t;
+
+    static inline void fcs_offloading_queue__init(
+        fcs_offloading_queue_t *const queue,
+        fcs_meta_compact_allocator_t *const meta_alloc)
+    {
+        fc_solve_compact_allocator_init(&(queue->queue_allocator), meta_alloc);
 
-static inline fcs_bool_t fcs_offloading_queue__extract(
-    fcs_offloading_queue_t *const queue,
-    fcs_offloading_queue_item_t *const return_item)
-{
-    fcs_Q_item_wrapper_t *const item = queue->queue_head;
+        queue->queue_head = queue->queue_tail = queue->queue_recycle_bin = NULL;
+        fcs_queue_stats_init(&queue->stats);
+    }
 
-    if (!item)
+    static inline void fcs_offloading_queue__destroy(
+        fcs_offloading_queue_t *const queue)
     {
-        *return_item = NULL;
-        return FALSE;
+        fc_solve_compact_allocator_finish(&(queue->queue_allocator));
     }
 
-    *return_item = item->datum;
-
-    if (!(queue->queue_head = item->next))
+    static inline fcs_bool_t fcs_offloading_queue__extract(
+        fcs_offloading_queue_t *const queue,
+        fcs_offloading_queue_item_t *const return_item)
     {
-        queue->queue_tail = NULL;
-    }
-    item->next = queue->queue_recycle_bin;
-    queue->queue_recycle_bin = item;
+        fcs_Q_item_wrapper_t *const item = queue->queue_head;
 
-    q_stats_extract(&queue->stats);
-    return TRUE;
-}
+        if (!item)
+        {
+            *return_item = NULL;
+            return FALSE;
+        }
 
-static inline void fcs_offloading_queue__insert(
-    fcs_offloading_queue_t *const queue,
-    const fcs_offloading_queue_item_t *const datum)
-{
-    fcs_Q_item_wrapper_t *new_item;
-    if (queue->queue_recycle_bin)
-    {
-        queue->queue_recycle_bin = (new_item = queue->queue_recycle_bin)->next;
-    }
-    else
-    {
-        new_item = (fcs_Q_item_wrapper_t *)fcs_compact_alloc_ptr(
-            &(queue->queue_allocator), sizeof(*new_item));
-    }
-    new_item->datum = *datum;
-    new_item->next = NULL;
+        *return_item = item->datum;
 
-    if (queue->queue_tail)
-    {
-        queue->queue_tail = queue->queue_tail->next = new_item;
+        if (!(queue->queue_head = item->next))
+        {
+            queue->queue_tail = NULL;
+        }
+        item->next = queue->queue_recycle_bin;
+        queue->queue_recycle_bin = item;
+
+        q_stats_extract(&queue->stats);
+        return TRUE;
     }
-    else
+
+    static inline void fcs_offloading_queue__insert(
+        fcs_offloading_queue_t *const queue,
+        const fcs_offloading_queue_item_t *const datum)
     {
-        queue->queue_head = queue->queue_tail = new_item;
+        fcs_Q_item_wrapper_t *new_item;
+        if (queue->queue_recycle_bin)
+        {
+            queue->queue_recycle_bin =
+                (new_item = queue->queue_recycle_bin)->next;
+        }
+        else
+        {
+            new_item = (fcs_Q_item_wrapper_t *)fcs_compact_alloc_ptr(
+                &(queue->queue_allocator), sizeof(*new_item));
+        }
+        new_item->datum = *datum;
+        new_item->next = NULL;
+
+        if (queue->queue_tail)
+        {
+            queue->queue_tail = queue->queue_tail->next = new_item;
+        }
+        else
+        {
+            queue->queue_head = queue->queue_tail = new_item;
+        }
+        q_stats_insert(&queue->stats);
     }
-    q_stats_insert(&queue->stats);
-}
 
 #else
 
diff --git a/fc-solve/source/output_to_file.h b/fc-solve/source/output_to_file.h
index d272f87f1..0a34ea786 100644
--- a/fc-solve/source/output_to_file.h
+++ b/fc-solve/source/output_to_file.h
@@ -11,146 +11,150 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "rinutils.h"
 #include "fcs_enums.h"
 #include "fcs_user.h"
 
-typedef struct
-{
-    const char *output_filename;
-    int standard_notation;
-    fcs_bool_t debug_iter_state_output;
+    typedef struct
+    {
+        const char *output_filename;
+        int standard_notation;
+        fcs_bool_t debug_iter_state_output;
 #ifndef FC_SOLVE_IMPLICIT_PARSABLE_OUTPUT
-    fcs_bool_t parseable_output;
+        fcs_bool_t parseable_output;
 #endif
-    fcs_bool_t canonized_order_output;
+        fcs_bool_t canonized_order_output;
 #ifndef FC_SOLVE_IMPLICIT_T_RANK
-    fcs_bool_t display_10_as_t;
+        fcs_bool_t display_10_as_t;
 #endif
-    fcs_bool_t display_parent_iter_num;
-    fcs_bool_t display_moves;
-    fcs_bool_t display_states;
-    fcs_bool_t show_exceeded_limits;
-} fc_solve_display_information_context_t;
-
-static const fc_solve_display_information_context_t INITIAL_DISPLAY_CONTEXT = {
-    .debug_iter_state_output = FALSE,
+        fcs_bool_t display_parent_iter_num;
+        fcs_bool_t display_moves;
+        fcs_bool_t display_states;
+        fcs_bool_t show_exceeded_limits;
+    } fc_solve_display_information_context_t;
+
+    static const fc_solve_display_information_context_t
+        INITIAL_DISPLAY_CONTEXT = {.debug_iter_state_output = FALSE,
 #ifndef FC_SOLVE_IMPLICIT_PARSABLE_OUTPUT
-    .parseable_output = FALSE,
+            .parseable_output = FALSE,
 #endif
-    .canonized_order_output = FALSE,
+            .canonized_order_output = FALSE,
 #ifndef FC_SOLVE_IMPLICIT_T_RANK
-    .display_10_as_t = FALSE,
+            .display_10_as_t = FALSE,
 #endif
-    .display_parent_iter_num = FALSE,
-    .display_moves = FALSE,
-    .display_states = TRUE,
-    .standard_notation = FC_SOLVE__STANDARD_NOTATION_NO,
-    .output_filename = NULL,
-    .show_exceeded_limits = FALSE};
-
-static inline void fc_solve_output_result_to_file(FILE *const output_fh,
-    void *const instance, const int ret,
-    const fc_solve_display_information_context_t *const dc_ptr)
-{
-    const_AUTO(display_context, (*dc_ptr));
-    if (ret == FCS_STATE_WAS_SOLVED)
+            .display_parent_iter_num = FALSE,
+            .display_moves = FALSE,
+            .display_states = TRUE,
+            .standard_notation = FC_SOLVE__STANDARD_NOTATION_NO,
+            .output_filename = NULL,
+            .show_exceeded_limits = FALSE};
+
+    static inline void fc_solve_output_result_to_file(FILE *const output_fh,
+        void *const instance, const int ret,
+        const fc_solve_display_information_context_t *const dc_ptr)
     {
-        fputs("-=-=-=-=-=-=-=-=-=-=-=-\n\n", output_fh);
+        const_AUTO(display_context, (*dc_ptr));
+        if (ret == FCS_STATE_WAS_SOLVED)
+        {
+            fputs("-=-=-=-=-=-=-=-=-=-=-=-\n\n", output_fh);
 #ifdef FCS_WITH_MOVES
-        fcs_move_t move;
-        char state_as_string[1000];
+            fcs_move_t move;
+            char state_as_string[1000];
 
-        if (display_context.display_states)
-        {
-            freecell_solver_user_current_state_stringify(instance,
-                state_as_string FC_SOLVE__PASS_PARSABLE(
-                    display_context.parseable_output),
-                display_context.canonized_order_output FC_SOLVE__PASS_T(
-                    display_context.display_10_as_t));
-
-            fputs(state_as_string, output_fh);
-            fputs("\n\n====================\n\n", output_fh);
-        }
+            if (display_context.display_states)
+            {
+                freecell_solver_user_current_state_stringify(instance,
+                    state_as_string FC_SOLVE__PASS_PARSABLE(
+                        display_context.parseable_output),
+                    display_context.canonized_order_output FC_SOLVE__PASS_T(
+                        display_context.display_10_as_t));
 
-        int move_num = 0;
-        while (freecell_solver_user_get_next_move(instance, &move) == 0)
-        {
-            if (display_context.display_moves)
+                fputs(state_as_string, output_fh);
+                fputs("\n\n====================\n\n", output_fh);
+            }
+
+            int move_num = 0;
+            while (freecell_solver_user_get_next_move(instance, &move) == 0)
             {
-                if (display_context.display_states &&
-                    display_context.standard_notation)
+                if (display_context.display_moves)
                 {
-                    fputs("Move: ", output_fh);
-                }
+                    if (display_context.display_states &&
+                        display_context.standard_notation)
+                    {
+                        fputs("Move: ", output_fh);
+                    }
 
-                freecell_solver_user_stringify_move_w_state(instance,
-                    state_as_string, move, display_context.standard_notation);
-                fprintf(output_fh,
-                    (display_context.standard_notation ? "%s " : "%s\n"),
-                    state_as_string);
-                move_num++;
-                if (display_context.standard_notation)
-                {
-                    if ((move_num % 10 == 0) || display_context.display_states)
+                    freecell_solver_user_stringify_move_w_state(instance,
+                        state_as_string, move,
+                        display_context.standard_notation);
+                    fprintf(output_fh,
+                        (display_context.standard_notation ? "%s " : "%s\n"),
+                        state_as_string);
+                    move_num++;
+                    if (display_context.standard_notation)
+                    {
+                        if ((move_num % 10 == 0) ||
+                            display_context.display_states)
+                        {
+                            putc('\n', output_fh);
+                        }
+                    }
+                    if (display_context.display_states)
                     {
                         putc('\n', output_fh);
                     }
+                    fflush(output_fh);
                 }
+
                 if (display_context.display_states)
                 {
-                    putc('\n', output_fh);
-                }
-                fflush(output_fh);
-            }
+                    freecell_solver_user_current_state_stringify(instance,
+                        state_as_string FC_SOLVE__PASS_PARSABLE(
+                            display_context.parseable_output),
+                        display_context.canonized_order_output FC_SOLVE__PASS_T(
+                            display_context.display_10_as_t));
 
-            if (display_context.display_states)
-            {
-                freecell_solver_user_current_state_stringify(instance,
-                    state_as_string FC_SOLVE__PASS_PARSABLE(
-                        display_context.parseable_output),
-                    display_context.canonized_order_output FC_SOLVE__PASS_T(
-                        display_context.display_10_as_t));
+                    fprintf(output_fh, "%s\n", state_as_string);
+                }
 
-                fprintf(output_fh, "%s\n", state_as_string);
+                if (display_context.display_states ||
+                    (!display_context.standard_notation))
+                {
+                    fputs("\n====================\n\n", output_fh);
+                }
             }
 
-            if (display_context.display_states ||
-                (!display_context.standard_notation))
+            if (display_context.standard_notation &&
+                (!display_context.display_states))
             {
-                fputs("\n====================\n\n", output_fh);
+                fputs("\n\n", output_fh);
             }
-        }
+#endif
 
-        if (display_context.standard_notation &&
-            (!display_context.display_states))
+            fputs("This game is solveable.\n", output_fh);
+        }
+        else if (display_context.show_exceeded_limits &&
+                 (ret == FCS_STATE_SUSPEND_PROCESS))
         {
-            fputs("\n\n", output_fh);
+            fputs("Iterations count exceeded.\n", output_fh);
+        }
+        else
+        {
+            fputs("I could not solve this game.\n", output_fh);
         }
-#endif
-
-        fputs("This game is solveable.\n", output_fh);
-    }
-    else if (display_context.show_exceeded_limits &&
-             (ret == FCS_STATE_SUSPEND_PROCESS))
-    {
-        fputs("Iterations count exceeded.\n", output_fh);
-    }
-    else
-    {
-        fputs("I could not solve this game.\n", output_fh);
-    }
 
-    fprintf(output_fh, "Total number of states checked is %ld.\n",
-        (long)freecell_solver_user_get_num_times_long(instance));
+        fprintf(output_fh, "Total number of states checked is %ld.\n",
+            (long)freecell_solver_user_get_num_times_long(instance));
 #ifndef FCS_DISABLE_NUM_STORED_STATES
-    fprintf(output_fh, "This scan generated %ld states.\n",
-        (long)freecell_solver_user_get_num_states_in_collection_long(instance));
+        fprintf(output_fh, "This scan generated %ld states.\n",
+            (long)freecell_solver_user_get_num_states_in_collection_long(
+                instance));
 #endif
-}
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/portable_time.h b/fc-solve/source/portable_time.h
index 7efc63984..df9af462f 100644
--- a/fc-solve/source/portable_time.h
+++ b/fc-solve/source/portable_time.h
@@ -11,7 +11,8 @@
 // routines. Works on Win32 and UNIX-like systems.
 #pragma once
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "typeof_wrap.h"
@@ -20,11 +21,11 @@ extern "C" {
 #ifndef WIN32
 #include <sys/time.h>
 
-typedef struct
-{
-    struct timeval tv;
-    struct timezone tz;
-} fcs_portable_time_t;
+    typedef struct
+    {
+        struct timeval tv;
+        struct timezone tz;
+    } fcs_portable_time_t;
 
 #define FCS_GET_TIME(pt) gettimeofday(&((pt).tv), &((pt).tz))
 #define FCS_TIME_GET_SEC(pt) ((long long)((pt).tv.tv_sec))
@@ -49,50 +50,51 @@ typedef struct
 #define FCS_LL9_FMT "%09I64d"
 #endif
 
-static inline fcs_portable_time_t fcs_get_time(void)
-{
-    fcs_portable_time_t ret;
-    FCS_GET_TIME(ret);
-    return ret;
-}
+    static inline fcs_portable_time_t fcs_get_time(void)
+    {
+        fcs_portable_time_t ret;
+        FCS_GET_TIME(ret);
+        return ret;
+    }
 #define FCS_T_FMT FCS_LL_FMT "." FCS_LL6_FMT
 #define FCS_B_AT_FMT "Board No. " FCS_LL_FMT " at " FCS_T_FMT
-static inline void fc_solve_print_intractable(const long long board_num)
-{
-    const_AUTO(mytime, fcs_get_time());
-    printf("Intractable " FCS_B_AT_FMT "\n", board_num,
-        FCS_TIME_GET_SEC(mytime), FCS_TIME_GET_USEC(mytime));
-}
+    static inline void fc_solve_print_intractable(const long long board_num)
+    {
+        const_AUTO(mytime, fcs_get_time());
+        printf("Intractable " FCS_B_AT_FMT "\n", board_num,
+            FCS_TIME_GET_SEC(mytime), FCS_TIME_GET_USEC(mytime));
+    }
 
-static inline void fc_solve_print_unsolved(const long long board_num)
-{
-    const_AUTO(mytime, fcs_get_time());
-    printf("Unsolved " FCS_B_AT_FMT "\n", board_num, FCS_TIME_GET_SEC(mytime),
-        FCS_TIME_GET_USEC(mytime));
-}
+    static inline void fc_solve_print_unsolved(const long long board_num)
+    {
+        const_AUTO(mytime, fcs_get_time());
+        printf("Unsolved " FCS_B_AT_FMT "\n", board_num,
+            FCS_TIME_GET_SEC(mytime), FCS_TIME_GET_USEC(mytime));
+    }
 
-static inline void fc_solve_print_started_at(void)
-{
-    const_AUTO(mytime, fcs_get_time());
-    printf("Started at " FCS_T_FMT "\n", FCS_TIME_GET_SEC(mytime),
-        FCS_TIME_GET_USEC(mytime));
-}
+    static inline void fc_solve_print_started_at(void)
+    {
+        const_AUTO(mytime, fcs_get_time());
+        printf("Started at " FCS_T_FMT "\n", FCS_TIME_GET_SEC(mytime),
+            FCS_TIME_GET_USEC(mytime));
+    }
 
-static inline void fc_solve_print_reached(
-    const long long board_num, const long long total_num_iters)
-{
-    const_AUTO(mytime, fcs_get_time());
-    printf("Reached " FCS_B_AT_FMT " (total_num_iters=" FCS_LL_FMT ")\n",
-        board_num, FCS_TIME_GET_SEC(mytime), FCS_TIME_GET_USEC(mytime),
-        total_num_iters);
-}
+    static inline void fc_solve_print_reached(
+        const long long board_num, const long long total_num_iters)
+    {
+        const_AUTO(mytime, fcs_get_time());
+        printf("Reached " FCS_B_AT_FMT " (total_num_iters=" FCS_LL_FMT ")\n",
+            board_num, FCS_TIME_GET_SEC(mytime), FCS_TIME_GET_USEC(mytime),
+            total_num_iters);
+    }
 
-static inline void fc_solve_print_finished(const long long total_num_iters)
-{
-    const_AUTO(mytime, fcs_get_time());
-    printf(("Finished at " FCS_T_FMT " (total_num_iters=" FCS_LL_FMT ")\n"),
-        FCS_TIME_GET_SEC(mytime), FCS_TIME_GET_USEC(mytime), total_num_iters);
-}
+    static inline void fc_solve_print_finished(const long long total_num_iters)
+    {
+        const_AUTO(mytime, fcs_get_time());
+        printf(("Finished at " FCS_T_FMT " (total_num_iters=" FCS_LL_FMT ")\n"),
+            FCS_TIME_GET_SEC(mytime), FCS_TIME_GET_USEC(mytime),
+            total_num_iters);
+    }
 
 #ifdef __cplusplus
 };
diff --git a/fc-solve/source/pqueue.h b/fc-solve/source/pqueue.h
index 66a3d6bc0..8e157dd52 100644
--- a/fc-solve/source/pqueue.h
+++ b/fc-solve/source/pqueue.h
@@ -38,30 +38,31 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "state.h"
 
 #define FC_SOLVE_PQUEUE_MaxRating INT_MAX
-typedef int pq_rating_t;
-typedef struct
-{
-    fcs_collectible_state_t *val;
-    pq_rating_t rating;
-} pq_element_t;
+    typedef int pq_rating_t;
+    typedef struct
+    {
+        fcs_collectible_state_t *val;
+        pq_rating_t rating;
+    } pq_element_t;
 
-static inline pq_rating_t fcs_pq_rating(const pq_element_t elem)
-{
-    return elem.rating;
-}
+    static inline pq_rating_t fcs_pq_rating(const pq_element_t elem)
+    {
+        return elem.rating;
+    }
 
-typedef struct
-{
-    size_t max_size;
-    size_t current_size;
-    pq_element_t *elems; /* pointer to void pointers */
-} pri_queue_t;
+    typedef struct
+    {
+        size_t max_size;
+        size_t current_size;
+        pq_element_t *elems; /* pointer to void pointers */
+    } pri_queue_t;
 
 /* given an index to any element in a binary tree stored in a linear array with
    the root at 1 and
@@ -73,124 +74,124 @@ typedef struct
 
 /* left and right children are index * 2 and (index * 2) +1 respectively */
 #define PQ_LEFT_CHILD_INDEX(i) ((i) << 1)
-/* initialise the priority queue with a maximum size of maxelements.
-   maxrating is the highest or lowest value of an entry in the pqueue
-   depending on whether it is ascending or descending respectively. Finally
-   the bool32 tells you whether the list is sorted ascending or
-   descending... */
-
-static inline void fc_solve_pq_init(pri_queue_t *const pq)
-{
-    pq->current_size = 0;
-    pq->elems = SMALLOC(pq->elems, (pq->max_size = 1024) + 1);
-}
-
-static inline void fc_solve_PQueueFree(pri_queue_t *const pq)
-{
-    free(pq->elems);
-    pq->elems = NULL;
-}
-
-/* Join a priority queue
-   "r" is the rating of the item you're adding for sorting purposes */
+    /* initialise the priority queue with a maximum size of maxelements.
+       maxrating is the highest or lowest value of an entry in the pqueue
+       depending on whether it is ascending or descending respectively. Finally
+       the bool32 tells you whether the list is sorted ascending or
+       descending... */
 
-static inline void fc_solve_pq_push(pri_queue_t *const pq,
-    fcs_collectible_state_t *const val, const pq_rating_t r)
-{
-    var_AUTO(i, ++(pq->current_size));
+    static inline void fc_solve_pq_init(pri_queue_t *const pq)
+    {
+        pq->current_size = 0;
+        pq->elems = SMALLOC(pq->elems, (pq->max_size = 1024) + 1);
+    }
 
-    if (i > pq->max_size)
+    static inline void fc_solve_PQueueFree(pri_queue_t *const pq)
     {
-        pq->elems =
-            (pq_element_t *)SREALLOC(pq->elems, (pq->max_size += 256) + 1);
+        free(pq->elems);
+        pq->elems = NULL;
     }
 
-    const_SLOT(elems, pq);
-    /* set i to the first unused element and increment current_size */
-    /* while the parent of the space we're putting the new node into is
-       worse than
-       our new node, swap the space with the worse node. We keep doing that
-       until we
-       get to a worse node or until we get to the top
-
-       note that we also can sort so that the minimum elements bubble up so
-       we need to loops
-       with the comparison operator flipped... */
-
-    while (
-        (i == PQ_FIRST_ENTRY ? (FC_SOLVE_PQUEUE_MaxRating) /* return biggest
-                                                              possible rating if
-                                                              first element */
-                             : (fcs_pq_rating(elems[PQ_PARENT_INDEX(i)]))) < r)
+    /* Join a priority queue
+       "r" is the rating of the item you're adding for sorting purposes */
+
+    static inline void fc_solve_pq_push(pri_queue_t *const pq,
+        fcs_collectible_state_t *const val, const pq_rating_t r)
     {
-        elems[i] = elems[PQ_PARENT_INDEX(i)];
+        var_AUTO(i, ++(pq->current_size));
 
-        i = PQ_PARENT_INDEX(i);
-    }
+        if (i > pq->max_size)
+        {
+            pq->elems =
+                (pq_element_t *)SREALLOC(pq->elems, (pq->max_size += 256) + 1);
+        }
 
-    /* then add the element at the space we created. */
-    elems[i].val = val;
-    elems[i].rating = r;
-}
+        const_SLOT(elems, pq);
+        /* set i to the first unused element and increment current_size */
+        /* while the parent of the space we're putting the new node into is
+           worse than
+           our new node, swap the space with the worse node. We keep doing that
+           until we
+           get to a worse node or until we get to the top
+
+           note that we also can sort so that the minimum elements bubble up so
+           we need to loops
+           with the comparison operator flipped... */
+
+        while ((i == PQ_FIRST_ENTRY
+                       ? (FC_SOLVE_PQUEUE_MaxRating) /* return biggest
+                                                        possible rating if
+                                                        first element */
+                       : (fcs_pq_rating(elems[PQ_PARENT_INDEX(i)]))) < r)
+        {
+            elems[i] = elems[PQ_PARENT_INDEX(i)];
 
-static inline fcs_bool_t fc_solve_is_pqueue_empty(pri_queue_t *pq)
-{
-    return (pq->current_size == 0);
-}
+            i = PQ_PARENT_INDEX(i);
+        }
 
-/* remove the first node from the pqueue and provide a pointer to it
- *
- * Returns 0 if found.
- * Returns 1 if not found.
- *
- * */
+        /* then add the element at the space we created. */
+        elems[i].val = val;
+        elems[i].rating = r;
+    }
 
-static inline void fc_solve_pq_pop(
-    pri_queue_t *const pq, fcs_collectible_state_t **const val)
-{
-    if (fc_solve_is_pqueue_empty(pq))
+    static inline fcs_bool_t fc_solve_is_pqueue_empty(pri_queue_t *pq)
     {
-        *val = NULL;
-        return;
+        return (pq->current_size == 0);
     }
-    const_SLOT(elems, pq);
-    const_SLOT(current_size, pq);
-    *val = elems[PQ_FIRST_ENTRY].val;
-
-    /* get pointer to last element in tree */
-    const_AUTO(last_elem, elems[current_size]);
 
-    const_AUTO(new_current_size, current_size - 1);
-    /* code to pop an element from an ascending (top to bottom) pqueue */
+    /* remove the first node from the pqueue and provide a pointer to it
+     *
+     * Returns 0 if found.
+     * Returns 1 if not found.
+     *
+     * */
 
-    /*  UNTESTED */
-
-    size_t i;
-    size_t child;
-    for (i = PQ_FIRST_ENTRY;
-         (child = PQ_LEFT_CHILD_INDEX(i)) <= new_current_size; i = child)
+    static inline void fc_solve_pq_pop(
+        pri_queue_t *const pq, fcs_collectible_state_t **const val)
     {
-        /* set child to the smaller of the two children... */
-
-        if ((child != new_current_size) &&
-            (fcs_pq_rating(elems[child + 1]) > fcs_pq_rating(elems[child])))
+        if (fc_solve_is_pqueue_empty(pq))
         {
-            child++;
+            *val = NULL;
+            return;
         }
+        const_SLOT(elems, pq);
+        const_SLOT(current_size, pq);
+        *val = elems[PQ_FIRST_ENTRY].val;
 
-        if (fcs_pq_rating(last_elem) < fcs_pq_rating(elems[child]))
-        {
-            elems[i] = elems[child];
-        }
-        else
+        /* get pointer to last element in tree */
+        const_AUTO(last_elem, elems[current_size]);
+
+        const_AUTO(new_current_size, current_size - 1);
+        /* code to pop an element from an ascending (top to bottom) pqueue */
+
+        /*  UNTESTED */
+
+        size_t i;
+        size_t child;
+        for (i = PQ_FIRST_ENTRY;
+             (child = PQ_LEFT_CHILD_INDEX(i)) <= new_current_size; i = child)
         {
-            break;
+            /* set child to the smaller of the two children... */
+
+            if ((child != new_current_size) &&
+                (fcs_pq_rating(elems[child + 1]) > fcs_pq_rating(elems[child])))
+            {
+                child++;
+            }
+
+            if (fcs_pq_rating(last_elem) < fcs_pq_rating(elems[child]))
+            {
+                elems[i] = elems[child];
+            }
+            else
+            {
+                break;
+            }
         }
-    }
 
-    elems[i] = last_elem;
-    pq->current_size = new_current_size;
-}
+        elems[i] = last_elem;
+        pq->current_size = new_current_size;
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/preset.h b/fc-solve/source/preset.h
index 7e104a5a4..d7e528b24 100644
--- a/fc-solve/source/preset.h
+++ b/fc-solve/source/preset.h
@@ -12,7 +12,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "config.h"
@@ -20,21 +21,21 @@ extern "C" {
 #ifndef FCS_FREECELL_ONLY
 #include "instance.h"
 
-typedef struct
-{
-    unsigned long long allowed_moves;
-    int preset_id;
+    typedef struct
+    {
+        unsigned long long allowed_moves;
+        int preset_id;
 
-    fcs_game_type_params_t game_params;
+        fcs_game_type_params_t game_params;
 
-    char moves_order[FCS_MOVE_FUNCS_NUM * 3 + 1];
-} fcs_preset_t;
+        char moves_order[FCS_MOVE_FUNCS_NUM * 3 + 1];
+    } fcs_preset_t;
 
-extern fc_solve_preset_ret_code_t fc_solve_apply_preset_by_ptr(
-    fc_solve_instance_t *, const fcs_preset_t *);
+    extern fc_solve_preset_ret_code_t fc_solve_apply_preset_by_ptr(
+        fc_solve_instance_t *, const fcs_preset_t *);
 
-extern fc_solve_preset_ret_code_t fc_solve_get_preset_by_name(
-    const char *, const fcs_preset_t **);
+    extern fc_solve_preset_ret_code_t fc_solve_get_preset_by_name(
+        const char *, const fcs_preset_t **);
 
 #define fcs_duplicate_preset(d, s) ((d) = (s))
 
diff --git a/fc-solve/source/pseudo_dfs_cache.h b/fc-solve/source/pseudo_dfs_cache.h
index a78d0c7e3..f519adc79 100644
--- a/fc-solve/source/pseudo_dfs_cache.h
+++ b/fc-solve/source/pseudo_dfs_cache.h
@@ -14,7 +14,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include <Judy.h>
@@ -24,140 +25,141 @@ extern "C" {
 #include "delta_states.h"
 #include "dbm_calc_derived_iface.h"
 
-typedef fcs_encoded_state_buffer_t fcs_pdfs_key_t;
+    typedef fcs_encoded_state_buffer_t fcs_pdfs_key_t;
 
-typedef struct fcs_pdfs_key_info_struct
-{
-    fcs_pdfs_key_t key;
-    /* lower_pri and higher_pri form a doubly linked list.
-     *
-     * pri == priority.
-     * */
-    struct fcs_pdfs_key_info_struct *lower_pri, *higher_pri;
-} fcs_pdfs_cache_key_info_t;
-
-typedef struct
-{
-    Pvoid_t states_values_to_keys_map;
-    fcs_compact_allocator_t states_values_to_keys_allocator;
-    long count_elements_in_cache, max_num_elements_in_cache;
-    fcs_pdfs_cache_key_info_t *lowest_pri, *highest_pri;
+    typedef struct fcs_pdfs_key_info_struct
+    {
+        fcs_pdfs_key_t key;
+        /* lower_pri and higher_pri form a doubly linked list.
+         *
+         * pri == priority.
+         * */
+        struct fcs_pdfs_key_info_struct *lower_pri, *higher_pri;
+    } fcs_pdfs_cache_key_info_t;
+
+    typedef struct
+    {
+        Pvoid_t states_values_to_keys_map;
+        fcs_compact_allocator_t states_values_to_keys_allocator;
+        long count_elements_in_cache, max_num_elements_in_cache;
+        fcs_pdfs_cache_key_info_t *lowest_pri, *highest_pri;
 #define RECYCLE_BIN_NEXT(item) ((item)->higher_pri)
-    fcs_pdfs_cache_key_info_t *recycle_bin;
-} fcs_pseudo_dfs_lru_cache_t;
-
-static inline void fcs_pdfs_cache_destroy(
-    fcs_pseudo_dfs_lru_cache_t *const cache)
-{
-    Word_t rc_word;
-    JHSFA(rc_word, cache->states_values_to_keys_map);
-    fc_solve_compact_allocator_finish(
-        &(cache->states_values_to_keys_allocator));
-}
-
-static inline void fcs_pdfs_cache_init(fcs_pseudo_dfs_lru_cache_t *const cache,
-    const long max_num_elements_in_cache,
-    fcs_meta_compact_allocator_t *const meta_alloc)
-{
-    cache->states_values_to_keys_map = ((Pvoid_t)NULL);
-
-    fc_solve_compact_allocator_init(
-        &(cache->states_values_to_keys_allocator), meta_alloc);
-    cache->lowest_pri = NULL;
-    cache->highest_pri = NULL;
-    cache->recycle_bin = NULL;
-    cache->count_elements_in_cache = 0;
-    cache->max_num_elements_in_cache = max_num_elements_in_cache;
-}
-
-static inline fcs_bool_t fcs_pdfs_cache_does_key_exist(
-    fcs_pseudo_dfs_lru_cache_t *const cache, fcs_pdfs_key_t *const key)
-{
-    fcs_pdfs_cache_key_info_t *existing;
+        fcs_pdfs_cache_key_info_t *recycle_bin;
+    } fcs_pseudo_dfs_lru_cache_t;
 
-    Word_t *PValue;
-    JHSG(PValue, cache->states_values_to_keys_map, key, sizeof(*key));
-    if (!PValue)
-    {
-        existing = NULL;
-    }
-    else
+    static inline void fcs_pdfs_cache_destroy(
+        fcs_pseudo_dfs_lru_cache_t *const cache)
     {
-        existing = (typeof(existing))(*PValue);
+        Word_t rc_word;
+        JHSFA(rc_word, cache->states_values_to_keys_map);
+        fc_solve_compact_allocator_finish(
+            &(cache->states_values_to_keys_allocator));
     }
 
-    if (!existing)
+    static inline void fcs_pdfs_cache_init(
+        fcs_pseudo_dfs_lru_cache_t *const cache,
+        const long max_num_elements_in_cache,
+        fcs_meta_compact_allocator_t *const meta_alloc)
     {
-        return FALSE;
+        cache->states_values_to_keys_map = ((Pvoid_t)NULL);
+
+        fc_solve_compact_allocator_init(
+            &(cache->states_values_to_keys_allocator), meta_alloc);
+        cache->lowest_pri = NULL;
+        cache->highest_pri = NULL;
+        cache->recycle_bin = NULL;
+        cache->count_elements_in_cache = 0;
+        cache->max_num_elements_in_cache = max_num_elements_in_cache;
     }
-    else
+
+    static inline fcs_bool_t fcs_pdfs_cache_does_key_exist(
+        fcs_pseudo_dfs_lru_cache_t *const cache, fcs_pdfs_key_t *const key)
     {
-        /* First - promote this key to the top of the cache. */
-        if (existing->higher_pri)
+        fcs_pdfs_cache_key_info_t *existing;
+
+        Word_t *PValue;
+        JHSG(PValue, cache->states_values_to_keys_map, key, sizeof(*key));
+        if (!PValue)
         {
-            existing->higher_pri->lower_pri = existing->lower_pri;
-            if (existing->lower_pri)
-            {
-                existing->lower_pri->higher_pri = existing->higher_pri;
-            }
-            else
+            existing = NULL;
+        }
+        else
+        {
+            existing = (typeof(existing))(*PValue);
+        }
+
+        if (!existing)
+        {
+            return FALSE;
+        }
+        else
+        {
+            /* First - promote this key to the top of the cache. */
+            if (existing->higher_pri)
             {
-                cache->lowest_pri = existing->higher_pri;
-                /* Bug fix: keep the chain intact. */
-                existing->higher_pri->lower_pri = NULL;
+                existing->higher_pri->lower_pri = existing->lower_pri;
+                if (existing->lower_pri)
+                {
+                    existing->lower_pri->higher_pri = existing->higher_pri;
+                }
+                else
+                {
+                    cache->lowest_pri = existing->higher_pri;
+                    /* Bug fix: keep the chain intact. */
+                    existing->higher_pri->lower_pri = NULL;
+                }
+                cache->highest_pri->higher_pri = existing;
+                existing->lower_pri = cache->highest_pri;
+                cache->highest_pri = existing;
+                existing->higher_pri = NULL;
             }
-            cache->highest_pri->higher_pri = existing;
-            existing->lower_pri = cache->highest_pri;
-            cache->highest_pri = existing;
-            existing->higher_pri = NULL;
-        }
 
-        return TRUE;
+            return TRUE;
+        }
     }
-}
 
-static inline fcs_pdfs_cache_key_info_t *fcs_pdfs_cache_insert(
-    fcs_pseudo_dfs_lru_cache_t *const cache, fcs_pdfs_key_t *const key)
-{
-    fcs_pdfs_cache_key_info_t *cache_key;
-    if (cache->count_elements_in_cache >= cache->max_num_elements_in_cache)
+    static inline fcs_pdfs_cache_key_info_t *fcs_pdfs_cache_insert(
+        fcs_pseudo_dfs_lru_cache_t *const cache, fcs_pdfs_key_t *const key)
     {
-        cache_key = cache->lowest_pri;
-        int rc_int;
-        JHSD(rc_int, cache->states_values_to_keys_map, &(cache_key->key),
-            sizeof(cache_key->key));
+        fcs_pdfs_cache_key_info_t *cache_key;
+        if (cache->count_elements_in_cache >= cache->max_num_elements_in_cache)
+        {
+            cache_key = cache->lowest_pri;
+            int rc_int;
+            JHSD(rc_int, cache->states_values_to_keys_map, &(cache_key->key),
+                sizeof(cache_key->key));
 
-        cache->lowest_pri = cache->lowest_pri->higher_pri;
-        cache->lowest_pri->lower_pri = NULL;
-    }
-    else
-    {
-        cache_key = (fcs_pdfs_cache_key_info_t *)fcs_compact_alloc_ptr(
-            &(cache->states_values_to_keys_allocator), sizeof(*cache_key));
-        ++cache->count_elements_in_cache;
-    }
+            cache->lowest_pri = cache->lowest_pri->higher_pri;
+            cache->lowest_pri->lower_pri = NULL;
+        }
+        else
+        {
+            cache_key = (fcs_pdfs_cache_key_info_t *)fcs_compact_alloc_ptr(
+                &(cache->states_values_to_keys_allocator), sizeof(*cache_key));
+            ++cache->count_elements_in_cache;
+        }
 
-    cache_key->key = *key;
+        cache_key->key = *key;
 
-    if (cache->highest_pri)
-    {
-        cache_key->lower_pri = cache->highest_pri;
-        cache_key->higher_pri = NULL;
-        cache->highest_pri->higher_pri = cache_key;
-        cache->highest_pri = cache_key;
-    }
-    else
-    {
-        cache->highest_pri = cache->lowest_pri = cache_key;
-        cache_key->higher_pri = cache_key->lower_pri = NULL;
-    }
+        if (cache->highest_pri)
+        {
+            cache_key->lower_pri = cache->highest_pri;
+            cache_key->higher_pri = NULL;
+            cache->highest_pri->higher_pri = cache_key;
+            cache->highest_pri = cache_key;
+        }
+        else
+        {
+            cache->highest_pri = cache->lowest_pri = cache_key;
+            cache_key->higher_pri = cache_key->lower_pri = NULL;
+        }
 
-    Word_t *PValue;
-    JHSI(PValue, cache->states_values_to_keys_map, key, sizeof(*key));
-    *PValue = ((Word_t)cache_key);
+        Word_t *PValue;
+        JHSI(PValue, cache->states_values_to_keys_map, key, sizeof(*key));
+        *PValue = ((Word_t)cache_key);
 
-    return cache_key;
-}
+        return cache_key;
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/rand.h b/fc-solve/source/rand.h
index 84166d047..dbc98c288 100644
--- a/fc-solve/source/rand.h
+++ b/fc-solve/source/rand.h
@@ -13,35 +13,37 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "rinutils.h"
 
-typedef long fcs_rand_t;
+    typedef long fcs_rand_t;
 
-static inline void fc_solve_rand_init(
-    fcs_rand_t *const my_rand, const unsigned int seed)
-{
-    *my_rand = (long)seed;
-}
+    static inline void fc_solve_rand_init(
+        fcs_rand_t *const my_rand, const unsigned int seed)
+    {
+        *my_rand = (long)seed;
+    }
 
-static inline int fc_solve_rand_rand15(fcs_rand_t *const my_rand)
-{
-    return ((((*my_rand) = ((*my_rand) * 214013 + 2531011)) >> 16) & 0x7fff);
-}
+    static inline int fc_solve_rand_rand15(fcs_rand_t *const my_rand)
+    {
+        return (
+            (((*my_rand) = ((*my_rand) * 214013 + 2531011)) >> 16) & 0x7fff);
+    }
 
-/*
- *
- * This function constructs a larger integral number of out of two
- * 15-bit ones.
- *
- * */
-static inline int fc_solve_rand_get_random_number(fcs_rand_t *const my_rand)
-{
-    const int first = fc_solve_rand_rand15(my_rand);
-    return (first | (fc_solve_rand_rand15(my_rand) << 15));
-}
+    /*
+     *
+     * This function constructs a larger integral number of out of two
+     * 15-bit ones.
+     *
+     * */
+    static inline int fc_solve_rand_get_random_number(fcs_rand_t *const my_rand)
+    {
+        const int first = fc_solve_rand_rand15(my_rand);
+        return (first | (fc_solve_rand_rand15(my_rand) << 15));
+    }
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/range_solvers_binary_output.h b/fc-solve/source/range_solvers_binary_output.h
index 3382ae049..584ba77b7 100644
--- a/fc-solve/source/range_solvers_binary_output.h
+++ b/fc-solve/source/range_solvers_binary_output.h
@@ -14,146 +14,148 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "rinutils.h"
 #include "fcs_cl.h"
 
-typedef struct
-{
-    FILE *fh;
-    char *buffer;
-    char *buffer_end;
-    char *ptr;
-    const char *filename;
-} binary_output_t;
+    typedef struct
+    {
+        FILE *fh;
+        char *buffer;
+        char *buffer_end;
+        char *ptr;
+        const char *filename;
+    } binary_output_t;
 
-static const binary_output_t INIT_BINARY_OUTPUT = {.filename = NULL};
+    static const binary_output_t INIT_BINARY_OUTPUT = {.filename = NULL};
 
 #define BINARY_OUTPUT_BUF_SIZE (sizeof(int) * 16)
 #define SIZE_INT 4
 
-static inline void write_me(binary_output_t *const bin)
-{
-    fwrite(bin->buffer, 1, (size_t)(bin->ptr - bin->buffer), bin->fh);
-    fflush(bin->fh);
-}
-
-static void print_int(binary_output_t *const bin, int val)
-{
-    if (!bin->fh)
+    static inline void write_me(binary_output_t *const bin)
     {
-        return;
+        fwrite(bin->buffer, 1, (size_t)(bin->ptr - bin->buffer), bin->fh);
+        fflush(bin->fh);
     }
-    unsigned char *const buffer = (unsigned char *const)bin->ptr;
-    for (int p = 0; p < SIZE_INT; p++)
-    {
-        buffer[p] = (unsigned char)(val & 0xFF);
-        val >>= 8;
-    }
-    bin->ptr += SIZE_INT;
-    if (bin->ptr == bin->buffer_end)
-    {
-        write_me(bin);
-        /* Reset ptr to the beginning */
-        bin->ptr = bin->buffer;
-    }
-}
 
-static inline void bin_close(binary_output_t *const bin)
-{
-    if (bin->filename)
+    static void print_int(binary_output_t *const bin, int val)
     {
-        write_me(bin);
-        fclose(bin->fh);
-        bin->fh = NULL;
-        bin->filename = NULL;
+        if (!bin->fh)
+        {
+            return;
+        }
+        unsigned char *const buffer = (unsigned char *const)bin->ptr;
+        for (int p = 0; p < SIZE_INT; p++)
+        {
+            buffer[p] = (unsigned char)(val & 0xFF);
+            val >>= 8;
+        }
+        bin->ptr += SIZE_INT;
+        if (bin->ptr == bin->buffer_end)
+        {
+            write_me(bin);
+            /* Reset ptr to the beginning */
+            bin->ptr = bin->buffer;
+        }
     }
-}
 
-static inline fcs_bool_t read_int(FILE *const f, long long *const dest)
-{
-    unsigned char buffer[SIZE_INT];
-    if (fread(buffer, 1, SIZE_INT, f) != SIZE_INT)
+    static inline void bin_close(binary_output_t *const bin)
     {
-        return TRUE;
+        if (bin->filename)
+        {
+            write_me(bin);
+            fclose(bin->fh);
+            bin->fh = NULL;
+            bin->filename = NULL;
+        }
     }
-    *dest = (buffer[0] +
-             ((buffer[1] + ((buffer[2] + ((buffer[3]) << 8)) << 8)) << 8));
-
-    return FALSE;
-}
 
-static void read_int_wrapper(FILE *const in, long long *const var)
-{
-    if (read_int(in, var))
+    static inline fcs_bool_t read_int(FILE *const f, long long *const dest)
     {
-        fc_solve_err(
-            "%s", "Output file is too short to deduce the configuration!\n");
+        unsigned char buffer[SIZE_INT];
+        if (fread(buffer, 1, SIZE_INT, f) != SIZE_INT)
+        {
+            return TRUE;
+        }
+        *dest = (buffer[0] +
+                 ((buffer[1] + ((buffer[2] + ((buffer[3]) << 8)) << 8)) << 8));
+
+        return FALSE;
     }
-}
 
-static inline void bin_init(binary_output_t *const bin,
-    long long *const start_board_ptr, long long *const end_board_ptr,
-    fcs_int_limit_t *const total_iterations_limit_per_board_ptr)
-{
-    if (bin->filename)
+    static void read_int_wrapper(FILE *const in, long long *const var)
     {
-        bin->buffer = malloc(BINARY_OUTPUT_BUF_SIZE);
-        bin->ptr = bin->buffer;
-        bin->buffer_end = bin->buffer + BINARY_OUTPUT_BUF_SIZE;
-
-        FILE *const in = fopen(bin->filename, "rb");
-        if (!in)
+        if (read_int(in, var))
         {
-            if (!(bin->fh = fopen(bin->filename, "wb")))
-            {
-                fc_solve_err(
-                    "Could not open \"%s\" for writing!\n", bin->filename);
-            }
-
-            print_int(bin, *start_board_ptr);
-            print_int(bin, *end_board_ptr);
-            print_int(bin, (int)(*total_iterations_limit_per_board_ptr));
+            fc_solve_err("%s",
+                "Output file is too short to deduce the configuration!\n");
         }
-        else
+    }
+
+    static inline void bin_init(binary_output_t *const bin,
+        long long *const start_board_ptr, long long *const end_board_ptr,
+        fcs_int_limit_t *const total_iterations_limit_per_board_ptr)
+    {
+        if (bin->filename)
         {
-            read_int_wrapper(in, start_board_ptr);
-            read_int_wrapper(in, end_board_ptr);
-            {
-                long long val;
-                read_int_wrapper(in, &val);
-                *total_iterations_limit_per_board_ptr = (fcs_int_limit_t)val;
-            }
+            bin->buffer = malloc(BINARY_OUTPUT_BUF_SIZE);
+            bin->ptr = bin->buffer;
+            bin->buffer_end = bin->buffer + BINARY_OUTPUT_BUF_SIZE;
 
-            fseek(in, 0, SEEK_END);
-            const long file_len = ftell(in);
-            if (file_len % 4 != 0)
-            {
-                fc_solve_err(
-                    "%s", "Output file has an invalid length. Terminating.\n");
-            }
-            *start_board_ptr += (file_len - 12) / 4;
-            if (*start_board_ptr >= *end_board_ptr)
+            FILE *const in = fopen(bin->filename, "rb");
+            if (!in)
             {
-                fc_solve_err("%s",
-                    "Output file was already finished being generated.\n");
+                if (!(bin->fh = fopen(bin->filename, "wb")))
+                {
+                    fc_solve_err(
+                        "Could not open \"%s\" for writing!\n", bin->filename);
+                }
+
+                print_int(bin, *start_board_ptr);
+                print_int(bin, *end_board_ptr);
+                print_int(bin, (int)(*total_iterations_limit_per_board_ptr));
             }
-            fclose(in);
-            if (!(bin->fh = fopen(bin->filename, "ab")))
+            else
             {
-                fc_solve_err(
-                    "Could not open \"%s\" for writing!\n", bin->filename);
+                read_int_wrapper(in, start_board_ptr);
+                read_int_wrapper(in, end_board_ptr);
+                {
+                    long long val;
+                    read_int_wrapper(in, &val);
+                    *total_iterations_limit_per_board_ptr =
+                        (fcs_int_limit_t)val;
+                }
+
+                fseek(in, 0, SEEK_END);
+                const long file_len = ftell(in);
+                if (file_len % 4 != 0)
+                {
+                    fc_solve_err("%s",
+                        "Output file has an invalid length. Terminating.\n");
+                }
+                *start_board_ptr += (file_len - 12) / 4;
+                if (*start_board_ptr >= *end_board_ptr)
+                {
+                    fc_solve_err("%s",
+                        "Output file was already finished being generated.\n");
+                }
+                fclose(in);
+                if (!(bin->fh = fopen(bin->filename, "ab")))
+                {
+                    fc_solve_err(
+                        "Could not open \"%s\" for writing!\n", bin->filename);
+                }
             }
         }
+        else
+        {
+            bin->fh = NULL;
+            bin->buffer = bin->ptr = bin->buffer_end = NULL;
+        }
     }
-    else
-    {
-        bin->fh = NULL;
-        bin->buffer = bin->ptr = bin->buffer_end = NULL;
-    }
-}
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/range_solvers_gen_ms_boards.h b/fc-solve/source/range_solvers_gen_ms_boards.h
index 360667bcc..affee3241 100644
--- a/fc-solve/source/range_solvers_gen_ms_boards.h
+++ b/fc-solve/source/range_solvers_gen_ms_boards.h
@@ -15,86 +15,89 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "gen_ms_boards__rand.h"
 
-typedef int CARD;
+    typedef int CARD;
 
 #define SUIT(card) ((card) & (4 - 1))
 #define VALUE(card) ((card) >> 2)
 
 #define MAXCOL 8
 
-static const char *card_to_string_values = "A23456789TJQK";
-static const char *card_to_string_suits = "CDHS";
+    static const char *card_to_string_values = "A23456789TJQK";
+    static const char *card_to_string_suits = "CDHS";
 
-static inline void card_to_string(char *const s, const CARD card)
-{
-    s[0] = card_to_string_values[VALUE(card)];
-    s[1] = card_to_string_suits[SUIT(card)];
-}
+    static inline void card_to_string(char *const s, const CARD card)
+    {
+        s[0] = card_to_string_values[VALUE(card)];
+        s[1] = card_to_string_suits[SUIT(card)];
+    }
 
 #ifdef FCS_GEN_BOARDS_WITH_EXTERNAL_API
-/* This is to settle gcc's -Wmissing-prototypes which complains about
- * missing prototypes for "extern" subroutines.
- *
- * It is not critical that it would be in the same place because the only
- * thing that uses this function is Python's ctypes (in the test files under
- * t/t/ ) which does not process the included C code. In the future, we may
- * have an external API in which case we'll devise a header for this
- * routine.
- *
- * */
-void DLLEXPORT fc_solve_get_board_l(const long long deal_idx, char *const ret);
-
-extern void DLLEXPORT fc_solve_get_board_l(
-    const long long deal_idx, char *const ret)
+    /* This is to settle gcc's -Wmissing-prototypes which complains about
+     * missing prototypes for "extern" subroutines.
+     *
+     * It is not critical that it would be in the same place because the only
+     * thing that uses this function is Python's ctypes (in the test files under
+     * t/t/ ) which does not process the included C code. In the future, we may
+     * have an external API in which case we'll devise a header for this
+     * routine.
+     *
+     * */
+    void DLLEXPORT fc_solve_get_board_l(
+        const long long deal_idx, char *const ret);
+
+    extern void DLLEXPORT fc_solve_get_board_l(
+        const long long deal_idx, char *const ret)
 #else
 static inline void get_board_l(const long long deal_idx, char *const ret)
 #endif
-{
-    long long seedx = microsoft_rand__calc_init_seedx(deal_idx);
-    strcpy(ret, "XX XX XX XX XX XX XX\n"
-                "XX XX XX XX XX XX XX\n"
-                "XX XX XX XX XX XX XX\n"
-                "XX XX XX XX XX XX XX\n"
-                "XX XX XX XX XX XX\n"
-                "XX XX XX XX XX XX\n"
-                "XX XX XX XX XX XX\n"
-                "XX XX XX XX XX XX\n");
-
-    CARD deck[52]; /* deck of 52 unique cards */
-
-    /* shuffle cards */
-
-    for (int i = 0; i < 52; i++) /* put unique card in each deck loc. */
     {
-        deck[i] = i;
+        long long seedx = microsoft_rand__calc_init_seedx(deal_idx);
+        strcpy(ret, "XX XX XX XX XX XX XX\n"
+                    "XX XX XX XX XX XX XX\n"
+                    "XX XX XX XX XX XX XX\n"
+                    "XX XX XX XX XX XX XX\n"
+                    "XX XX XX XX XX XX\n"
+                    "XX XX XX XX XX XX\n"
+                    "XX XX XX XX XX XX\n"
+                    "XX XX XX XX XX XX\n");
+
+        CARD deck[52]; /* deck of 52 unique cards */
+
+        /* shuffle cards */
+
+        for (int i = 0; i < 52; i++) /* put unique card in each deck loc. */
+        {
+            deck[i] = i;
+        }
+
+        microsoft_rand_uint_t num_cards_left = 52;
+        for (int i = 0; i < 52; i++)
+        {
+            const microsoft_rand_uint_t j =
+                microsoft_rand__game_num_rand(&seedx, deal_idx) %
+                num_cards_left;
+            const int col = (i & (8 - 1));
+            card_to_string(
+                &ret[3 * (col * 7 - ((col > 4) ? (col - 4) : 0) + (i >> 3))],
+                deck[j]);
+            deck[j] = deck[--num_cards_left];
+        }
     }
 
-    microsoft_rand_uint_t num_cards_left = 52;
-    for (int i = 0; i < 52; i++)
+#ifndef FCS_GEN_BOARDS_WITH_EXTERNAL_API
+    static inline void get_board(long deal_idx, char *ret)
     {
-        const microsoft_rand_uint_t j =
-            microsoft_rand__game_num_rand(&seedx, deal_idx) % num_cards_left;
-        const int col = (i & (8 - 1));
-        card_to_string(
-            &ret[3 * (col * 7 - ((col > 4) ? (col - 4) : 0) + (i >> 3))],
-            deck[j]);
-        deck[j] = deck[--num_cards_left];
+        get_board_l((long long)deal_idx, ret);
     }
-}
-
-#ifndef FCS_GEN_BOARDS_WITH_EXTERNAL_API
-static inline void get_board(long deal_idx, char *ret)
-{
-    get_board_l((long long)deal_idx, ret);
-}
 #endif
 
-typedef char fcs_state_string_t[52 * 3 + 8 + 1];
+    typedef char fcs_state_string_t[52 * 3 + 8 + 1];
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/rank2str.h b/fc-solve/source/rank2str.h
index d1f88f88b..a4f399bc3 100644
--- a/fc-solve/source/rank2str.h
+++ b/fc-solve/source/rank2str.h
@@ -9,7 +9,8 @@
  */
 #pragma once
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "config.h"
@@ -28,20 +29,20 @@ extern "C" {
     }
 
 #ifndef FC_SOLVE_IMPLICIT_T_RANK
-static const char card_map_3_10[14][4] = GEN_CARD_MAP("10");
+    static const char card_map_3_10[14][4] = GEN_CARD_MAP("10");
 
-static const char card_map_3_T[14][4] = GEN_CARD_MAP("T");
+    static const char card_map_3_T[14][4] = GEN_CARD_MAP("T");
 #else
 static const char cards_char_map[15] = (CARD_ZERO() "A23456789TJQK");
 #endif
 
-static inline void rank2str(
-    const int rank_idx, char *const str PASS_T(const fcs_bool_t display_T))
-{
+    static inline void rank2str(
+        const int rank_idx, char *const str PASS_T(const fcs_bool_t display_T))
+    {
 #ifdef FC_SOLVE_IMPLICIT_T_RANK
-    str[0] = cards_char_map[rank_idx];
-    str[1] = '\0';
+        str[0] = cards_char_map[rank_idx];
+        str[1] = '\0';
 #else
     strcpy(str, (display_T ? card_map_3_T : card_map_3_10)[rank_idx]);
 #endif
-}
+    }
diff --git a/fc-solve/source/scans.h b/fc-solve/source/scans.h
index 716ebfe0e..3d5fb3250 100644
--- a/fc-solve/source/scans.h
+++ b/fc-solve/source/scans.h
@@ -14,17 +14,18 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "instance.h"
 
-static inline void fc_solve__assign_dest_stack_and_col_ptr(
-    int8_t *const positions_by_rank, const int8_t dest_stack,
-    const int8_t dest_col, const fcs_card_t dest_card)
-{
+    static inline void fc_solve__assign_dest_stack_and_col_ptr(
+        int8_t *const positions_by_rank, const int8_t dest_stack,
+        const int8_t dest_col, const fcs_card_t dest_card)
+    {
 #ifdef FCS_FREECELL_ONLY
-    int8_t *ptr = &positions_by_rank[(dest_card - 4) << 1];
+        int8_t *ptr = &positions_by_rank[(dest_card - 4) << 1];
 #else
     int8_t *ptr = &positions_by_rank[(FCS_POS_BY_RANK_WIDTH *
                                          (fcs_card_rank(dest_card) - 1)) +
@@ -32,144 +33,145 @@ static inline void fc_solve__assign_dest_stack_and_col_ptr(
 #endif
 
 #if ((!defined(HARD_CODED_NUM_DECKS)) || (HARD_CODED_NUM_DECKS > 1))
-    for (; (*ptr) != -1; ptr += (4 << 1))
-    {
-    }
+        for (; (*ptr) != -1; ptr += (4 << 1))
+        {
+        }
 #endif
 
-    *(ptr++) = dest_stack;
-    *(ptr) = dest_col;
-}
+        *(ptr++) = dest_stack;
+        *(ptr) = dest_col;
+    }
 
-static inline void fc_solve__calc_positions_by_rank_data(
-    fc_solve_soft_thread_t *const soft_thread,
-    const fcs_state_t *const ptr_state_key,
-    fcs__positions_by_rank_t positions_by_rank
+    static inline void fc_solve__calc_positions_by_rank_data(
+        fc_solve_soft_thread_t *const soft_thread,
+        const fcs_state_t *const ptr_state_key,
+        fcs__positions_by_rank_t positions_by_rank
 #ifndef FCS_DISABLE_SIMPLE_SIMON
-    ,
-    const fcs_bool_t is_simple_simon
+        ,
+        const fcs_bool_t is_simple_simon
 #endif
-)
-{
+    )
+    {
 #ifndef HARD_CODED_ALL
-    var_AUTO(instance, fcs_st_instance(soft_thread));
-    SET_GAME_PARAMS();
+        var_AUTO(instance, fcs_st_instance(soft_thread));
+        SET_GAME_PARAMS();
 #endif
 
-    memset(positions_by_rank, -1, sizeof(fcs__positions_by_rank_t));
+        memset(positions_by_rank, -1, sizeof(fcs__positions_by_rank_t));
 
 #ifndef FCS_DISABLE_SIMPLE_SIMON
-    if (is_simple_simon)
-    {
-#define FCS_POS_IDX(rank, suit) ((suit)*FCS_SS_POS_BY_RANK_WIDTH + (rank))
-        fcs_pos_by_rank_t *const p_by_r =
-            (fcs_pos_by_rank_t *)positions_by_rank;
-        for (int ds = 0; ds < LOCAL_STACKS_NUM; ds++)
+        if (is_simple_simon)
         {
-            const_AUTO(dest_col, fcs_state_get_col(*ptr_state_key, ds));
-            const int dest_cards_num = fcs_col_len(dest_col);
-
-            for (int dc = 0; dc < dest_cards_num; dc++)
+#define FCS_POS_IDX(rank, suit) ((suit)*FCS_SS_POS_BY_RANK_WIDTH + (rank))
+            fcs_pos_by_rank_t *const p_by_r =
+                (fcs_pos_by_rank_t *)positions_by_rank;
+            for (int ds = 0; ds < LOCAL_STACKS_NUM; ds++)
             {
-                const fcs_card_t card = fcs_col_get_card(dest_col, dc);
-                const int suit = fcs_card_suit(card);
-                const int rank = fcs_card_rank(card);
+                const_AUTO(dest_col, fcs_state_get_col(*ptr_state_key, ds));
+                const int dest_cards_num = fcs_col_len(dest_col);
 
-                p_by_r[FCS_POS_IDX(rank, suit)] =
-                    (fcs_pos_by_rank_t){.col = ds, .height = dc};
+                for (int dc = 0; dc < dest_cards_num; dc++)
+                {
+                    const fcs_card_t card = fcs_col_get_card(dest_col, dc);
+                    const int suit = fcs_card_suit(card);
+                    const int rank = fcs_card_rank(card);
+
+                    p_by_r[FCS_POS_IDX(rank, suit)] =
+                        (fcs_pos_by_rank_t){.col = ds, .height = dc};
+                }
             }
         }
-    }
-    else
+        else
 #endif
-    {
+        {
 #define state_key (*ptr_state_key)
 
 #ifndef FCS_FREECELL_ONLY
-        const int sequences_are_built_by =
-            GET_INSTANCE_SEQUENCES_ARE_BUILT_BY(instance);
+            const int sequences_are_built_by =
+                GET_INSTANCE_SEQUENCES_ARE_BUILT_BY(instance);
 #endif
 
-        /* We need 2 chars per card - one for the column_idx and one
-         * for the card_idx.
-         *
-         * We also need it times 13 for each of the ranks.
-         *
-         * We need (4*LOCAL_DECKS_NUM+1) slots to hold the cards plus a
-         * (-1,-1) (= end) padding.             * */
-        /* Populate positions_by_rank by looping over the stacks and
-         * indices looking for the cards and filling them. */
-
-        for (int ds = 0; ds < LOCAL_STACKS_NUM; ds++)
-        {
-            const_AUTO(dest_col, fcs_state_get_col(state_key, ds));
-            int top_card_idx = fcs_col_len(dest_col);
-
-            if (unlikely((top_card_idx--) == 0))
+            /* We need 2 chars per card - one for the column_idx and one
+             * for the card_idx.
+             *
+             * We also need it times 13 for each of the ranks.
+             *
+             * We need (4*LOCAL_DECKS_NUM+1) slots to hold the cards plus a
+             * (-1,-1) (= end) padding.             * */
+            /* Populate positions_by_rank by looping over the stacks and
+             * indices looking for the cards and filling them. */
+
+            for (int ds = 0; ds < LOCAL_STACKS_NUM; ds++)
             {
-                continue;
-            }
+                const_AUTO(dest_col, fcs_state_get_col(state_key, ds));
+                int top_card_idx = fcs_col_len(dest_col);
 
-            fcs_card_t dest_card;
-            {
-                fcs_card_t dest_below_card;
-                dest_card = fcs_col_get_card(dest_col, 0);
-                for (int dc = 0; dc < top_card_idx;
-                     dc++, dest_card = dest_below_card)
+                if (unlikely((top_card_idx--) == 0))
+                {
+                    continue;
+                }
+
+                fcs_card_t dest_card;
                 {
-                    dest_below_card = fcs_col_get_card(dest_col, dc + 1);
-                    if (!fcs_is_parent_card(dest_below_card, dest_card))
+                    fcs_card_t dest_below_card;
+                    dest_card = fcs_col_get_card(dest_col, 0);
+                    for (int dc = 0; dc < top_card_idx;
+                         dc++, dest_card = dest_below_card)
                     {
-                        fc_solve__assign_dest_stack_and_col_ptr(
-                            positions_by_rank, ds, dc, dest_card);
+                        dest_below_card = fcs_col_get_card(dest_col, dc + 1);
+                        if (!fcs_is_parent_card(dest_below_card, dest_card))
+                        {
+                            fc_solve__assign_dest_stack_and_col_ptr(
+                                positions_by_rank, ds, dc, dest_card);
+                        }
                     }
                 }
+                fc_solve__assign_dest_stack_and_col_ptr(
+                    positions_by_rank, ds, top_card_idx, dest_card);
             }
-            fc_solve__assign_dest_stack_and_col_ptr(
-                positions_by_rank, ds, top_card_idx, dest_card);
         }
-    }
 #undef state_key
 #undef ptr_state_key
-}
+    }
 
-static inline const int8_t *fc_solve_calc_positions_by_rank_location(
-    fc_solve_soft_thread_t *const soft_thread)
-{
-    if (soft_thread->super_method_type == FCS_SUPER_METHOD_DFS)
+    static inline const int8_t *fc_solve_calc_positions_by_rank_location(
+        fc_solve_soft_thread_t *const soft_thread)
     {
-        return (DFS_VAR(soft_thread, soft_dfs_info)[DFS_VAR(soft_thread, depth)]
+        if (soft_thread->super_method_type == FCS_SUPER_METHOD_DFS)
+        {
+            return (
+                DFS_VAR(soft_thread, soft_dfs_info)[DFS_VAR(soft_thread, depth)]
                     .positions_by_rank);
+        }
+        else
+        {
+            return (BEFS_M_VAR(soft_thread, befs_positions_by_rank));
+        }
     }
-    else
-    {
-        return (BEFS_M_VAR(soft_thread, befs_positions_by_rank));
-    }
-}
 
-static inline void add_to_move_funcs_list(
-    fcs_move_func **const out_move_funcs_list, size_t *const num_so_far,
-    const fcs_move_func *const indexes, const size_t count_to_add)
-{
-    size_t num = *num_so_far;
-    fcs_move_func *const move_funcs_list =
-        SREALLOC(*out_move_funcs_list, num + count_to_add);
-    for (size_t i = 0; i < count_to_add; ++i)
+    static inline void add_to_move_funcs_list(
+        fcs_move_func **const out_move_funcs_list, size_t *const num_so_far,
+        const fcs_move_func *const indexes, const size_t count_to_add)
     {
-        move_funcs_list[num++].f = fc_solve_sfs_move_funcs[indexes[i].idx];
-    }
+        size_t num = *num_so_far;
+        fcs_move_func *const move_funcs_list =
+            SREALLOC(*out_move_funcs_list, num + count_to_add);
+        for (size_t i = 0; i < count_to_add; ++i)
+        {
+            move_funcs_list[num++].f = fc_solve_sfs_move_funcs[indexes[i].idx];
+        }
 
-    *out_move_funcs_list = move_funcs_list;
-    *num_so_far = num;
-}
+        *out_move_funcs_list = move_funcs_list;
+        *num_so_far = num;
+    }
 
-extern int fc_solve_sfs_check_state_begin(fc_solve_hard_thread_t *const,
-    fcs_kv_state_t *const,
-    fcs_kv_state_t SFS__PASS_MOVE_STACK(fcs_move_stack_t *const));
+    extern int fc_solve_sfs_check_state_begin(fc_solve_hard_thread_t *const,
+        fcs_kv_state_t *const,
+        fcs_kv_state_t SFS__PASS_MOVE_STACK(fcs_move_stack_t *const));
 
-extern fcs_collectible_state_t *fc_solve_sfs_check_state_end(
-    fc_solve_soft_thread_t *, fcs_kv_state_t,
-    fcs_kv_state_t *FCS__pass_moves(fcs_move_stack_t *));
+    extern fcs_collectible_state_t *fc_solve_sfs_check_state_end(
+        fc_solve_soft_thread_t *, fcs_kv_state_t,
+        fcs_kv_state_t *FCS__pass_moves(fcs_move_stack_t *));
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/scans_impl.h b/fc-solve/source/scans_impl.h
index 44bdd87fa..5bb8183b2 100644
--- a/fc-solve/source/scans_impl.h
+++ b/fc-solve/source/scans_impl.h
@@ -11,7 +11,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include <assert.h>
@@ -44,7 +45,7 @@ extern "C" {
 
 #define BEFS_MAX_DEPTH 20000
 
-extern const fcs_default_weights_t fc_solve_default_befs_weights;
+    extern const fcs_default_weights_t fc_solve_default_befs_weights;
 
 #ifdef FCS_FREECELL_ONLY
 #define is_filled_by_any_card() TRUE
@@ -52,235 +53,237 @@ extern const fcs_default_weights_t fc_solve_default_befs_weights;
 #define is_filled_by_any_card()                                                \
     (INSTANCE_EMPTY_STACKS_FILL == FCS_ES_FILLED_BY_ANY_CARD)
 #endif
-static inline void fc_solve_initialize_befs_rater(
-    fc_solve_soft_thread_t *const soft_thread,
-    fc_solve_state_weighting_t *const weighting)
-{
-    const double *const befs_weights = weighting->befs_weights.weights;
-    /* Normalize the BeFS Weights, so the sum of all of them would be 1. */
-    double sum = 0;
-    for (int i = 0; i < FCS_NUM_BEFS_WEIGHTS; i++)
-    {
-        sum += befs_weights[i];
-    }
-    if (sum < 1e-6)
+    static inline void fc_solve_initialize_befs_rater(
+        fc_solve_soft_thread_t *const soft_thread,
+        fc_solve_state_weighting_t *const weighting)
     {
-        sum = 1;
-    }
-    const_AUTO(factor, INT_MAX / sum);
+        const double *const befs_weights = weighting->befs_weights.weights;
+        /* Normalize the BeFS Weights, so the sum of all of them would be 1. */
+        double sum = 0;
+        for (int i = 0; i < FCS_NUM_BEFS_WEIGHTS; i++)
+        {
+            sum += befs_weights[i];
+        }
+        if (sum < 1e-6)
+        {
+            sum = 1;
+        }
+        const_AUTO(factor, INT_MAX / sum);
 #define W(idx) (befs_weights[idx] * factor)
-    fc_solve_hard_thread_t *const hard_thread = soft_thread->hard_thread;
-    fc_solve_instance_t *const instance = HT_INSTANCE(hard_thread);
-    HARD__SET_GAME_PARAMS();
+        fc_solve_hard_thread_t *const hard_thread = soft_thread->hard_thread;
+        fc_solve_instance_t *const instance = HT_INSTANCE(hard_thread);
+        HARD__SET_GAME_PARAMS();
 
 #ifndef FCS_FREECELL_ONLY
-    const fcs_bool_t unlimited_sequence_move_var =
-        INSTANCE_UNLIMITED_SEQUENCE_MOVE;
+        const fcs_bool_t unlimited_sequence_move_var =
+            INSTANCE_UNLIMITED_SEQUENCE_MOVE;
 #define unlimited_sequence_move unlimited_sequence_move_var
 #else
 #define unlimited_sequence_move FALSE
 #endif
 
-    const double num_cards_out_factor =
-        W(FCS_BEFS_WEIGHT_CARDS_OUT) / (LOCAL_DECKS_NUM * 52);
-
-    double out_sum = 0.0;
-    const_PTR(
-        num_cards_out_lookup_table, weighting->num_cards_out_lookup_table);
-    for (int i = 0; i <= 13; i++, out_sum += num_cards_out_factor)
-    {
-        num_cards_out_lookup_table[i] = out_sum;
-    }
-
-    weighting->max_sequence_move_factor =
-        W(FCS_BEFS_WEIGHT_MAX_SEQUENCE_MOVE) /
-        (is_filled_by_any_card()
-                ? (unlimited_sequence_move
-                          ? (LOCAL_FREECELLS_NUM + INSTANCE_STACKS_NUM)
-                          : ((LOCAL_FREECELLS_NUM + 1)
-                                << (INSTANCE_STACKS_NUM)))
-                : (unlimited_sequence_move ? LOCAL_FREECELLS_NUM : 1));
+        const double num_cards_out_factor =
+            W(FCS_BEFS_WEIGHT_CARDS_OUT) / (LOCAL_DECKS_NUM * 52);
 
-    weighting->cards_under_sequences_factor =
-        W(FCS_BEFS_WEIGHT_CARDS_UNDER_SEQUENCES) /
-        instance->initial_cards_under_sequences_value;
-
-    weighting->seqs_over_renegade_cards_factor =
-        W(FCS_BEFS_WEIGHT_SEQS_OVER_RENEGADE_CARDS) /
-        FCS_SEQS_OVER_RENEGADE_POWER(LOCAL_DECKS_NUM * (13 * 4));
-
-    weighting->depth_factor = W(FCS_BEFS_WEIGHT_DEPTH) / BEFS_MAX_DEPTH;
-
-    weighting->num_cards_not_on_parents_factor =
-        W(FCS_BEFS_WEIGHT_NUM_CARDS_NOT_ON_PARENTS) / (LOCAL_DECKS_NUM * 52);
+        double out_sum = 0.0;
+        const_PTR(
+            num_cards_out_lookup_table, weighting->num_cards_out_lookup_table);
+        for (int i = 0; i <= 13; i++, out_sum += num_cards_out_factor)
+        {
+            num_cards_out_lookup_table[i] = out_sum;
+        }
 
-    weighting->should_go_over_stacks =
-        (weighting->max_sequence_move_factor ||
-            weighting->cards_under_sequences_factor ||
-            weighting->seqs_over_renegade_cards_factor);
-}
+        weighting->max_sequence_move_factor =
+            W(FCS_BEFS_WEIGHT_MAX_SEQUENCE_MOVE) /
+            (is_filled_by_any_card()
+                    ? (unlimited_sequence_move
+                              ? (LOCAL_FREECELLS_NUM + INSTANCE_STACKS_NUM)
+                              : ((LOCAL_FREECELLS_NUM + 1)
+                                    << (INSTANCE_STACKS_NUM)))
+                    : (unlimited_sequence_move ? LOCAL_FREECELLS_NUM : 1));
+
+        weighting->cards_under_sequences_factor =
+            W(FCS_BEFS_WEIGHT_CARDS_UNDER_SEQUENCES) /
+            instance->initial_cards_under_sequences_value;
+
+        weighting->seqs_over_renegade_cards_factor =
+            W(FCS_BEFS_WEIGHT_SEQS_OVER_RENEGADE_CARDS) /
+            FCS_SEQS_OVER_RENEGADE_POWER(LOCAL_DECKS_NUM * (13 * 4));
+
+        weighting->depth_factor = W(FCS_BEFS_WEIGHT_DEPTH) / BEFS_MAX_DEPTH;
+
+        weighting->num_cards_not_on_parents_factor =
+            W(FCS_BEFS_WEIGHT_NUM_CARDS_NOT_ON_PARENTS) /
+            (LOCAL_DECKS_NUM * 52);
+
+        weighting->should_go_over_stacks =
+            (weighting->max_sequence_move_factor ||
+                weighting->cards_under_sequences_factor ||
+                weighting->seqs_over_renegade_cards_factor);
+    }
 #undef unlimited_sequence_move
 #undef W
 
-typedef int fcs_depth_t;
+    typedef int fcs_depth_t;
 
-static inline fcs_depth_t calc_depth(fcs_collectible_state_t *ptr_state)
-{
-#ifdef FCS_WITHOUT_DEPTH_FIELD
-    register fcs_depth_t ret = 0;
-    while ((ptr_state = FCS_S_PARENT(ptr_state)) != NULL)
+    static inline fcs_depth_t calc_depth(fcs_collectible_state_t *ptr_state)
     {
-        ++ret;
-    }
-    return ret;
+#ifdef FCS_WITHOUT_DEPTH_FIELD
+        register fcs_depth_t ret = 0;
+        while ((ptr_state = FCS_S_PARENT(ptr_state)) != NULL)
+        {
+            ++ret;
+        }
+        return ret;
 #else
     return (FCS_S_DEPTH(ptr_state));
 #endif
-}
+    }
 
 #ifdef DEBUG
-static inline void fcs_trace(const char *const format, ...)
-{
-    va_list my_va_list;
-    va_start(my_va_list, format);
-
-    if (getenv("FCS_TRACE"))
+    static inline void fcs_trace(const char *const format, ...)
     {
-        vfprintf(stdout, format, my_va_list);
-        fflush(stdout);
+        va_list my_va_list;
+        va_start(my_va_list, format);
+
+        if (getenv("FCS_TRACE"))
+        {
+            vfprintf(stdout, format, my_va_list);
+            fflush(stdout);
+        }
+        va_end(my_va_list);
     }
-    va_end(my_va_list);
-}
 #endif
 
-static inline fcs_game_limit_t count_num_vacant_freecells(
-    const fcs_game_limit_t freecells_num, const fcs_state_t *const state_ptr)
-{
-    fcs_game_limit_t num_vacant_freecells = 0;
-    for (int i = 0; i < freecells_num; i++)
+    static inline fcs_game_limit_t count_num_vacant_freecells(
+        const fcs_game_limit_t freecells_num,
+        const fcs_state_t *const state_ptr)
     {
-        if (fcs_freecell_is_empty(*state_ptr, i))
+        fcs_game_limit_t num_vacant_freecells = 0;
+        for (int i = 0; i < freecells_num; i++)
         {
-            num_vacant_freecells++;
+            if (fcs_freecell_is_empty(*state_ptr, i))
+            {
+                num_vacant_freecells++;
+            }
         }
-    }
 
-    return num_vacant_freecells;
-}
+        return num_vacant_freecells;
+    }
 
-static inline pq_rating_t befs_rate_state(
-    const fc_solve_soft_thread_t *const soft_thread,
-    const fc_solve_state_weighting_t *const weighting,
-    const fcs_state_t *const state, const int negated_depth)
-{
-    const_AUTO(instance, fcs_st_instance(soft_thread));
+    static inline pq_rating_t befs_rate_state(
+        const fc_solve_soft_thread_t *const soft_thread,
+        const fc_solve_state_weighting_t *const weighting,
+        const fcs_state_t *const state, const int negated_depth)
+    {
+        const_AUTO(instance, fcs_st_instance(soft_thread));
 #ifndef FCS_FREECELL_ONLY
-    const int sequences_are_built_by =
-        GET_INSTANCE_SEQUENCES_ARE_BUILT_BY(instance);
+        const int sequences_are_built_by =
+            GET_INSTANCE_SEQUENCES_ARE_BUILT_BY(instance);
 #endif
-    HARD__SET_GAME_PARAMS();
+        HARD__SET_GAME_PARAMS();
 
 #ifndef FCS_FREECELL_ONLY
-    const fcs_bool_t unlimited_sequence_move_var =
-        INSTANCE_UNLIMITED_SEQUENCE_MOVE;
+        const fcs_bool_t unlimited_sequence_move_var =
+            INSTANCE_UNLIMITED_SEQUENCE_MOVE;
 #define unlimited_sequence_move unlimited_sequence_move_var
 #else
 #define unlimited_sequence_move FALSE
 #endif
 
-    fc_solve_seq_cards_power_type_t cards_under_sequences = 0;
-    fc_solve_seq_cards_power_type_t seqs_over_renegade_cards = 0;
+        fc_solve_seq_cards_power_type_t cards_under_sequences = 0;
+        fc_solve_seq_cards_power_type_t seqs_over_renegade_cards = 0;
 
-    double sum = (max(0, negated_depth) * weighting->depth_factor);
-    const_PTR(
-        num_cards_out_lookup_table, weighting->num_cards_out_lookup_table);
-    if (num_cards_out_lookup_table[1])
-    {
-        const int num_foundations = (LOCAL_DECKS_NUM << 2);
-        for (int found_idx = 0; found_idx < num_foundations; ++found_idx)
+        double sum = (max(0, negated_depth) * weighting->depth_factor);
+        const_PTR(
+            num_cards_out_lookup_table, weighting->num_cards_out_lookup_table);
+        if (num_cards_out_lookup_table[1])
         {
-            sum += num_cards_out_lookup_table[(
-                int)(fcs_foundation_value((*state), found_idx))];
+            const int num_foundations = (LOCAL_DECKS_NUM << 2);
+            for (int found_idx = 0; found_idx < num_foundations; ++found_idx)
+            {
+                sum += num_cards_out_lookup_table[(
+                    int)(fcs_foundation_value((*state), found_idx))];
+            }
         }
-    }
 
-    fcs_game_limit_t num_vacant_stacks = 0;
-    if (weighting->should_go_over_stacks)
-    {
-        for (int a = 0; a < LOCAL_STACKS_NUM; ++a)
+        fcs_game_limit_t num_vacant_stacks = 0;
+        if (weighting->should_go_over_stacks)
         {
-            const_AUTO(col, fcs_state_get_col(*state, a));
-            const int cards_num = fcs_col_len(col);
-
-            if (cards_num <= 1)
+            for (int a = 0; a < LOCAL_STACKS_NUM; ++a)
             {
-                if (cards_num == 0)
+                const_AUTO(col, fcs_state_get_col(*state, a));
+                const int cards_num = fcs_col_len(col);
+
+                if (cards_num <= 1)
                 {
-                    ++num_vacant_stacks;
+                    if (cards_num == 0)
+                    {
+                        ++num_vacant_stacks;
+                    }
+                    continue;
                 }
-                continue;
-            }
 
-            const int c = update_col_cards_under_sequences(
+                const int c = update_col_cards_under_sequences(
 #ifndef FCS_FREECELL_ONLY
-                sequences_are_built_by,
+                    sequences_are_built_by,
 #endif
-                col, cards_num - 1);
+                    col, cards_num - 1);
 
-            cards_under_sequences += FCS_SEQS_OVER_RENEGADE_POWER(c);
-            if (c > 0)
-            {
-                seqs_over_renegade_cards +=
-                    ((unlimited_sequence_move)
-                            ? 1
-                            : FCS_SEQS_OVER_RENEGADE_POWER(cards_num - c));
+                cards_under_sequences += FCS_SEQS_OVER_RENEGADE_POWER(c);
+                if (c > 0)
+                {
+                    seqs_over_renegade_cards +=
+                        ((unlimited_sequence_move)
+                                ? 1
+                                : FCS_SEQS_OVER_RENEGADE_POWER(cards_num - c));
+                }
             }
-        }
 
-        const fcs_game_limit_t num_vacant_freecells =
-            count_num_vacant_freecells(LOCAL_FREECELLS_NUM, state);
+            const fcs_game_limit_t num_vacant_freecells =
+                count_num_vacant_freecells(LOCAL_FREECELLS_NUM, state);
 #define CALC_VACANCY_VAL()                                                     \
     (is_filled_by_any_card()                                                   \
             ? (unlimited_sequence_move                                         \
                       ? (num_vacant_freecells + num_vacant_stacks)             \
                       : ((num_vacant_freecells + 1) << num_vacant_stacks))     \
             : (unlimited_sequence_move ? (num_vacant_freecells) : 0))
-        sum += ((CALC_VACANCY_VAL() * weighting->max_sequence_move_factor) +
-                ((instance->initial_cards_under_sequences_value -
-                     cards_under_sequences) *
-                    weighting->cards_under_sequences_factor) +
-                (seqs_over_renegade_cards *
-                    weighting->seqs_over_renegade_cards_factor));
-    }
+            sum += ((CALC_VACANCY_VAL() * weighting->max_sequence_move_factor) +
+                    ((instance->initial_cards_under_sequences_value -
+                         cards_under_sequences) *
+                        weighting->cards_under_sequences_factor) +
+                    (seqs_over_renegade_cards *
+                        weighting->seqs_over_renegade_cards_factor));
+        }
 
-    const double num_cards_not_on_parents_weight =
-        weighting->num_cards_not_on_parents_factor;
-    if (num_cards_not_on_parents_weight)
-    {
-        int num_cards_not_on_parents = (LOCAL_DECKS_NUM * 52);
-        for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+        const double num_cards_not_on_parents_weight =
+            weighting->num_cards_not_on_parents_factor;
+        if (num_cards_not_on_parents_weight)
         {
-            const_AUTO(col, fcs_state_get_col(*state, stack_idx));
-            const uint_fast16_t col_len = fcs_col_len(col);
-            for (uint_fast16_t h = 1; h < col_len; h++)
+            int num_cards_not_on_parents = (LOCAL_DECKS_NUM * 52);
+            for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
             {
-                if (!fcs_is_parent_card(
-                        fcs_col_get_card(col, h - 1), fcs_col_get_card(col, h)))
+                const_AUTO(col, fcs_state_get_col(*state, stack_idx));
+                const uint_fast16_t col_len = fcs_col_len(col);
+                for (uint_fast16_t h = 1; h < col_len; h++)
                 {
-                    num_cards_not_on_parents--;
+                    if (!fcs_is_parent_card(fcs_col_get_card(col, h - 1),
+                            fcs_col_get_card(col, h)))
+                    {
+                        num_cards_not_on_parents--;
+                    }
                 }
             }
+            sum += num_cards_not_on_parents * num_cards_not_on_parents_weight;
         }
-        sum += num_cards_not_on_parents * num_cards_not_on_parents_weight;
-    }
 
 #ifdef DEBUG
-    fcs_trace(
-        "BestFS(rate_state) - %s ; rating=%.40f .\n", "Before return", 0.1);
+        fcs_trace(
+            "BestFS(rate_state) - %s ; rating=%.40f .\n", "Before return", 0.1);
 #endif
-    return ((int)sum);
+        return ((int)sum);
 #undef CALC_VACANCY_VAL
-}
+    }
 
 #ifdef FCS_RCS_STATES
 
@@ -316,74 +319,74 @@ static inline pq_rating_t befs_rate_state(
 
 #if !defined(FCS_WITHOUT_DEPTH_FIELD) &&                                       \
     !defined(FCS_HARD_CODE_CALC_REAL_DEPTH_AS_FALSE)
-/*
- * The calculate_real_depth() inline function traces the path of the state
- * up to the original state, and thus calculates its real depth.
- *
- * It then assigns the newly updated depth throughout the path.
- *
- * */
-
-static inline void calculate_real_depth(const fcs_bool_t calc_real_depth,
-    fcs_collectible_state_t *const ptr_state_orig)
-{
-    if (calc_real_depth)
+    /*
+     * The calculate_real_depth() inline function traces the path of the state
+     * up to the original state, and thus calculates its real depth.
+     *
+     * It then assigns the newly updated depth throughout the path.
+     *
+     * */
+
+    static inline void calculate_real_depth(const fcs_bool_t calc_real_depth,
+        fcs_collectible_state_t *const ptr_state_orig)
     {
-        int_fast32_t this_real_depth = -1;
-        fcs_collectible_state_t *temp_state = ptr_state_orig;
-        /* Count the number of states until the original state. */
-        while (temp_state != NULL)
-        {
-            temp_state = FCS_S_PARENT(temp_state);
-            ++this_real_depth;
-        }
-        temp_state = ptr_state_orig;
-        /* Assign the new depth throughout the path */
-        while (FCS_S_DEPTH(temp_state) != this_real_depth)
+        if (calc_real_depth)
         {
-            FCS_S_DEPTH(temp_state) = this_real_depth;
-            --this_real_depth;
-            temp_state = FCS_S_PARENT(temp_state);
+            int_fast32_t this_real_depth = -1;
+            fcs_collectible_state_t *temp_state = ptr_state_orig;
+            /* Count the number of states until the original state. */
+            while (temp_state != NULL)
+            {
+                temp_state = FCS_S_PARENT(temp_state);
+                ++this_real_depth;
+            }
+            temp_state = ptr_state_orig;
+            /* Assign the new depth throughout the path */
+            while (FCS_S_DEPTH(temp_state) != this_real_depth)
+            {
+                FCS_S_DEPTH(temp_state) = this_real_depth;
+                --this_real_depth;
+                temp_state = FCS_S_PARENT(temp_state);
+            }
         }
     }
-}
 #else
 #define calculate_real_depth(calc_real_depth, ptr_state_orig)
 #endif
 
-/*
- * The mark_as_dead_end() inline function marks a state as a dead end, and
- * afterwards propagates this information to its parent and ancestor states.
- *
- * */
+    /*
+     * The mark_as_dead_end() inline function marks a state as a dead end, and
+     * afterwards propagates this information to its parent and ancestor states.
+     *
+     * */
 
-static inline void mark_as_dead_end__proto(
-    fcs_collectible_state_t *const ptr_state_input)
-{
-    fcs_collectible_state_t *temp_state = (ptr_state_input);
-    /* Mark as a dead end */
-    FCS_S_VISITED(temp_state) |= FCS_VISITED_DEAD_END;
-    temp_state = FCS_S_PARENT(temp_state);
-    if (temp_state != NULL)
+    static inline void mark_as_dead_end__proto(
+        fcs_collectible_state_t *const ptr_state_input)
     {
-        /* Decrease the refcount of the state */
-        --(FCS_S_NUM_ACTIVE_CHILDREN(temp_state));
-        while ((FCS_S_NUM_ACTIVE_CHILDREN(temp_state) == 0) &&
-               (FCS_S_VISITED(temp_state) & FCS_VISITED_ALL_TESTS_DONE))
+        fcs_collectible_state_t *temp_state = (ptr_state_input);
+        /* Mark as a dead end */
+        FCS_S_VISITED(temp_state) |= FCS_VISITED_DEAD_END;
+        temp_state = FCS_S_PARENT(temp_state);
+        if (temp_state != NULL)
         {
-            /* Mark as dead end */
-            FCS_S_VISITED(temp_state) |= FCS_VISITED_DEAD_END;
-            /* Go to its parent state */
-            temp_state = FCS_S_PARENT(temp_state);
-            if (temp_state == NULL)
+            /* Decrease the refcount of the state */
+            --(FCS_S_NUM_ACTIVE_CHILDREN(temp_state));
+            while ((FCS_S_NUM_ACTIVE_CHILDREN(temp_state) == 0) &&
+                   (FCS_S_VISITED(temp_state) & FCS_VISITED_ALL_TESTS_DONE))
             {
-                break;
+                /* Mark as dead end */
+                FCS_S_VISITED(temp_state) |= FCS_VISITED_DEAD_END;
+                /* Go to its parent state */
+                temp_state = FCS_S_PARENT(temp_state);
+                if (temp_state == NULL)
+                {
+                    break;
+                }
+                /* Decrease the refcount */
+                (FCS_S_NUM_ACTIVE_CHILDREN(temp_state))--;
             }
-            /* Decrease the refcount */
-            (FCS_S_NUM_ACTIVE_CHILDREN(temp_state))--;
         }
     }
-}
 
 #ifdef FCS_HARD_CODE_SCANS_SYNERGY_AS_TRUE
 #define MARK_AS_DEAD_END(state)                                                \
@@ -412,27 +415,27 @@ static inline void mark_as_dead_end__proto(
         BUMP_NUM_CHECKED_STATES__HT()                                          \
     }
 
-static inline fcs_game_limit_t count_num_vacant_stacks(
-    const fcs_game_limit_t stacks_num, const fcs_state_t *const state_ptr)
-{
-    fcs_game_limit_t num_vacant_stacks = 0;
-
-    for (int i = 0; i < stacks_num; i++)
+    static inline fcs_game_limit_t count_num_vacant_stacks(
+        const fcs_game_limit_t stacks_num, const fcs_state_t *const state_ptr)
     {
-        if (fcs_state_col_is_empty(*state_ptr, i))
+        fcs_game_limit_t num_vacant_stacks = 0;
+
+        for (int i = 0; i < stacks_num; i++)
         {
-            ++num_vacant_stacks;
+            if (fcs_state_col_is_empty(*state_ptr, i))
+            {
+                ++num_vacant_stacks;
+            }
         }
-    }
 
-    return num_vacant_stacks;
-}
+        return num_vacant_stacks;
+    }
 
-static inline fcs_bool_t fcs__should_state_be_pruned__state(
-    const fcs_collectible_state_t *const ptr_state)
-{
-    return (!(FCS_S_VISITED(ptr_state) & FCS_VISITED_GENERATED_BY_PRUNING));
-}
+    static inline fcs_bool_t fcs__should_state_be_pruned__state(
+        const fcs_collectible_state_t *const ptr_state)
+    {
+        return (!(FCS_S_VISITED(ptr_state) & FCS_VISITED_GENERATED_BY_PRUNING));
+    }
 
 #ifdef FCS_ENABLE_PRUNE__R_TF__UNCOND
 #define fcs__should_state_be_pruned(enable_pruning, ptr_state)                 \
@@ -455,18 +458,18 @@ static inline fcs_bool_t fcs__should_state_be_pruned(
         (instance->effective_max_num_checked_states -                          \
             (instance->i__num_checked_states)))
 #endif
-static inline fcs_int_limit_t calc_ht_max_num_states(
-    const fc_solve_instance_t *const instance,
-    const fc_solve_hard_thread_t *const hard_thread)
-{
-    const_AUTO(a, HT_FIELD(hard_thread, ht__max_num_checked_states));
+    static inline fcs_int_limit_t calc_ht_max_num_states(
+        const fc_solve_instance_t *const instance,
+        const fc_solve_hard_thread_t *const hard_thread)
+    {
+        const_AUTO(a, HT_FIELD(hard_thread, ht__max_num_checked_states));
 #ifdef FCS_WITHOUT_MAX_NUM_STATES
-    return a;
+        return a;
 #else
     const_AUTO(b, CALC_HARD_THREAD_MAX_NUM_CHECKED_STATES__HELPER());
     return min(a, b);
 #endif
-}
+    }
 
 #undef state
 #undef ptr_state_key
diff --git a/fc-solve/source/set_weights.h b/fc-solve/source/set_weights.h
index 0c6742553..aafbf7615 100644
--- a/fc-solve/source/set_weights.h
+++ b/fc-solve/source/set_weights.h
@@ -13,40 +13,41 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "rinutils.h"
 #include "fcs_user.h"
 
-static inline void fc_solve_set_weights(freecell_solver_str_t start_num,
-    const freecell_solver_str_t string_end, double *const befs_weights)
-{
-    for (int i = 0; i < FCS_NUM_BEFS_WEIGHTS; ++i)
+    static inline void fc_solve_set_weights(freecell_solver_str_t start_num,
+        const freecell_solver_str_t string_end, double *const befs_weights)
     {
-        while (*start_num == ',')
-        {
-            start_num++;
-        }
-        if (start_num >= string_end)
+        for (int i = 0; i < FCS_NUM_BEFS_WEIGHTS; ++i)
         {
-            /* Initialize all the Best First Search weights at first
-             * to 0 so
-             * we won't have partial initialization.
-             * */
-            do
+            while (*start_num == ',')
+            {
+                start_num++;
+            }
+            if (start_num >= string_end)
             {
-                befs_weights[i++] = 0.0;
-            } while (i < FCS_NUM_BEFS_WEIGHTS);
+                /* Initialize all the Best First Search weights at first
+                 * to 0 so
+                 * we won't have partial initialization.
+                 * */
+                do
+                {
+                    befs_weights[i++] = 0.0;
+                } while (i < FCS_NUM_BEFS_WEIGHTS);
 
-            return;
+                return;
+            }
+            char *end_num;
+            const_AUTO(val, strtod(start_num, &end_num));
+            befs_weights[i] = max(val, 0.0);
+            start_num = end_num;
         }
-        char *end_num;
-        const_AUTO(val, strtod(start_num, &end_num));
-        befs_weights[i] = max(val, 0.0);
-        start_num = end_num;
     }
-}
 
 #ifdef __cplusplus
 }
diff --git a/fc-solve/source/simpsim.h b/fc-solve/source/simpsim.h
index e51992ab7..15a6cd8cb 100644
--- a/fc-solve/source/simpsim.h
+++ b/fc-solve/source/simpsim.h
@@ -14,28 +14,31 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "instance.h"
 
 #ifndef FCS_DISABLE_SIMPLE_SIMON
 
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_simple_simon_move_sequence_to_founds);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_simple_simon_move_sequence_to_true_parent);
-DECLARE_MOVE_FUNCTION(
-    fc_solve_sfs_simple_simon_move_whole_stack_sequence_to_false_parent);
-DECLARE_MOVE_FUNCTION(
-    fc_solve_sfs_simple_simon_move_sequence_to_true_parent_with_some_cards_above);
-DECLARE_MOVE_FUNCTION(
-    fc_solve_sfs_simple_simon_move_sequence_with_some_cards_above_to_true_parent);
-DECLARE_MOVE_FUNCTION(
-    fc_solve_sfs_simple_simon_move_sequence_with_junk_seq_above_to_true_parent_with_some_cards_above);
-DECLARE_MOVE_FUNCTION(
-    fc_solve_sfs_simple_simon_move_whole_stack_sequence_to_false_parent_with_some_cards_above);
-DECLARE_MOVE_FUNCTION(
-    fc_solve_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack);
-DECLARE_MOVE_FUNCTION(fc_solve_sfs_simple_simon_move_sequence_to_false_parent);
+    DECLARE_MOVE_FUNCTION(fc_solve_sfs_simple_simon_move_sequence_to_founds);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_simple_simon_move_sequence_to_true_parent);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_simple_simon_move_whole_stack_sequence_to_false_parent);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_simple_simon_move_sequence_to_true_parent_with_some_cards_above);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_simple_simon_move_sequence_with_some_cards_above_to_true_parent);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_simple_simon_move_sequence_with_junk_seq_above_to_true_parent_with_some_cards_above);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_simple_simon_move_whole_stack_sequence_to_false_parent_with_some_cards_above);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack);
+    DECLARE_MOVE_FUNCTION(
+        fc_solve_sfs_simple_simon_move_sequence_to_false_parent);
 
 #endif
 
diff --git a/fc-solve/source/state.h b/fc-solve/source/state.h
index ec6f29b7a..bc5fcec50 100644
--- a/fc-solve/source/state.h
+++ b/fc-solve/source/state.h
@@ -11,7 +11,8 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include <ctype.h>
@@ -52,46 +53,46 @@ extern "C" {
     ((FCS_S_SCAN_VISITED(ptr_state))[(scan_id) >> FCS_CHAR_BIT_SIZE_LOG2] &    \
         (1 << ((scan_id) & ((1 << (FCS_CHAR_BIT_SIZE_LOG2)) - 1))))
 
-typedef char fcs_card_t;
-typedef fcs_card_t *fcs_cards_column_t;
-typedef const fcs_card_t *fcs_const_cards_column_t;
-typedef fcs_card_t fcs_state_foundation_t;
+    typedef char fcs_card_t;
+    typedef fcs_card_t *fcs_cards_column_t;
+    typedef const fcs_card_t *fcs_const_cards_column_t;
+    typedef fcs_card_t fcs_state_foundation_t;
 
 #ifdef COMPACT_STATES
-/*
- * Card:
- * Bits 0-3 - Card Number
- * Bits 4-5 - Deck
- *
- */
+    /*
+     * Card:
+     * Bits 0-3 - Card Number
+     * Bits 4-5 - Deck
+     *
+     */
 
-typedef struct
-{
-    fcs_card_t data[MAX_NUM_STACKS * (MAX_NUM_CARDS_IN_A_STACK + 1) +
-                    MAX_NUM_FREECELLS + 4 * MAX_NUM_DECKS];
-} fcs_state_t;
+    typedef struct
+    {
+        fcs_card_t data[MAX_NUM_STACKS * (MAX_NUM_CARDS_IN_A_STACK + 1) +
+                        MAX_NUM_FREECELLS + 4 * MAX_NUM_DECKS];
+    } fcs_state_t;
 
-/*
- * Stack: 0 - Number of cards
- *        1-19 - Cards
- * Stacks: stack_num*20 where stack_num >= 0 and
- *         stack_num <= (MAX_NUM_STACKS-1)
- * Bytes: (MAX_NUM_STACKS*20) to
- *      (MAX_NUM_STACKS*20+MAX_NUM_FREECELLS-1)
- *      are Freecells.
- * Bytes: (MAX_NUM_STACKS*20+MAX_NUM_FREECELLS) to
- *      MAX_NUM_STACKS*20+MAX_NUM_FREECELLS+3
- *      are Foundations.
- * */
+    /*
+     * Stack: 0 - Number of cards
+     *        1-19 - Cards
+     * Stacks: stack_num*20 where stack_num >= 0 and
+     *         stack_num <= (MAX_NUM_STACKS-1)
+     * Bytes: (MAX_NUM_STACKS*20) to
+     *      (MAX_NUM_STACKS*20+MAX_NUM_FREECELLS-1)
+     *      are Freecells.
+     * Bytes: (MAX_NUM_STACKS*20+MAX_NUM_FREECELLS) to
+     *      MAX_NUM_STACKS*20+MAX_NUM_FREECELLS+3
+     *      are Foundations.
+     * */
 
-/*  ===== Depracated Information =====
- * Stack: 0 - Number of cards 1-19 - Cards
- * Stacks: stack_num*20 where stack_num >= 0 and stack_num <= 7
- * Bytes 160-163 - Freecells
- * Bytes 164-167 - Decks
- */
+    /*  ===== Depracated Information =====
+     * Stack: 0 - Number of cards 1-19 - Cards
+     * Stacks: stack_num*20 where stack_num >= 0 and stack_num <= 7
+     * Bytes 160-163 - Freecells
+     * Bytes 164-167 - Decks
+     */
 
-typedef char fcs_locs_t;
+    typedef char fcs_locs_t;
 
 #define fcs_state_get_col(state, col_idx)                                      \
     ((state).data + ((col_idx) * (MAX_NUM_CARDS_IN_A_STACK + 1)))
@@ -175,10 +176,10 @@ typedef uint8_t fcs_locs_t;
 #define fcs_card_is_empty(card) ((card) == 0)
 #define fcs_card_is_valid(card) ((card) != 0)
 
-static inline fcs_card_t fcs_make_card(const int rank, const int suit)
-{
-    return (fcs_card_t)((((fcs_card_t)rank) << 2) | ((fcs_card_t)suit));
-}
+    static inline fcs_card_t fcs_make_card(const int rank, const int suit)
+    {
+        return (fcs_card_t)((((fcs_card_t)rank) << 2) | ((fcs_card_t)suit));
+    }
 
 #define fcs_card2char(c) (c)
 #define fcs_char2card(c) (c)
@@ -191,152 +192,152 @@ static inline fcs_card_t fcs_make_card(const int rank, const int suit)
 #define fcs_card_rank(card) ((card) >> 2)
 #define fcs_card_suit(card) ((card)&0x03)
 
-static inline fcs_card_t fcs_col_get_rank(
-    const fcs_const_cards_column_t col, const int card_idx)
-{
-    return fcs_card_rank(fcs_col_get_card(col, card_idx));
-}
+    static inline fcs_card_t fcs_col_get_rank(
+        const fcs_const_cards_column_t col, const int card_idx)
+    {
+        return fcs_card_rank(fcs_col_get_card(col, card_idx));
+    }
 #define FCS_RANK_KING 13
 #include "is_king.h"
-static inline fcs_bool_t fcs_card_is_king(const fcs_card_t card)
-{
-    return fc_solve_is_king_buf[(size_t)card];
-}
+    static inline fcs_bool_t fcs_card_is_king(const fcs_card_t card)
+    {
+        return fc_solve_is_king_buf[(size_t)card];
+    }
 
-static inline fcs_bool_t fcs_col_is_king(
-    const fcs_const_cards_column_t col, const int card_idx)
-{
-    return fcs_card_is_king(fcs_col_get_card(col, card_idx));
-}
+    static inline fcs_bool_t fcs_col_is_king(
+        const fcs_const_cards_column_t col, const int card_idx)
+    {
+        return fcs_card_is_king(fcs_col_get_card(col, card_idx));
+    }
 
-struct fcs_state_keyval_pair_struct;
+    struct fcs_state_keyval_pair_struct;
 
-/*
- * NOTE: the order of elements here is intended to reduce framgmentation
- * and memory consumption. Namely:
- *
- * 1. Pointers come first.
- *
- * 2. ints (32-bit on most platform) come next.
- *
- * 3. chars come next.
- *
- * */
-struct fcs_state_extra_info_struct
-{
+    /*
+     * NOTE: the order of elements here is intended to reduce framgmentation
+     * and memory consumption. Namely:
+     *
+     * 1. Pointers come first.
+     *
+     * 2. ints (32-bit on most platform) come next.
+     *
+     * 3. chars come next.
+     *
+     * */
+    struct fcs_state_extra_info_struct
+    {
 #ifdef FCS_RCS_STATES
-    struct fcs_state_extra_info_struct *parent;
+        struct fcs_state_extra_info_struct *parent;
 #else
     struct fcs_state_keyval_pair_struct *parent;
 #endif
 #ifdef FCS_WITH_MOVES
-    fcs_move_stack_t *moves_to_parent;
+        fcs_move_stack_t *moves_to_parent;
 #endif
 
 #ifndef FCS_WITHOUT_DEPTH_FIELD
-    int depth;
+        int depth;
 #endif
 
 #ifndef FCS_WITHOUT_VISITED_ITER
-    /*
-     * The iteration in which this state was marked as visited
-     * */
-    fcs_int_limit_t visited_iter;
+        /*
+         * The iteration in which this state was marked as visited
+         * */
+        fcs_int_limit_t visited_iter;
 #endif
 
-    /*
-     * This is the number of direct children of this state which were not
-     * yet declared as dead ends. Once this counter reaches zero, this
-     * state too is declared as a dead end.
-     *
-     * It was converted to an unsigned short , because it is extremely
-     * unlikely that a state will have more than 64K active children.
-     * */
-    unsigned short num_active_children;
-
-    /*
-     * This field contains global, scan-independant flags, which are used
-     * from the FCS_VISITED_* enum below.
-     *
-     * FCS_VISITED_IN_SOLUTION_PATH - indicates that the state is in the
-     * solution path found by the scan. (used by the optimization scan)
-     *
-     * FCS_VISITED_IN_OPTIMIZED_PATH - indicates that the state is in the
-     * optimized solution path which is computed by the optimization scan.
-     *
-     * FCS_VISITED_DEAD_END - indicates that the state does not lead to
-     * anywhere useful, and scans should not examine it in the first place.
-     *
-     * FCS_VISITED_GENERATED_BY_PRUNING - indicates that the state was
-     * generated by pruning, so one can skip calling the pruning function
-     * for it.
-     * */
-    fcs_game_limit_t visited;
-
-    /*
-     * This is a vector of flags - one for each scan. Each indicates whether
-     * its scan has already visited this state
-     * */
-    unsigned char scan_visited[FCS_MAX_NUM_SCANS_BUCKETS];
+        /*
+         * This is the number of direct children of this state which were not
+         * yet declared as dead ends. Once this counter reaches zero, this
+         * state too is declared as a dead end.
+         *
+         * It was converted to an unsigned short , because it is extremely
+         * unlikely that a state will have more than 64K active children.
+         * */
+        unsigned short num_active_children;
+
+        /*
+         * This field contains global, scan-independant flags, which are used
+         * from the FCS_VISITED_* enum below.
+         *
+         * FCS_VISITED_IN_SOLUTION_PATH - indicates that the state is in the
+         * solution path found by the scan. (used by the optimization scan)
+         *
+         * FCS_VISITED_IN_OPTIMIZED_PATH - indicates that the state is in the
+         * optimized solution path which is computed by the optimization scan.
+         *
+         * FCS_VISITED_DEAD_END - indicates that the state does not lead to
+         * anywhere useful, and scans should not examine it in the first place.
+         *
+         * FCS_VISITED_GENERATED_BY_PRUNING - indicates that the state was
+         * generated by pruning, so one can skip calling the pruning function
+         * for it.
+         * */
+        fcs_game_limit_t visited;
+
+        /*
+         * This is a vector of flags - one for each scan. Each indicates whether
+         * its scan has already visited this state
+         * */
+        unsigned char scan_visited[FCS_MAX_NUM_SCANS_BUCKETS];
 
 #ifdef INDIRECT_STACK_STATES
-    /*
-     * A vector of flags that indicates which columns were already copied.
-     * */
-    int stacks_copy_on_write_flags;
+        /*
+         * A vector of flags that indicates which columns were already copied.
+         * */
+        int stacks_copy_on_write_flags;
 #endif
-};
-
-typedef struct
-{
-    /*
-     * These contain the location of the original columns and freecells
-     * in the permutation of them. They are sorted by the canonization
-     * function.
-     * */
-    fcs_locs_t stack_locs[MAX_NUM_STACKS];
-    fcs_locs_t fc_locs[MAX_NUM_FREECELLS];
-} fcs_state_locs_struct_t;
+    };
 
-static inline void fc_solve_init_locs(fcs_state_locs_struct_t *const locs)
-{
-    for (int i = 0; i < MAX_NUM_STACKS; ++i)
+    typedef struct
     {
-        locs->stack_locs[i] = (fcs_locs_t)i;
-    }
-    for (int i = 0; i < MAX_NUM_FREECELLS; ++i)
+        /*
+         * These contain the location of the original columns and freecells
+         * in the permutation of them. They are sorted by the canonization
+         * function.
+         * */
+        fcs_locs_t stack_locs[MAX_NUM_STACKS];
+        fcs_locs_t fc_locs[MAX_NUM_FREECELLS];
+    } fcs_state_locs_struct_t;
+
+    static inline void fc_solve_init_locs(fcs_state_locs_struct_t *const locs)
     {
-        locs->fc_locs[i] = (fcs_locs_t)i;
+        for (int i = 0; i < MAX_NUM_STACKS; ++i)
+        {
+            locs->stack_locs[i] = (fcs_locs_t)i;
+        }
+        for (int i = 0; i < MAX_NUM_FREECELLS; ++i)
+        {
+            locs->fc_locs[i] = (fcs_locs_t)i;
+        }
     }
-}
 
-typedef struct fcs_state_extra_info_struct fcs_state_extra_info_t;
+    typedef struct fcs_state_extra_info_struct fcs_state_extra_info_t;
 
-struct fcs_state_keyval_pair_struct
-{
-    union {
-        struct
-        {
-            fcs_state_t s;
-            fcs_state_extra_info_t info;
+    struct fcs_state_keyval_pair_struct
+    {
+        union {
+            struct
+            {
+                fcs_state_t s;
+                fcs_state_extra_info_t info;
+            };
+            struct fcs_state_keyval_pair_struct *next;
         };
-        struct fcs_state_keyval_pair_struct *next;
     };
-};
 
-typedef struct fcs_state_keyval_pair_struct fcs_state_keyval_pair_t;
+    typedef struct fcs_state_keyval_pair_struct fcs_state_keyval_pair_t;
 
-typedef struct
-{
-    fcs_state_t *key;
-    fcs_state_extra_info_t *val;
-} fcs_kv_state_t;
+    typedef struct
+    {
+        fcs_state_t *key;
+        fcs_state_extra_info_t *val;
+    } fcs_kv_state_t;
 
-static inline fcs_kv_state_t FCS_STATE_keyval_pair_to_kv(
-    fcs_state_keyval_pair_t *const s)
-{
-    return (const fcs_kv_state_t){.key = &(s->s), .val = &(s->info)};
-}
+    static inline fcs_kv_state_t FCS_STATE_keyval_pair_to_kv(
+        fcs_state_keyval_pair_t *const s)
+    {
+        return (const fcs_kv_state_t){.key = &(s->s), .val = &(s->info)};
+    }
 
 /* Always the same. */
 #define fcs_duplicate_kv_state(ptr_dest, ptr_src)                              \
@@ -355,23 +356,23 @@ static inline fcs_kv_state_t FCS_STATE_keyval_pair_to_kv(
  *
  * */
 #ifdef FCS_RCS_STATES
-typedef fcs_state_extra_info_t fcs_collectible_state_t;
+    typedef fcs_state_extra_info_t fcs_collectible_state_t;
 #define FCS_S_ACCESSOR(s, field) ((s)->field)
 
 #define fcs_duplicate_state(x, y) fcs_duplicate_kv_state((x), (y))
 
 #define FCS_STATE_keyval_pair_to_collectible(s) (&((s)->info))
-static inline fcs_collectible_state_t *FCS_STATE_kv_to_collectible(
-    fcs_kv_state_t *const s)
-{
-    return s->val;
-}
+    static inline fcs_collectible_state_t *FCS_STATE_kv_to_collectible(
+        fcs_kv_state_t *const s)
+    {
+        return s->val;
+    }
 
-static inline void FCS_STATE_collectible_to_kv(
-    fcs_kv_state_t *const ret, fcs_collectible_state_t *const s)
-{
-    ret->val = s;
-}
+    static inline void FCS_STATE_collectible_to_kv(
+        fcs_kv_state_t *const ret, fcs_collectible_state_t *const s)
+    {
+        ret->val = s;
+    }
 
 #else
 
@@ -449,36 +450,36 @@ static inline void FCS_STATE_collectible_to_kv(
 
 #define PASS_T(arg) FC_SOLVE__PASS_T(arg)
 
-extern void fc_solve_canonize_state(
-    fcs_state_t *const ptr_state_key FREECELLS_AND_STACKS_ARGS());
+    extern void fc_solve_canonize_state(
+        fcs_state_t *const ptr_state_key FREECELLS_AND_STACKS_ARGS());
 
-void fc_solve_canonize_state_with_locs(fcs_state_t *const ptr_state_key,
-    fcs_state_locs_struct_t *const locs FREECELLS_AND_STACKS_ARGS());
+    void fc_solve_canonize_state_with_locs(fcs_state_t *const ptr_state_key,
+        fcs_state_locs_struct_t *const locs FREECELLS_AND_STACKS_ARGS());
 
 #if (FCS_STATE_STORAGE != FCS_STATE_STORAGE_LIBREDBLACK_TREE)
-typedef void *fcs_compare_context_t;
+    typedef void *fcs_compare_context_t;
 #else
 typedef const void *fcs_compare_context_t;
 #endif
 
-static inline int fc_solve_state_compare(
-    const void *const s1, const void *const s2)
-{
-    return memcmp(s1, s2, sizeof(fcs_state_t));
-}
+    static inline int fc_solve_state_compare(
+        const void *const s1, const void *const s2)
+    {
+        return memcmp(s1, s2, sizeof(fcs_state_t));
+    }
 
 #if (FCS_STATE_STORAGE == FCS_STATE_STORAGE_GLIB_HASH)
-extern int fc_solve_state_compare_equal(const void *, const void *);
+    extern int fc_solve_state_compare_equal(const void *, const void *);
 #endif
-extern int fc_solve_state_compare_with_context(
-    const void *, const void *, fcs_compare_context_t);
+    extern int fc_solve_state_compare_with_context(
+        const void *, const void *, fcs_compare_context_t);
 
-/*
- * Convert an entire card to its user representation.
- *
- * */
-extern void fc_solve_card_stringify(
-    const fcs_card_t card, char *const str PASS_T(const fcs_bool_t t));
+    /*
+     * Convert an entire card to its user representation.
+     *
+     * */
+    extern void fc_solve_card_stringify(
+        const fcs_card_t card, char *const str PASS_T(const fcs_bool_t t));
 
 #ifdef FC_SOLVE__STRICTER_BOARD_PARSING
 #define FC_SOLVE_MAP_CHAR(c) (c)
@@ -486,100 +487,100 @@ extern void fc_solve_card_stringify(
 #define FC_SOLVE_MAP_CHAR(c) (toupper(c))
 #endif
 
-/*
- * This function converts a string containing a suit letter (that is
- * one of H,S,D,C) into its suit ID.
- *
- * The suit letter may come somewhat after the beginning of the string.
- *
- * */
-static inline __attribute__((pure)) int fcs_str2suit(const char *suit)
-{
-    while (TRUE)
+    /*
+     * This function converts a string containing a suit letter (that is
+     * one of H,S,D,C) into its suit ID.
+     *
+     * The suit letter may come somewhat after the beginning of the string.
+     *
+     * */
+    static inline __attribute__((pure)) int fcs_str2suit(const char *suit)
     {
-        switch (FC_SOLVE_MAP_CHAR(*suit))
+        while (TRUE)
         {
-        case 'H':
-        case ' ':
-        case '\0':
-            return 0;
-        case 'C':
-            return 1;
-        case 'D':
-            return 2;
-        case 'S':
-            return 3;
-        default:
-            ++suit;
+            switch (FC_SOLVE_MAP_CHAR(*suit))
+            {
+            case 'H':
+            case ' ':
+            case '\0':
+                return 0;
+            case 'C':
+                return 1;
+            case 'D':
+                return 2;
+            case 'S':
+                return 3;
+            default:
+                ++suit;
+            }
         }
     }
-}
 
-/*
- * This function converts a card number from its user representation
- * (e.g: "A", "K", "9") to its card number that can be used by
- * the program.
- * */
+    /*
+     * This function converts a card number from its user representation
+     * (e.g: "A", "K", "9") to its card number that can be used by
+     * the program.
+     * */
 
-static inline __attribute__((pure)) int fcs_str2rank(const char *string)
-{
-    while (1)
+    static inline __attribute__((pure)) int fcs_str2rank(const char *string)
     {
-        switch (FC_SOLVE_MAP_CHAR(*string))
+        while (1)
         {
-        case '\0':
-        case ' ':
-        case '\t':
-        case '\n':
-        case '\r':
-            return 0;
-        case 'A':
-            return 1;
-        case 'J':
-            return 11;
-        case 'Q':
-            return 12;
-        case 'K':
-            return 13;
+            switch (FC_SOLVE_MAP_CHAR(*string))
+            {
+            case '\0':
+            case ' ':
+            case '\t':
+            case '\n':
+            case '\r':
+                return 0;
+            case 'A':
+                return 1;
+            case 'J':
+                return 11;
+            case 'Q':
+                return 12;
+            case 'K':
+                return 13;
 #ifndef FC_SOLVE__STRICTER_BOARD_PARSING
-        case '1':
-            return (string[1] == '0') ? 10 : 1;
+            case '1':
+                return (string[1] == '0') ? 10 : 1;
 #endif
-        case 'T':
+            case 'T':
 #ifndef FC_SOLVE__STRICTER_BOARD_PARSING
-        case '0':
+            case '0':
 #endif
-            return 10;
-        case '2':
-            return 2;
-        case '3':
-            return 3;
-        case '4':
-            return 4;
-        case '5':
-            return 5;
-        case '6':
-            return 6;
-        case '7':
-            return 7;
-        case '8':
-            return 8;
-        case '9':
-            return 9;
-        default:
-            ++string;
+                return 10;
+            case '2':
+                return 2;
+            case '3':
+                return 3;
+            case '4':
+                return 4;
+            case '5':
+                return 5;
+            case '6':
+                return 6;
+            case '7':
+                return 7;
+            case '8':
+                return 8;
+            case '9':
+                return 9;
+            default:
+                ++string;
+            }
         }
     }
-}
-/*
- * This function converts an entire card from its string representations
- * (e.g: "AH", "KS", "8D"), to a fcs_card_t data type.
- * */
-static inline __attribute__((pure)) fcs_card_t fc_solve_card_parse_str(
-    const char *const str)
-{
-    return fcs_make_card(fcs_str2rank(str), fcs_str2suit(str));
-}
+    /*
+     * This function converts an entire card from its string representations
+     * (e.g: "AH", "KS", "8D"), to a fcs_card_t data type.
+     * */
+    static inline __attribute__((pure)) fcs_card_t fc_solve_card_parse_str(
+        const char *const str)
+    {
+        return fcs_make_card(fcs_str2rank(str), fcs_str2suit(str));
+    }
 
 #ifdef INDIRECT_STACK_STATES
 #define fc_solve_state_init(state, stacks_num, indirect_stacks_buffer)         \
@@ -590,40 +591,41 @@ static inline __attribute__((pure)) fcs_card_t fc_solve_card_parse_str(
     fc_solve_state_init_proto(state PASS_STACKS(stacks_num))
 #endif
 
-static inline void fc_solve_state_init_proto(
-    fcs_state_keyval_pair_t *const state STACKS_NUM__ARG GCC_UNUSED
-        IND_BUF_T_PARAM(indirect_stacks_buffer))
-{
-    memset(&(state->s), 0, sizeof(state->s));
-#ifdef INDIRECT_STACK_STATES
-    size_t i;
-    for (i = 0; i < STACKS_NUM__VAL; ++i)
-    {
-        memset(state->s.columns[i] = &indirect_stacks_buffer[i << 7], '\0',
-            MAX_NUM_DECKS * 52 + 1);
-    }
-    for (; i < MAX_NUM_STACKS; ++i)
+    static inline void fc_solve_state_init_proto(
+        fcs_state_keyval_pair_t *const state STACKS_NUM__ARG GCC_UNUSED
+            IND_BUF_T_PARAM(indirect_stacks_buffer))
     {
-        state->s.columns[i] = NULL;
-    }
+        memset(&(state->s), 0, sizeof(state->s));
+#ifdef INDIRECT_STACK_STATES
+        size_t i;
+        for (i = 0; i < STACKS_NUM__VAL; ++i)
+        {
+            memset(state->s.columns[i] = &indirect_stacks_buffer[i << 7], '\0',
+                MAX_NUM_DECKS * 52 + 1);
+        }
+        for (; i < MAX_NUM_STACKS; ++i)
+        {
+            state->s.columns[i] = NULL;
+        }
 #endif
-    state->info.parent = NULL;
+        state->info.parent = NULL;
 #ifdef FCS_WITH_MOVES
-    state->info.moves_to_parent = NULL;
+        state->info.moves_to_parent = NULL;
 #endif
 #ifndef FCS_WITHOUT_DEPTH_FIELD
-    state->info.depth = 0;
+        state->info.depth = 0;
 #endif
-    state->info.visited = 0;
+        state->info.visited = 0;
 #ifndef FCS_WITHOUT_VISITED_ITER
-    state->info.visited_iter = 0;
+        state->info.visited_iter = 0;
 #endif
-    state->info.num_active_children = 0;
-    memset(state->info.scan_visited, '\0', sizeof(state->info.scan_visited));
+        state->info.num_active_children = 0;
+        memset(
+            state->info.scan_visited, '\0', sizeof(state->info.scan_visited));
 #ifdef INDIRECT_STACK_STATES
-    state->info.stacks_copy_on_write_flags = 0;
+        state->info.stacks_copy_on_write_flags = 0;
 #endif
-}
+    }
 
 #ifdef FCS_BREAK_BACKWARD_COMPAT_1
 #define FCS_PARSE_try_prefix(str, p, p_s) try_str_prefix(str, p)
@@ -660,15 +662,15 @@ static inline const char *fc_solve__try_prefixes(
         out_state PASS_FREECELLS(freecells_num) PASS_STACKS(stacks_num)        \
             PASS_DECKS(decks_num) PASS_IND_BUF_T(indirect_stacks_buffer))
 
-static inline fcs_bool_t fc_solve_initial_user_state_to_c_proto(
-    const char *const string,
-    fcs_state_keyval_pair_t *const out_state FREECELLS_STACKS_DECKS__ARGS()
-        IND_BUF_T_PARAM(indirect_stacks_buffer))
-{
-    fc_solve_state_init(out_state, STACKS_NUM__VAL, indirect_stacks_buffer);
-    const char *str = string;
+    static inline fcs_bool_t fc_solve_initial_user_state_to_c_proto(
+        const char *const string,
+        fcs_state_keyval_pair_t *const out_state FREECELLS_STACKS_DECKS__ARGS()
+            IND_BUF_T_PARAM(indirect_stacks_buffer))
+    {
+        fc_solve_state_init(out_state, STACKS_NUM__VAL, indirect_stacks_buffer);
+        const char *str = string;
 
-    fcs_bool_t first_line = TRUE;
+        fcs_bool_t first_line = TRUE;
 
 #define out (out_state->s)
 /* Handle the end of string - shouldn't happen */
@@ -680,253 +682,257 @@ static inline fcs_bool_t fc_solve_initial_user_state_to_c_proto(
         }                                                                      \
     }
 
-    for (size_t s = 0; s < STACKS_NUM__VAL; s++)
-    {
-        /* Move to the next stack */
-        if (!first_line)
+        for (size_t s = 0; s < STACKS_NUM__VAL; s++)
         {
-            while ((*str) != '\n')
+            /* Move to the next stack */
+            if (!first_line)
             {
-                HANDLE_EOS();
+                while ((*str) != '\n')
+                {
+                    HANDLE_EOS();
+                    ++str;
+                }
                 ++str;
             }
-            ++str;
-        }
 
-        first_line = FALSE;
+            first_line = FALSE;
 
-        const_AUTO(new_str, FCS_PARSE_try_prefix(str,
-                                "Freecells:", fc_solve_freecells_prefixes));
-        if (new_str)
-        {
-            str = new_str;
-            for (size_t c = 0; c < FREECELLS_NUM__VAL; ++c)
-            {
-                fcs_empty_freecell(out, c);
-            }
-            for (size_t c = 0; c < FREECELLS_NUM__VAL; ++c)
+            const_AUTO(new_str, FCS_PARSE_try_prefix(str,
+                                    "Freecells:", fc_solve_freecells_prefixes));
+            if (new_str)
             {
-                if (c != 0)
+                str = new_str;
+                for (size_t c = 0; c < FREECELLS_NUM__VAL; ++c)
                 {
-                    while (((*str) != ' ') && ((*str) != '\t') &&
-                           ((*str) != '\n') && ((*str) != '\r'))
+                    fcs_empty_freecell(out, c);
+                }
+                for (size_t c = 0; c < FREECELLS_NUM__VAL; ++c)
+                {
+                    if (c != 0)
                     {
-                        HANDLE_EOS();
+                        while (((*str) != ' ') && ((*str) != '\t') &&
+                               ((*str) != '\n') && ((*str) != '\r'))
+                        {
+                            HANDLE_EOS();
+                            ++str;
+                        }
+                        if ((*str == '\n') || (*str == '\r'))
+                        {
+                            break;
+                        }
                         ++str;
                     }
-                    if ((*str == '\n') || (*str == '\r'))
+
+                    while ((*str == ' ') || (*str == '\t'))
                     {
-                        break;
+                        ++str;
                     }
-                    ++str;
+                    if ((*str == '\r') || (*str == '\n'))
+                        break;
+
+                    fcs_put_card_in_freecell(out, c,
+                        ((*str == '*') || (*str == '-'))
+                            ? fc_solve_empty_card
+                            : ({
+                                  const char rank = fcs_str2rank(str);
+                                  if (!rank)
+                                  {
+                                      return FALSE;
+                                  }
+                                  fcs_make_card(rank, fcs_str2suit(str));
+                              }));
                 }
 
-                while ((*str == ' ') || (*str == '\t'))
+                while (*str != '\n')
                 {
+                    HANDLE_EOS();
                     ++str;
                 }
-                if ((*str == '\r') || (*str == '\n'))
-                    break;
-
-                fcs_put_card_in_freecell(out, c,
-                    ((*str == '*') || (*str == '-')) ? fc_solve_empty_card : ({
-                        const char rank = fcs_str2rank(str);
-                        if (!rank)
-                        {
-                            return FALSE;
-                        }
-                        fcs_make_card(rank, fcs_str2suit(str));
-                    }));
-            }
-
-            while (*str != '\n')
-            {
-                HANDLE_EOS();
-                ++str;
+                --s;
+                continue;
             }
-            --s;
-            continue;
-        }
 
-        const_AUTO(new_str2, FCS_PARSE_try_prefix(str, "Foundations:",
-                                 fc_solve_foundations_prefixes));
-        if (new_str2)
-        {
-            str = new_str2;
-            for (size_t f_idx = 0; f_idx < (DECKS_NUM__VAL << 2); f_idx++)
+            const_AUTO(new_str2, FCS_PARSE_try_prefix(str, "Foundations:",
+                                     fc_solve_foundations_prefixes));
+            if (new_str2)
             {
-                fcs_set_foundation(out, f_idx, 0);
-            }
-
-            size_t decks_index[4] = {0, 0, 0, 0};
-            while (1)
-            {
-                while ((*str == ' ') || (*str == '\t'))
-                    ++str;
-                if ((*str == '\n') || (*str == '\r'))
-                    break;
-                const int f_idx = fcs_str2suit(str);
-                ++str;
-                while (*str == '-')
-                    ++str;
-                /* Workaround for fcs_str2rank's willingness
-                 * to designate the string '0' as 10. */
-                const int c = ((str[0] == '0') ? 0 : fcs_str2rank(str));
-                while ((*str != ' ') && (*str != '\t') && (*str != '\n') &&
-                       (*str != '\r'))
+                str = new_str2;
+                for (size_t f_idx = 0; f_idx < (DECKS_NUM__VAL << 2); f_idx++)
                 {
-                    HANDLE_EOS();
-                    ++str;
+                    fcs_set_foundation(out, f_idx, 0);
                 }
 
-                fcs_set_foundation(out, ((decks_index[f_idx] << 2) + f_idx), c);
-                if ((++decks_index[f_idx]) >= DECKS_NUM__VAL)
+                size_t decks_index[4] = {0, 0, 0, 0};
+                while (1)
                 {
-                    decks_index[f_idx] = 0;
+                    while ((*str == ' ') || (*str == '\t'))
+                        ++str;
+                    if ((*str == '\n') || (*str == '\r'))
+                        break;
+                    const int f_idx = fcs_str2suit(str);
+                    ++str;
+                    while (*str == '-')
+                        ++str;
+                    /* Workaround for fcs_str2rank's willingness
+                     * to designate the string '0' as 10. */
+                    const int c = ((str[0] == '0') ? 0 : fcs_str2rank(str));
+                    while ((*str != ' ') && (*str != '\t') && (*str != '\n') &&
+                           (*str != '\r'))
+                    {
+                        HANDLE_EOS();
+                        ++str;
+                    }
+
+                    fcs_set_foundation(
+                        out, ((decks_index[f_idx] << 2) + f_idx), c);
+                    if ((++decks_index[f_idx]) >= DECKS_NUM__VAL)
+                    {
+                        decks_index[f_idx] = 0;
+                    }
                 }
+                s--;
+                continue;
             }
-            s--;
-            continue;
-        }
 
-        /* Handle columns that start with an initial colon, so we can
-         * input states from -p -t mid-play. */
-        if ((*str) == ':')
-        {
-            ++str;
-        }
+            /* Handle columns that start with an initial colon, so we can
+             * input states from -p -t mid-play. */
+            if ((*str) == ':')
+            {
+                ++str;
+            }
 
-        var_AUTO(col, fcs_state_get_col(out, s));
-        for (int c = 0; c < MAX_NUM_CARDS_IN_A_STACK; c++)
-        {
-            /* Move to the next card */
-            if (c != 0)
+            var_AUTO(col, fcs_state_get_col(out, s));
+            for (int c = 0; c < MAX_NUM_CARDS_IN_A_STACK; c++)
             {
-                while (((*str) != ' ') && ((*str) != '\t') &&
-                       ((*str) != '\n') && ((*str) != '\r'))
+                /* Move to the next card */
+                if (c != 0)
+                {
+                    while (((*str) != ' ') && ((*str) != '\t') &&
+                           ((*str) != '\n') && ((*str) != '\r'))
+                    {
+                        HANDLE_EOS();
+                        ++str;
+                    }
+                    if ((*str == '\n') || (*str == '\r'))
+                    {
+                        break;
+                    }
+                }
+
+                while ((*str == ' ') || (*str == '\t'))
                 {
-                    HANDLE_EOS();
                     ++str;
                 }
+                HANDLE_EOS();
                 if ((*str == '\n') || (*str == '\r'))
                 {
                     break;
                 }
+                const_AUTO(my_card, fc_solve_card_parse_str(str));
+                if (!fcs_card_rank(my_card))
+                {
+                    return FALSE;
+                }
+                fcs_col_push_card(col, my_card);
             }
-
-            while ((*str == ' ') || (*str == '\t'))
-            {
-                ++str;
-            }
-            HANDLE_EOS();
-            if ((*str == '\n') || (*str == '\r'))
-            {
-                break;
-            }
-            const_AUTO(my_card, fc_solve_card_parse_str(str));
-            if (!fcs_card_rank(my_card))
-            {
-                return FALSE;
-            }
-            fcs_col_push_card(col, my_card);
         }
-    }
 
-    return TRUE;
-}
+        return TRUE;
+    }
 
 #undef out
 #undef HANDLE_EOS
 
-extern void fc_solve_state_as_string(char *output_s,
-    const fcs_state_t *const state,
-    const fcs_state_locs_struct_t *const state_locs
-        FREECELLS_STACKS_DECKS__ARGS()
-            FC_SOLVE__PASS_PARSABLE(const fcs_bool_t parseable_output),
-    const fcs_bool_t canonized_order_output PASS_T(
-        const fcs_bool_t display_10_as_t));
-
-typedef enum {
-    FCS_STATE_VALIDITY__OK = 0,
-    FCS_STATE_VALIDITY__MISSING_CARD = 1,
-    FCS_STATE_VALIDITY__EXTRA_CARD = 2,
-    FCS_STATE_VALIDITY__EMPTY_SLOT = 3,
-    FCS_STATE_VALIDITY__PREMATURE_END_OF_INPUT = 4
-} fcs_state_validity_ret_t;
+    extern void fc_solve_state_as_string(char *output_s,
+        const fcs_state_t *const state,
+        const fcs_state_locs_struct_t *const state_locs
+            FREECELLS_STACKS_DECKS__ARGS()
+                FC_SOLVE__PASS_PARSABLE(const fcs_bool_t parseable_output),
+        const fcs_bool_t canonized_order_output PASS_T(
+            const fcs_bool_t display_10_as_t));
+
+    typedef enum
+    {
+        FCS_STATE_VALIDITY__OK = 0,
+        FCS_STATE_VALIDITY__MISSING_CARD = 1,
+        FCS_STATE_VALIDITY__EXTRA_CARD = 2,
+        FCS_STATE_VALIDITY__EMPTY_SLOT = 3,
+        FCS_STATE_VALIDITY__PREMATURE_END_OF_INPUT = 4
+    } fcs_state_validity_ret_t;
 
 #ifndef FCS_DISABLE_STATE_VALIDITY_CHECK
-static inline fcs_state_validity_ret_t fc_solve_check_state_validity(
-    const fcs_state_keyval_pair_t *const state_pair
-        FREECELLS_STACKS_DECKS__ARGS(),
-    fcs_card_t *const misplaced_card)
-{
-    size_t card_counts[FCS_NUM_SUITS][FCS_MAX_RANK + 1];
+    static inline fcs_state_validity_ret_t fc_solve_check_state_validity(
+        const fcs_state_keyval_pair_t *const state_pair
+            FREECELLS_STACKS_DECKS__ARGS(),
+        fcs_card_t *const misplaced_card)
+    {
+        size_t card_counts[FCS_NUM_SUITS][FCS_MAX_RANK + 1];
 
-    const fcs_state_t *const state = &(state_pair->s);
+        const fcs_state_t *const state = &(state_pair->s);
 
-    /* Initialize all card_counts to 0 */
-    for (int suit_idx = 0; suit_idx < FCS_NUM_SUITS; suit_idx++)
-    {
-        for (int c = 1; c <= FCS_MAX_RANK; c++)
+        /* Initialize all card_counts to 0 */
+        for (int suit_idx = 0; suit_idx < FCS_NUM_SUITS; suit_idx++)
         {
-            card_counts[suit_idx][c] = 0;
+            for (int c = 1; c <= FCS_MAX_RANK; c++)
+            {
+                card_counts[suit_idx][c] = 0;
+            }
         }
-    }
 
-    /* Mark the card_counts in the decks */
-    for (size_t suit_idx = 0; suit_idx < (DECKS_NUM__VAL << 2); suit_idx++)
-    {
-        for (int c = 1; c <= fcs_foundation_value(*state, suit_idx); c++)
+        /* Mark the card_counts in the decks */
+        for (size_t suit_idx = 0; suit_idx < (DECKS_NUM__VAL << 2); suit_idx++)
         {
-            card_counts[suit_idx % FCS_NUM_SUITS][c]++;
+            for (int c = 1; c <= fcs_foundation_value(*state, suit_idx); c++)
+            {
+                card_counts[suit_idx % FCS_NUM_SUITS][c]++;
+            }
         }
-    }
 
-    /* Mark the card_counts in the freecells */
-    for (size_t f = 0; f < FREECELLS_NUM__VAL; f++)
-    {
-        const fcs_card_t card = fcs_freecell_card(*state, f);
-        if (fcs_card_is_valid(card))
+        /* Mark the card_counts in the freecells */
+        for (size_t f = 0; f < FREECELLS_NUM__VAL; f++)
         {
-            card_counts[fcs_card_suit(card)][fcs_card_rank(card)]++;
+            const fcs_card_t card = fcs_freecell_card(*state, f);
+            if (fcs_card_is_valid(card))
+            {
+                card_counts[fcs_card_suit(card)][fcs_card_rank(card)]++;
+            }
         }
-    }
 
-    /* Mark the card_counts in the columns */
-    for (size_t s = 0; s < STACKS_NUM__VAL; s++)
-    {
-        const_AUTO(col, fcs_state_get_col(*state, s));
-        const int col_len = fcs_col_len(col);
-        for (int c = 0; c < col_len; c++)
+        /* Mark the card_counts in the columns */
+        for (size_t s = 0; s < STACKS_NUM__VAL; s++)
         {
-            const fcs_card_t card = fcs_col_get_card(col, c);
-            if (fcs_card_is_empty(card))
+            const_AUTO(col, fcs_state_get_col(*state, s));
+            const int col_len = fcs_col_len(col);
+            for (int c = 0; c < col_len; c++)
             {
-                *misplaced_card = fc_solve_empty_card;
-                return FCS_STATE_VALIDITY__EMPTY_SLOT;
+                const fcs_card_t card = fcs_col_get_card(col, c);
+                if (fcs_card_is_empty(card))
+                {
+                    *misplaced_card = fc_solve_empty_card;
+                    return FCS_STATE_VALIDITY__EMPTY_SLOT;
+                }
+                card_counts[fcs_card_suit(card)][fcs_card_rank(card)]++;
             }
-            card_counts[fcs_card_suit(card)][fcs_card_rank(card)]++;
         }
-    }
 
-    /* Now check if there are extra or missing card_counts */
+        /* Now check if there are extra or missing card_counts */
 
-    for (size_t suit_idx = 0; suit_idx < FCS_NUM_SUITS; suit_idx++)
-    {
-        for (size_t rank = 1; rank <= FCS_MAX_RANK; rank++)
+        for (size_t suit_idx = 0; suit_idx < FCS_NUM_SUITS; suit_idx++)
         {
-            if (card_counts[suit_idx][rank] != DECKS_NUM__VAL)
+            for (size_t rank = 1; rank <= FCS_MAX_RANK; rank++)
             {
-                *misplaced_card = fcs_make_card(rank, suit_idx);
-                return ((card_counts[suit_idx][rank] < DECKS_NUM__VAL)
-                            ? FCS_STATE_VALIDITY__MISSING_CARD
-                            : FCS_STATE_VALIDITY__EXTRA_CARD);
+                if (card_counts[suit_idx][rank] != DECKS_NUM__VAL)
+                {
+                    *misplaced_card = fcs_make_card(rank, suit_idx);
+                    return ((card_counts[suit_idx][rank] < DECKS_NUM__VAL)
+                                ? FCS_STATE_VALIDITY__MISSING_CARD
+                                : FCS_STATE_VALIDITY__EXTRA_CARD);
+                }
             }
         }
-    }
 
-    return FCS_STATE_VALIDITY__OK;
-}
+        return FCS_STATE_VALIDITY__OK;
+    }
 #endif
 
 #undef state
@@ -997,13 +1003,13 @@ static inline void set_scan_visited(
         (1 << ((scan_id) & ((1 << (FCS_CHAR_BIT_SIZE_LOG2)) - 1)));
 }
 
-    /*
-     * This macro determines if child can be placed above parent.
-     *
-     * The variable sequences_are_built_by has to be initialized to
-     * the sequences_are_built_by member of the instance.
-     *
-     * */
+/*
+ * This macro determines if child can be placed above parent.
+ *
+ * The variable sequences_are_built_by has to be initialized to
+ * the sequences_are_built_by member of the instance.
+ *
+ * */
 
 #ifdef FCS_FREECELL_ONLY
 
diff --git a/fc-solve/source/str_utils.h b/fc-solve/source/str_utils.h
index e3c69e1f3..993d08cbb 100644
--- a/fc-solve/source/str_utils.h
+++ b/fc-solve/source/str_utils.h
@@ -11,28 +11,29 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "bool.h"
 #include <string.h>
 
-static inline fcs_bool_t string_starts_with(
-    const char *const str, const char *const prefix, const char *const end)
-{
-    register const size_t check_len = (size_t)(end - str);
+    static inline fcs_bool_t string_starts_with(
+        const char *const str, const char *const prefix, const char *const end)
+    {
+        register const size_t check_len = (size_t)(end - str);
 
-    return (
-        (check_len == strlen(prefix)) && (!strncmp(str, prefix, check_len)));
-}
+        return ((check_len == strlen(prefix)) &&
+                (!strncmp(str, prefix, check_len)));
+    }
 
-static inline const char *try_str_prefix(
-    const char *const str, const char *const prefix)
-{
-    register const size_t len = strlen(prefix);
+    static inline const char *try_str_prefix(
+        const char *const str, const char *const prefix)
+    {
+        register const size_t len = strlen(prefix);
 
-    return (strncmp(str, prefix, len) ? NULL : str + len);
-}
+        return (strncmp(str, prefix, len) ? NULL : str + len);
+    }
 
 #ifdef __cplusplus
 };
diff --git a/fc-solve/source/trace_mem.h b/fc-solve/source/trace_mem.h
index 00ad07cfd..d0a273028 100644
--- a/fc-solve/source/trace_mem.h
+++ b/fc-solve/source/trace_mem.h
@@ -11,82 +11,83 @@
 #pragma once
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 #include "rinutils.h"
 
 #ifdef FCS_TRACE_MEM
-static int rss_found = 0;
-static long long max_rss_delta_deal = -1, prev_rss = -1, max_rss_delta = -1;
+    static int rss_found = 0;
+    static long long max_rss_delta_deal = -1, prev_rss = -1, max_rss_delta = -1;
 
-static inline void trace_mem(const long long board_num)
-{
-    long long int rss;
-    unsigned long long unused_unsigned;
-    char stat_fn[1024], unused_str[1024];
+    static inline void trace_mem(const long long board_num)
+    {
+        long long int rss;
+        unsigned long long unused_unsigned;
+        char stat_fn[1024], unused_str[1024];
 
-    snprintf(stat_fn, sizeof(stat_fn), "/proc/%ld/stat", (long)(getpid()));
+        snprintf(stat_fn, sizeof(stat_fn), "/proc/%ld/stat", (long)(getpid()));
 
-    // This was taken from: http://www.brokestream.com/procstat.html
-    FILE *const stat = fopen(stat_fn, "r");
+        // This was taken from: http://www.brokestream.com/procstat.html
+        FILE *const stat = fopen(stat_fn, "r");
 #define readone(unused) (fscanf(stat, "%lld ", &rss))
 #define readstr(unused) (fscanf(stat, "%1000s ", unused_str))
 #define readchar(unused) (fscanf(stat, "%c ", unused_str))
 #define readunsigned(unused) (fscanf(stat, "%llu ", &unused_unsigned))
-    readone(&pid);
-    readstr(tcomm);
-    readchar(&state);
-    readone(&ppid);
-    readone(&pgid);
-    readone(&sid);
-    readone(&tty_nr);
-    readone(&tty_pgrp);
-    readone(&flags);
-    readone(&min_flt);
-    readone(&cmin_flt);
-    readone(&maj_flt);
-    readone(&cmaj_flt);
-    readone(&utime);
-    readone(&stimev);
-    readone(&cutime);
-    readone(&cstime);
-    readone(&priority);
-    readone(&nicev);
-    readone(&num_threads);
-    readone(&it_real_value);
-    readunsigned(&start_time);
-    readone(&vsize);
-    readone(&rss);
+        readone(&pid);
+        readstr(tcomm);
+        readchar(&state);
+        readone(&ppid);
+        readone(&pgid);
+        readone(&sid);
+        readone(&tty_nr);
+        readone(&tty_pgrp);
+        readone(&flags);
+        readone(&min_flt);
+        readone(&cmin_flt);
+        readone(&maj_flt);
+        readone(&cmaj_flt);
+        readone(&utime);
+        readone(&stimev);
+        readone(&cutime);
+        readone(&cstime);
+        readone(&priority);
+        readone(&nicev);
+        readone(&num_threads);
+        readone(&it_real_value);
+        readunsigned(&start_time);
+        readone(&vsize);
+        readone(&rss);
 #undef readone
 #undef readunsigned
 #undef readchar
 #undef readstr
 
-    fclose(stat);
+        fclose(stat);
 
-    const long long rss_delta = rss - prev_rss;
-    if (rss_found == 1)
-    {
-        max_rss_delta = rss_delta;
-        max_rss_delta_deal = board_num;
-    }
-    else if (rss_found == 2)
-    {
-        if (rss_delta > max_rss_delta)
+        const long long rss_delta = rss - prev_rss;
+        if (rss_found == 1)
         {
             max_rss_delta = rss_delta;
             max_rss_delta_deal = board_num;
         }
-        printf("Max RSS delta %lld encountered at deal %lld\n", max_rss_delta,
-            max_rss_delta_deal);
-    }
-    prev_rss = rss;
-    if (rss_found < 2)
-    {
-        rss_found++;
+        else if (rss_found == 2)
+        {
+            if (rss_delta > max_rss_delta)
+            {
+                max_rss_delta = rss_delta;
+                max_rss_delta_deal = board_num;
+            }
+            printf("Max RSS delta %lld encountered at deal %lld\n",
+                max_rss_delta, max_rss_delta_deal);
+        }
+        prev_rss = rss;
+        if (rss_found < 2)
+        {
+            rss_found++;
+        }
     }
-}
 #else
 
 static inline void trace_mem(const long long board_num GCC_UNUSED) {}
