#include <stdbool.h>

#define BLOCK_DIM 32
#define N_BLOCKS (48 * 2)
// bug?? #define N_BLOCKS (48 * 4)
#define N_WORKERS (N_BLOCKS * BLOCK_DIM)
#define N_INIT_DISTRIBUTION (N_WORKERS * 4)
#define N_INPUTS (N_WORKERS * 8)
#define PLAN_LEN_MAX 255
#define BLACKLIST_BITS 10

#define STATE_WIDTH 4
#define STATE_N (STATE_WIDTH * STATE_WIDTH)

typedef unsigned char uchar;
typedef signed char   Direction;
#define dir_reverse(dir) ((Direction)(3 - (dir)))
#define DIR_N 4
#define DIR_FIRST 0
#define DIR_UP 0
#define DIR_RIGHT 1
#define DIR_LEFT 2
#define DIR_DOWN 3

/* stack implementation */

__device__ __shared__ static struct dir_stack_tag
{
    uchar i, j;
    int   init_depth;
    uchar buf[PLAN_LEN_MAX];
} stack[BLOCK_DIM];

#define STACK (stack[threadIdx.x])

typedef struct search_stat_tag
{
    bool      solved;
    int       len;
    long long nodes_expanded;
    int nodes_pruned;
} search_stat;
typedef struct input_tag
{
    uchar     tiles[STATE_N];
    int       init_depth;
    Direction parent_dir;
} Input;

__host__ static inline long long
korf_hash(uchar tiles[])
{
	long long  h = tiles[0];
	for (int i = 1; i < STATE_N; ++i)
		h += h*3 + tiles[i];
	return h;
}
__device__ static inline long long
korf_hash_dev(uchar tiles[])
{
	long long h = tiles[0];
	for (long long i = 1; i < STATE_N; ++i)
		h += h*3 + tiles[i];
	return h;
}
typedef struct blacklist_entry_tag
{
	uchar tiles[STATE_N];
	long long hash;
	int g_value;
} BlackListEntry;
__shared__ BlackListEntry blacklist_dev[1 << BLACKLIST_BITS];

__device__ static inline void
stack_init(Input input)
{
    STACK.i          = 0;
	STACK.j          = 0;
    STACK.init_depth = input.init_depth;
}

__device__ static inline void
stack_put(Direction dir)
{
    STACK.buf[STACK.i] = dir;
    ++STACK.i;
}
__device__ static inline bool
stack_is_empty(void)
{
    return STACK.i == STACK.j;
}
__device__ static inline Direction
stack_pop(void)
{
    --STACK.i;
    return STACK.buf[STACK.i];
}
__device__ static inline Direction
stack_peak(void)
{
    return STACK.buf[STACK.i - 1];
}

/* state implementation */

static char assert_state_width_is_four[STATE_WIDTH == 4 ? 1 : -1];
#define POS_X(pos) ((pos) &3)
#define POS_Y(pos) ((pos) >> 2)

/*
 * goal: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
 */

__device__ __shared__ static struct state_tag
{
    uchar tile[STATE_N];
    uchar empty;
    uchar h_value; /* ub of h_value is 6*16 */
} state[BLOCK_DIM];

#define STATE_TILE(i) (state[threadIdx.x].tile[(i)])
#define STATE_EMPTY (state[threadIdx.x].empty)
#define STATE_HVALUE (state[threadIdx.x].h_value)
#define distance(i, j) ((i) > (j) ? (i) - (j) : (j) - (i))

#define H_DIFF(opponent, empty, empty_dir)                                     \
    h_diff_table_shared[opponent][empty][empty_dir]
__device__ __shared__ static signed char h_diff_table_shared[STATE_N][STATE_N]
                                                            [DIR_N];

__device__ static void
state_init_hvalue(void)
{
    uchar from_x[STATE_N], from_y[STATE_N];

    STATE_HVALUE = 0;

    for (int i = 0; i < STATE_N; ++i)
    {
        from_x[STATE_TILE(i)] = POS_X(i);
        from_y[STATE_TILE(i)] = POS_Y(i);
    }
    for (int i = 1; i < STATE_N; ++i)
    {
        STATE_HVALUE += distance(from_x[i], POS_X(i));
        STATE_HVALUE += distance(from_y[i], POS_Y(i));
    }
}

__device__ static void
state_tile_fill(Input input)
{
    for (int i = 0; i < STATE_N; ++i)
    {
        if (input.tiles[i] == 0)
            STATE_EMPTY = i;
        STATE_TILE(i)   = input.tiles[i];
    }
}

__device__ static inline bool
state_is_goal(void)
{
    return STATE_HVALUE == 0;
}

__device__ static char assert_direction2
    [DIR_UP == 0 && DIR_RIGHT == 1 && DIR_LEFT == 2 && DIR_DOWN == 3 ? 1 : -1];
__device__ __shared__ static bool movable_table_shared[STATE_N][DIR_N];

__device__ static inline bool
state_movable(Direction dir)
{
    return movable_table_shared[STATE_EMPTY][dir];
}

__device__ static char assert_direction
    [DIR_UP == 0 && DIR_RIGHT == 1 && DIR_LEFT == 2 && DIR_DOWN == 3 ? 1 : -1];
__device__ __constant__ const static int pos_diff_table[DIR_N] = {
    -STATE_WIDTH, 1, -1, +STATE_WIDTH};

__device__ static inline bool
state_move_with_limit(Direction dir, unsigned int f_limit)
{
    int new_empty   = STATE_EMPTY + pos_diff_table[dir];
    int opponent    = STATE_TILE(new_empty);
    int new_h_value = STATE_HVALUE + H_DIFF(opponent, new_empty, dir);

    if (STACK.i + STACK.init_depth + 1 + new_h_value > f_limit)
        return false;

    STATE_HVALUE            = new_h_value;
    STATE_TILE(STATE_EMPTY) = opponent;
    STATE_EMPTY             = new_empty;

    return true;
}

__device__ static inline void
state_move(Direction dir)
{
    int new_empty = STATE_EMPTY + pos_diff_table[dir];
    int opponent  = STATE_TILE(new_empty);

    STATE_HVALUE += H_DIFF(opponent, new_empty, dir);
    STATE_TILE(STATE_EMPTY) = opponent;
    STATE_EMPTY             = new_empty;
}

__device__ static inline bool
blacklist_query(int *g_value)
{
	long long hash = korf_hash_dev(state[threadIdx.x].tile);
	BlackListEntry e = blacklist_dev[hash & ((1u<<BLACKLIST_BITS) - 1)];
	if (e.hash != hash)
		return false;
	for (int i = 0; i < STATE_N; ++i)
		if (e.tiles[i] != STATE_TILE(i))
			return false;
	return true;
}

/*
 * solver implementation
 */

__device__ static void
idas_internal(int f_limit, Input *input, int *input_ends, search_stat *stat)
{
    int       tid            = threadIdx.x;
    int       bid            = blockIdx.x;
    int       id             = tid + bid * blockDim.x;

    for (int i = id == 0 ? 0 : input_ends[id - 1];
         i < input_ends[id]; ++i)
    {
		long long nodes_expanded = 0;
		int nodes_pruned = 0;
		uchar     dir            = 0;
		int blacklist_g;
		Input this_input = input[i];
        stack_init(this_input);
        state_tile_fill(this_input);
        state_init_hvalue();

		for (;;)
		{
			if (state_is_goal())
				asm("trap;"); /* solution found */
			/* if continue search until solution found, just return true */

			if (((stack_is_empty() && dir_reverse(dir) != this_input.parent_dir) ||
						stack_peak() != dir_reverse(dir)) &&
					state_movable(dir))
			{
				++nodes_expanded;
				/* sometimes check idle here */
				/* and load balance if needed */

				if (state_move_with_limit(dir, f_limit))
				{
					if (!(blacklist_query(&blacklist_g) &&
							blacklist_g <= this_input.init_depth + STACK.i))
					{
						stack_put(dir);
						dir = 0;
						continue;
					}
					else
						++nodes_pruned;
				}
			}

			while (++dir == DIR_N)
			{
				if (stack_is_empty())
					goto END_THIS_NODE;

				dir = stack_pop();
				state_move(dir_reverse(dir));
			}
		}

END_THIS_NODE:
        stat[i].nodes_expanded = nodes_expanded;
        stat[i].nodes_pruned = nodes_pruned;

		/* if my own works have done, get other's work here */

		/* if every work finished, then return*/
    }
}

__global__ void
idas_kernel(Input *input, int *input_ends, signed char *plan,
		BlackListEntry *blacklist, search_stat *stat,
            int f_limit, signed char *h_diff_table, bool *movable_table)
{
    int       tid            = threadIdx.x;

    for (int dir = 0; dir < DIR_N; ++dir)
        for (int i = tid; i < STATE_N; i += blockDim.x)
            if (i < STATE_N)
                movable_table_shared[i][dir] = movable_table[i * DIR_N + dir];
    for (int i = 0; i < STATE_N * DIR_N; ++i)
        for (int j = tid; j < STATE_N; j += blockDim.x)
            if (j < STATE_N)
                h_diff_table_shared[j][i / DIR_N][i % DIR_N] =
                    h_diff_table[j * STATE_N * DIR_N + i];
	for (int i = tid; i < 1<<BLACKLIST_BITS; i += blockDim.x)
		blacklist_dev[i] = blacklist[i];

    __syncthreads();

	idas_internal(f_limit, input, input_ends, stat);
}

/* host library implementation */

#include <errno.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>

#ifndef UNABLE_LOG
#define elog(...) fprintf(stderr, __VA_ARGS__)
#else
#define elog(...) ;
#endif

void *
palloc(size_t size)
{
    void *ptr = malloc(size);
    if (!ptr)
        elog("malloc failed\n");

    return ptr;
}

void *
repalloc(void *old_ptr, size_t new_size)
{
    void *ptr = realloc(old_ptr, new_size);
    if (!ptr)
        elog("realloc failed\n");

    return ptr;
}

void
pfree(void *ptr)
{
    if (!ptr)
        elog("empty ptr\n");
    free(ptr);
}

#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

typedef unsigned char idx_t;
/*
 *  [0,0] [1,0] [2,0] [3,0]
 *  [0,1] [1,1] [2,1] [3,1]
 *  [0,2] [1,2] [2,2] [3,2]
 *  [0,3] [1,3] [2,3] [3,3]
 */

/*
 * goal state is
 * [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
 */

typedef struct state_tag_cpu
{
    int       depth; /* XXX: needed? */
    uchar     pos[STATE_WIDTH][STATE_WIDTH];
    idx_t     i, j; /* pos of empty */
    Direction parent_dir;
    int       h_value;
} * State;

#define v(state, i, j) ((state)->pos[i][j])
#define ev(state) (v(state, state->i, state->j))
#define lv(state) (v(state, state->i - 1, state->j))
#define dv(state) (v(state, state->i, state->j + 1))
#define rv(state) (v(state, state->i + 1, state->j))
#define uv(state) (v(state, state->i, state->j - 1))

static uchar from_x[STATE_WIDTH * STATE_WIDTH],
    from_y[STATE_WIDTH * STATE_WIDTH];

static inline void
fill_from_xy(State from)
{
    for (idx_t x = 0; x < STATE_WIDTH; ++x)
        for (idx_t y = 0; y < STATE_WIDTH; ++y)
        {
            from_x[v(from, x, y)] = x;
            from_y[v(from, x, y)] = y;
        }
}

static char assert_state_width_is_four2[STATE_WIDTH == 4 ? 1 : -1];
static inline int
heuristic_manhattan_distance(State from)
{
    int h_value = 0;

    fill_from_xy(from);

    for (idx_t i = 1; i < STATE_N; ++i)
    {
        h_value += distance(from_x[i], i & 3);
        h_value += distance(from_y[i], i >> 2);
    }

    return h_value;
}

bool
state_is_goal(State state)
{
    return state->h_value == 0;
}

static inline State
state_alloc(void)
{
    return (State) palloc(sizeof(struct state_tag_cpu));
}

static inline void
state_free(State state)
{
    pfree(state);
}

State
state_init(uchar v_list[STATE_WIDTH * STATE_WIDTH], int init_depth)
{
    State state = state_alloc();
    int   cnt   = 0;

    state->depth      = init_depth;
    state->parent_dir = (Direction) -1;

    for (idx_t j = 0; j < STATE_WIDTH; ++j)
        for (idx_t i = 0; i < STATE_WIDTH; ++i)
        {
            if (v_list[cnt] == 0)
            {
                state->i = i;
                state->j = j;
            }
            v(state, i, j) = v_list[cnt++];
        }

    state->h_value = heuristic_manhattan_distance(state);

    return state;
}

void
state_fini(State state)
{
    state_free(state);
}

State
state_copy(State src)
{
    State dst = state_alloc();

    memcpy(dst, src, sizeof(*src));

    return dst;
}

static inline bool
state_left_movable(State state)
{
    return state->i != 0;
}
static inline bool
state_down_movable(State state)
{
    return state->j != STATE_WIDTH - 1;
}
static inline bool
state_right_movable(State state)
{
    return state->i != STATE_WIDTH - 1;
}
static inline bool
state_up_movable(State state)
{
    return state->j != 0;
}

bool
state_movable(State state, Direction dir)
{
    return (dir != DIR_LEFT || state_left_movable(state)) &&
           (dir != DIR_DOWN || state_down_movable(state)) &&
           (dir != DIR_RIGHT || state_right_movable(state)) &&
           (dir != DIR_UP || state_up_movable(state));
}

#define h_diff(who, from_i, from_j, dir)                                       \
    (h_diff_table[((who) << 6) + ((from_j) << 4) + ((from_i) << 2) + (dir)])
static int h_diff_table[STATE_N * STATE_N * DIR_N] = {
    1,  1,  1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,
    1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,
    -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1,
    1,  -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,
    1,  1,  -1, 1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1,
    1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, -1,
    1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,  1,  1,
    -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  -1, -1, 1,  1,  -1, -1, 1,  1,
    -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,
    1,  -1, 1,  -1, 1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,
    -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1,  -1,
    -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, -1, 1,  1,
    -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, -1, 1,  1,  -1, -1, 1,
    1,  -1, -1, 1,  1,  -1, 1,  1,  1,  1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,
    -1, -1, 1,  1,  -1, -1, 1,  1,  1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,
    1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,
    -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,
    -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  -1, 1,  1,  1,  1,
    1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1,
    1,  -1, 1,  -1, 1,  -1, 1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,
    -1, 1,  -1, 1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1,
    -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  -1, -1,
    1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, -1, 1,  1,  -1,
    -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,  -1, 1,  -1, 1,  -1, 1,  -1,
    1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,
    1,  1,  1,  1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,
    1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  1,
    1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  1,  -1,
    1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  1,  1,  1,  1,  -1,
    1,  1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,
    -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,
    1,  -1, -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1,
    1,  -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  -1, -1, 1,
    1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,  -1, 1,  -1,
    1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,
    1,  1,  -1, 1,  1,  -1, -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1,
    1,  1,  -1, 1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1,
    1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1,
    1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,  1,
    -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,
    -1, -1, 1,  1,  -1, 1,  1,  1,  1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1,
    -1, 1,  1,  -1, -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,
    -1, -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,
    1,  1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  -1, 1,  -1,
    1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  -1, 1,  -1, 1,  1,  1,
    -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,
    -1, -1, 1,  1,  -1, -1, 1,  -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  1,
    1,  -1, 1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1,
    1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  -1, 1,
    -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  -1, 1,  1,  1,  -1,
    1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,
    -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1,
    1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,
    -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1};

void
state_move(State state, Direction dir)
{
    idx_t who;
    assert(state_movable(state, dir));

    switch (dir)
    {
    case DIR_LEFT:
        who = ev(state) = lv(state);
        state->i--;
        break;
    case DIR_DOWN:
        who = ev(state) = dv(state);
        state->j++;
        break;
    case DIR_RIGHT:
        who = ev(state) = rv(state);
        state->i++;
        break;
    case DIR_UP:
        who = ev(state) = uv(state);
        state->j--;
        break;
    default:
        elog("unexpected direction");
        assert(false);
    }

    state->h_value =
        state->h_value + h_diff(who, state->i, state->j, dir_reverse(dir));
    state->parent_dir = dir;
}

bool
state_pos_equal(State s1, State s2)
{
    for (idx_t i = 0; i < STATE_WIDTH; ++i)
        for (idx_t j = 0; j < STATE_WIDTH; ++j)
            if (v(s1, i, j) != v(s2, i, j))
                return false;

    return true;
}

size_t
state_hash(State state)
{
    /* FIXME: for A* */
    size_t hash_value = 0;
    for (idx_t i = 0; i < STATE_WIDTH; ++i)
        for (idx_t j = 0; j < STATE_WIDTH; ++j)
            hash_value ^= (v(state, i, j) << ((i * 3 + j) << 2));
    return hash_value;
}
int
state_get_hvalue(State state)
{
    return state->h_value;
}

int
state_get_depth(State state)
{
    return state->depth;
}

#include <stddef.h>
#include <stdint.h>
#include <string.h>
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t) -1)
#endif

typedef enum {
    HT_SUCCESS = 0,
    HT_FAILED_FOUND,
    HT_FAILED_NOT_FOUND,
} HTStatus;

/* XXX: hash function for State should be surveyed */
inline static size_t
hashfunc(State key)
{
    return state_hash(key);
}

typedef struct ht_entry_tag *HTEntry;
struct ht_entry_tag
{
    HTEntry next;
    State   key;
    int     value;
};

static HTEntry
ht_entry_init(State key)
{
    HTEntry entry = (HTEntry) palloc(sizeof(*entry));

    entry->key  = state_copy(key);
    entry->next = NULL;

    return entry;
}

static void
ht_entry_fini(HTEntry entry)
{
    pfree(entry);
}

typedef struct ht_tag
{
    size_t   n_bins;
    size_t   n_elems;
    HTEntry *bin;
} * HT;

static bool
ht_rehash_required(HT ht)
{
    return ht->n_bins <= ht->n_elems; /* TODO: local policy is also needed */
}

static size_t
calc_n_bins(size_t required)
{
    /* NOTE: n_bins is used for mask and hence it should be pow of 2, fon now */
    size_t size = 1;
    assert(required > 0);

    while (required > size)
        size <<= 1;

    return size;
}

HT
ht_init(size_t init_size_hint)
{
    size_t n_bins = calc_n_bins(init_size_hint);
    HT     ht     = (HT) palloc(sizeof(*ht));

    ht->n_bins  = n_bins;
    ht->n_elems = 0;

    assert(sizeof(*ht->bin) <= SIZE_MAX / n_bins);
    ht->bin = (HTEntry *) palloc(sizeof(*ht->bin) * n_bins);
    memset(ht->bin, 0, sizeof(*ht->bin) * n_bins);

    return ht;
}

static void
ht_rehash(HT ht)
{
    HTEntry *new_bin;
    size_t   new_size = ht->n_bins << 1;

    assert(ht->n_bins<SIZE_MAX>> 1);

    new_bin = (HTEntry *) palloc(sizeof(*new_bin) * new_size);
    memset(new_bin, 0, sizeof(*new_bin) * new_size);

    for (size_t i = 0; i < ht->n_bins; ++i)
    {
        HTEntry entry = ht->bin[i];

        while (entry)
        {
            HTEntry next = entry->next;

            size_t idx   = hashfunc(entry->key) & (new_size - 1);
            entry->next  = new_bin[idx];
            new_bin[idx] = entry;

            entry = next;
        }
    }

    pfree(ht->bin);
    ht->n_bins = new_size;
    ht->bin    = new_bin;
}

void
ht_fini(HT ht)
{
    for (size_t i = 0; i < ht->n_bins; ++i)
    {
        HTEntry entry = ht->bin[i];
        while (entry)
        {
            HTEntry next = entry->next;
            state_fini(entry->key);
            ht_entry_fini(entry);
            entry = next;
        }
    }

    pfree(ht->bin);
    pfree(ht);
}

HTStatus
ht_insert(HT ht, State key, int **value)
{
    size_t  i;
    HTEntry entry, new_entry;

    if (ht_rehash_required(ht))
        ht_rehash(ht);

    i     = hashfunc(key) & (ht->n_bins - 1);
    entry = ht->bin[i];

    while (entry)
    {
        if (state_pos_equal(key, entry->key))
        {
            *value = &entry->value;
            return HT_FAILED_FOUND;
        }

        entry = entry->next;
    }

    new_entry = ht_entry_init(key);

    new_entry->next = ht->bin[i];
    ht->bin[i]      = new_entry;
    *value          = &new_entry->value;

    assert(ht->n_elems < SIZE_MAX);
    ht->n_elems++;

    return HT_SUCCESS;
}

/*
 * Priority Queue implementation
 */

#include <assert.h>
#include <stdint.h>

typedef struct pq_entry_tag
{
    State state;
    int   f, g;
} PQEntryData;
typedef PQEntryData *PQEntry;

/* tiebreaking is done comparing g value */
static inline bool
pq_entry_higher_priority(PQEntry e1, PQEntry e2)
{
    return e1->f < e2->f || (e1->f == e2->f && e1->g >= e2->g);
}

/*
 * NOTE:
 * This priority queue is implemented doubly reallocated array.
 * It will only extend and will not shrink, for now.
 * It may be improved by using array of layers of iteratively widened array
 */
typedef struct pq_tag
{
    size_t       n_elems;
    size_t       capa;
    PQEntryData *array;
} * PQ;

static inline size_t
calc_init_capa(size_t capa_hint)
{
    size_t capa = 1;
    assert(capa_hint > 0);

    while (capa < capa_hint)
        capa <<= 1;
    return capa - 1;
}

PQ
pq_init(size_t init_capa_hint)
{
    PQ pq = (PQ) palloc(sizeof(*pq));

    pq->n_elems = 0;
    pq->capa    = calc_init_capa(init_capa_hint);

    assert(pq->capa <= SIZE_MAX / sizeof(PQEntryData));
    pq->array = (PQEntryData *) palloc(sizeof(PQEntryData) * pq->capa);

    return pq;
}

void
pq_fini(PQ pq)
{
    for (size_t i = 0; i < pq->n_elems; ++i)
        state_fini(pq->array[i].state);

    pfree(pq->array);
    pfree(pq);
}

static inline bool
pq_is_full(PQ pq)
{
    assert(pq->n_elems <= pq->capa);
    return pq->n_elems == pq->capa;
}

static inline void
pq_extend(PQ pq)
{
    pq->capa = (pq->capa << 1) + 1;
    assert(pq->capa <= SIZE_MAX / sizeof(PQEntryData));

    pq->array =
        (PQEntryData *) repalloc(pq->array, sizeof(PQEntryData) * pq->capa);
}

static inline void
pq_swap_entry(PQ pq, size_t i, size_t j)
{
    PQEntryData tmp = pq->array[i];
    pq->array[i]    = pq->array[j];
    pq->array[j]    = tmp;
}

static inline size_t
pq_up(size_t i)
{
    /* NOTE: By using 1-origin, it may be written more simply, i >> 1 */
    return (i - 1) >> 1;
}

static inline size_t
pq_left(size_t i)
{
    return (i << 1) + 1;
}

static void
heapify_up(PQ pq)
{
    for (size_t i = pq->n_elems; i > 0;)
    {
        size_t ui = pq_up(i);
        assert(i > 0);
        if (!pq_entry_higher_priority(&pq->array[i], &pq->array[ui]))
            break;

        pq_swap_entry(pq, i, ui);
        i = ui;
    }
}

void
pq_put(PQ pq, State state, int f, int g)
{
    if (pq_is_full(pq))
        pq_extend(pq);

    pq->array[pq->n_elems].state = state_copy(state);
    pq->array[pq->n_elems].f     = f; /* this may be abundant */
    pq->array[pq->n_elems].g     = g;
    heapify_up(pq);
    ++pq->n_elems;
}

static void
heapify_down(PQ pq)
{
    size_t sentinel = pq->n_elems;

    for (size_t i = 0;;)
    {
        size_t ri, li = pq_left(i);
        if (li >= sentinel)
            break;

        ri = li + 1;
        if (ri >= sentinel)
        {
            if (pq_entry_higher_priority(&pq->array[li], &pq->array[i]))
                pq_swap_entry(pq, i, li);
            /* Reached the bottom */
            break;
        }

        /* NOTE: If p(ri) == p(li), it may be good to go right
         * since the filling order is left-first */
        if (pq_entry_higher_priority(&pq->array[li], &pq->array[ri]))
        {
            if (!pq_entry_higher_priority(&pq->array[li], &pq->array[i]))
                break;

            pq_swap_entry(pq, i, li);
            i = li;
        }
        else
        {
            if (!pq_entry_higher_priority(&pq->array[ri], &pq->array[i]))
                break;

            pq_swap_entry(pq, i, ri);
            i = ri;
        }
    }
}

State
pq_pop(PQ pq)
{
    State ret_state;

    if (pq->n_elems == 0)
        return NULL;

    ret_state = pq->array[0].state;

    --pq->n_elems;
    pq->array[0] = pq->array[pq->n_elems];
    heapify_down(pq);

    return ret_state;
}

void
pq_dump(PQ pq)
{
    elog("%s: n_elems=%zu, capa=%zu\n", __func__, pq->n_elems, pq->capa);
    for (size_t i = 0, cr_required = 1; i < pq->n_elems; i++)
    {
        if (i == cr_required)
        {
            elog("\n");
            cr_required = (cr_required << 1) + 1;
        }
        elog("%d,", pq->array[i].f);
        elog("%d ", pq->array[i].g);
    }
    elog("\n");
}

static HT closed, BL1, BL2;

bool
distribute_astar(State init_state, Input input[], int input_ends[], int distr_n,
                 int *cnt_inputs, int *min_fvalue)
{
    int      cnt = 0;
    State    state;
    PQ       q = pq_init(distr_n + 10);
    HTStatus ht_status;
    int *    ht_value;
    bool     solved = false;
    closed          = ht_init(10000);
    BL1      = ht_init(1000);
    BL2      = ht_init(1000);

    ht_status = ht_insert(closed, init_state, &ht_value);
    *ht_value = 0;
    pq_put(q, state_copy(init_state), state_get_hvalue(init_state), 0);
    ++cnt;

    while ((state = pq_pop(q)))
    {
        --cnt;
        if (state_is_goal(state))
        {
            solved = true;
            break;
        }

        ht_status = ht_insert(closed, state, &ht_value);
        if (ht_status == HT_FAILED_FOUND && *ht_value < state_get_depth(state))
        {
            state_fini(state);
            continue;
        }
        else
            *ht_value = state_get_depth(state);

        for (int dir = 0; dir < DIR_N; ++dir)
        {
            if (state->parent_dir != dir_reverse(dir) &&
                state_movable(state, (Direction) dir))
            {
                State next_state = state_copy(state);
                state_move(next_state, (Direction) dir);
                next_state->depth++;

                ht_status = ht_insert(closed, next_state, &ht_value);
                if (ht_status == HT_FAILED_FOUND &&
                    *ht_value <= state_get_depth(next_state))
                    state_fini(next_state);
                else
                {
                    ++cnt;
                    *ht_value = state_get_depth(next_state);
                    pq_put(q, next_state,
                           *ht_value + state_get_hvalue(next_state), *ht_value);
                }
            }
        }

        state_fini(state);

        if (cnt >= distr_n)
            break;
    }

    *cnt_inputs = cnt;
    if (!solved)
    {
        int minf = INT_MAX;
        for (int id = 0; id < cnt; ++id)
        {
            State state = pq_pop(q);
            assert(state);

            for (int i = 0; i < STATE_N; ++i)
                input[id].tiles[i] = state->pos[i%STATE_WIDTH][i/STATE_WIDTH];
            input[id].tiles[state->i + (state->j * STATE_WIDTH)] = 0;

            input[id].init_depth = state_get_depth(state);
            input[id].parent_dir = state->parent_dir;
            if (minf > state_get_depth(state) + state_get_hvalue(state))
                minf = state_get_depth(state) + state_get_hvalue(state);
        }
        *min_fvalue = minf;

        printf("distr_n=%d, n_worers=%d, cnt=%d\n", distr_n, N_WORKERS, cnt);
        for (int id               = 0; id < N_WORKERS; ++id)
            input_ends[id]        = (distr_n / N_WORKERS) * (id + 1) - 1;
        input_ends[N_WORKERS - 1] = cnt;
    }

    pq_fini(q);

    return solved;
}

static int
input_devide(Input input[], search_stat stat[], int i, int devide_n, int tail)
{
    int   cnt = 0;
    int * ht_value;
    State state       = state_init(input[i].tiles, input[i].init_depth);
    state->parent_dir = input[i].parent_dir;
    PQ       pq       = pq_init(32);
    HTStatus ht_status = ht_insert(BL1, state, &ht_value);

	if (ht_status == HT_FAILED_FOUND && *ht_value > state_get_depth(state))
		*ht_value = state_get_depth(state);

    pq_put(pq, state, state_get_hvalue(state), 0);
    ++cnt;

    while ((state = pq_pop(pq)))
    {
        --cnt;
        if (state_is_goal(state))
        {
            /* It may not be optimal goal */
            pq_put(pq, state, state_get_depth(state) + state_get_hvalue(state),
                   state_get_depth(state));
            ++cnt;
            break;
        }

        ht_status = ht_insert(closed, state, &ht_value);
        if (ht_status == HT_FAILED_FOUND && *ht_value < state_get_depth(state))
        {
            state_fini(state);
            continue;
        }
        else
            *ht_value = state_get_depth(state);

        for (int dir = 0; dir < DIR_N; ++dir)
        {
            if (state->parent_dir != dir_reverse(dir) &&
                state_movable(state, (Direction) dir))
            {
                State next_state = state_copy(state);
                state_move(next_state, (Direction) dir);
                next_state->depth++;

                ht_status = ht_insert(closed, next_state, &ht_value);
                if (ht_status == HT_FAILED_FOUND &&
                    *ht_value < state_get_depth(next_state))
                    state_fini(next_state);
                else
                {
                    ++cnt;
                    *ht_value = state_get_depth(next_state);
                    pq_put(pq, next_state,
                           *ht_value + state_get_hvalue(next_state), *ht_value);
                }
            }
        }

        state_fini(state);

        if (cnt >= devide_n)
            break;
    }

    for (int id = 0; id < cnt; ++id)
    {
        int   estimation_after_devision = stat[i].nodes_expanded / cnt;
        int   ofs                       = id == 0 ? i : tail - 1 + id;
        State state                     = pq_pop(pq);
        assert(state);

		ht_status = ht_insert(BL2, state, &ht_value);
		if (ht_status == HT_FAILED_FOUND && *ht_value > state_get_depth(state))
			*ht_value = state_get_depth(state);

        for (int j              = 0; j < STATE_N; ++j)
            input[ofs].tiles[j] = state->pos[j%STATE_WIDTH][j/STATE_WIDTH];
        input[ofs].tiles[state->i + (state->j * STATE_WIDTH)] = 0;

        input[ofs].init_depth = state_get_depth(state);
        input[ofs].parent_dir = state->parent_dir;

        stat[ofs].nodes_expanded = estimation_after_devision;
    }

    pq_fini(pq);

    return cnt == 0 ? 0 : cnt - 1;
}

static void
fill_blacklist_internal(BlackListEntry blacklist[], HT bl)
{
	for (unsigned int i = 0; i < bl->n_bins; ++i)
	{
		HTEntry e = bl->bin[i];
		while (e)
		{
			HTEntry next = e->next;
			State s = e->key;
			uchar til[STATE_N];
			for (int j = 0; j < STATE_N; ++j)
				til[j] = s->pos[j%STATE_WIDTH][j/STATE_WIDTH];
			int hash = korf_hash(til);
			BlackListEntry *ble = &blacklist[hash & (1u << BLACKLIST_BITS)];
			ble->hash = hash;
			for (int p = 0; p < STATE_N; ++p)
				ble->tiles[p] = til[p];
			ble->g_value = state_get_depth(s);
e = next;
		}
	}
}

static void
fill_blacklist(BlackListEntry blacklist[])
{
	fill_blacklist_internal(blacklist, BL2);
	fill_blacklist_internal(blacklist, BL1);
}

/* main */

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>

#define exit_failure(...)                                                      \
    do                                                                         \
    {                                                                          \
        printf(__VA_ARGS__);                                                   \
        exit(EXIT_FAILURE);                                                    \
    } while (0)

static int
pop_int_from_str(const char *str, char **end_ptr)
{
    long int rv = strtol(str, end_ptr, 0);
    errno       = 0;

    if (errno != 0)
        exit_failure("%s: %s cannot be converted into long\n", __func__, str);
    else if (end_ptr && str == *end_ptr)
        exit_failure("%s: reach end of string", __func__);

    if (rv > INT_MAX || rv < INT_MIN)
        exit_failure("%s: too big number, %ld\n", __func__, rv);

    return (int) rv;
}

#define MAX_LINE_LEN 100
static void
load_state_from_file(const char *fname, uchar *s)
{
    FILE *fp;
    char  str[MAX_LINE_LEN];
    char *str_ptr = str, *end_ptr;

    fp = fopen(fname, "r");
    if (!fp)
        exit_failure("%s: %s cannot be opened\n", __func__, fname);

    if (!fgets(str, MAX_LINE_LEN, fp))
        exit_failure("%s: fgets failed\n", __func__);

    for (int i = 0; i < STATE_N; ++i)
    {
        s[i]    = pop_int_from_str(str_ptr, &end_ptr);
        str_ptr = end_ptr;
    }

    fclose(fp);
}
#undef MAX_LINE_LEN

#define CUDA_CHECK(call)                                                       \
    do                                                                         \
    {                                                                          \
        const cudaError_t e = call;                                            \
        if (e != cudaSuccess)                                                  \
            exit_failure("Error: %s:%d code:%d, reason: %s\n", __FILE__,       \
                         __LINE__, e, cudaGetErrorString(e));                  \
    } while (0)

#define h_d_t(op, i, dir)                                                      \
    (h_diff_table[(op) *STATE_N * DIR_N + (i) *DIR_N + (dir)])
__host__ static void
init_mdist(signed char h_diff_table[])
{
    for (int opponent = 0; opponent < STATE_N; ++opponent)
    {
        int goal_x = POS_X(opponent), goal_y = POS_Y(opponent);

        for (int i = 0; i < STATE_N; ++i)
        {
            int from_x = POS_X(i), from_y = POS_Y(i);
            for (uchar dir = 0; dir < DIR_N; ++dir)
            {
                if (dir == DIR_LEFT)
                    h_d_t(opponent, i, dir) = goal_x > from_x ? -1 : 1;
                if (dir == DIR_RIGHT)
                    h_d_t(opponent, i, dir) = goal_x < from_x ? -1 : 1;
                if (dir == DIR_UP)
                    h_d_t(opponent, i, dir) = goal_y > from_y ? -1 : 1;
                if (dir == DIR_DOWN)
                    h_d_t(opponent, i, dir) = goal_y < from_y ? -1 : 1;
            }
        }
    }
}
#undef h_d_t

#define m_t(i, d) (movable_table[(i) *DIR_N + (d)])
__host__ static void
init_movable_table(bool movable_table[])
{
    for (int i = 0; i < STATE_N; ++i)
        for (unsigned int d = 0; d < DIR_N; ++d)
        {
            if (d == DIR_RIGHT)
                m_t(i, d) = (POS_X(i) < STATE_WIDTH - 1);
            else if (d == DIR_LEFT)
                m_t(i, d) = (POS_X(i) > 0);
            else if (d == DIR_DOWN)
                m_t(i, d) = (POS_Y(i) < STATE_WIDTH - 1);
            else if (d == DIR_UP)
                m_t(i, d) = (POS_Y(i) > 0);
        }
}
#undef m_t

static void
avoid_unused_static_assertions(void)
{
    (void) assert_direction[0];
    (void) assert_direction2[0];
    (void) assert_state_width_is_four[0];
    (void) assert_state_width_is_four2[0];
}

static char dir_char[] = {'U', 'R', 'L', 'D'};

int
main(int argc, char *argv[])
{
    int cnt_inputs;

    int    input_size = sizeof(Input) * N_INPUTS;
    Input  input[N_INPUTS];
    Input *d_input;

    int  input_ends_size = sizeof(int) * N_WORKERS;
    int  input_ends[N_WORKERS];
    int *d_input_ends;

    int          plan_size = sizeof(signed char) * PLAN_LEN_MAX * N_INPUTS;
    signed char  plan[PLAN_LEN_MAX * N_INPUTS];
    signed char *d_plan;

    int          stat_size = sizeof(search_stat) * N_INPUTS;
    search_stat  stat[N_INPUTS];
    search_stat *d_stat;

    int          blacklist_size = sizeof(BlackListEntry) * (1 << BLACKLIST_BITS);
    BlackListEntry  h_blacklist[N_INPUTS];
    BlackListEntry *d_blacklist;

    bool         movable_table[STATE_N * DIR_N];
    bool *       d_movable_table;
    int          movable_table_size = sizeof(bool) * STATE_N * DIR_N;

    signed char  h_diff_table[STATE_N * STATE_N * DIR_N];
    signed char *d_h_diff_table;
    int h_diff_table_size = sizeof(signed char) * STATE_N * STATE_N * DIR_N;

    int min_fvalue = 0;

    if (argc < 2)
    {
        printf("usage: bin/cumain <ifname>\n");
        exit(EXIT_FAILURE);
    }

    load_state_from_file(argv[1], input[0].tiles);

    {
        State init_state = state_init(input[0].tiles, 0);

        if (distribute_astar(init_state, input, input_ends, N_INIT_DISTRIBUTION,
                             &cnt_inputs, &min_fvalue))
        {
            puts("solution is found by distributor");
            return 0;
        }
    }

    init_mdist(h_diff_table);
    init_movable_table(movable_table);

    CUDA_CHECK(cudaMalloc((void **) &d_input, input_size));
    CUDA_CHECK(cudaMalloc((void **) &d_input_ends, input_ends_size));
    CUDA_CHECK(cudaMalloc((void **) &d_plan, plan_size));
    CUDA_CHECK(cudaMalloc((void **) &d_stat, stat_size));
    CUDA_CHECK(cudaMalloc((void **) &d_blacklist, blacklist_size));
    CUDA_CHECK(cudaMalloc((void **) &d_movable_table, movable_table_size));
    CUDA_CHECK(cudaMalloc((void **) &d_h_diff_table, h_diff_table_size));
    CUDA_CHECK(cudaMemcpy(d_movable_table, movable_table, movable_table_size,
                          cudaMemcpyHostToDevice));
    CUDA_CHECK(cudaMemcpy(d_h_diff_table, h_diff_table, h_diff_table_size,
                          cudaMemcpyHostToDevice));

    CUDA_CHECK(cudaMemset(d_input, 0, input_size));
    CUDA_CHECK(cudaMemset(d_plan, 0, plan_size));
    CUDA_CHECK(cudaMemset(d_stat, 0, stat_size));
    CUDA_CHECK(cudaMemset(d_blacklist, 0, blacklist_size));

    for (uchar f_limit = min_fvalue;; f_limit += 2)
    {
        elog("f=%d\n", (int) f_limit);
        CUDA_CHECK(
            cudaMemcpy(d_input, input, input_size, cudaMemcpyHostToDevice));
        CUDA_CHECK(cudaMemcpy(d_input_ends, input_ends, input_ends_size,
                              cudaMemcpyHostToDevice));

		fill_blacklist(h_blacklist);
        CUDA_CHECK(cudaMemcpy(d_blacklist, h_blacklist, blacklist_size,
                              cudaMemcpyHostToDevice));

        elog("BL1: %zu, BL2: %zu\n", BL1->n_elems, BL2->n_elems);
        elog("kernel(block=%d, thread=%d)\n", N_BLOCKS, BLOCK_DIM);
        idas_kernel<<<N_BLOCKS, BLOCK_DIM>>>(d_input, d_input_ends, d_plan,
                                             d_blacklist, d_stat, f_limit,
											 d_h_diff_table, d_movable_table);
        CUDA_CHECK(cudaGetLastError());

        CUDA_CHECK(cudaMemcpy(plan, d_plan, plan_size, cudaMemcpyDeviceToHost));
        CUDA_CHECK(cudaMemcpy(stat, d_stat, stat_size, cudaMemcpyDeviceToHost));

        for (int i = 0; i < cnt_inputs; ++i)
            if (stat[i].solved)
            {
                elog("core id = %d\n", i);
                printf("cpu len=%d: \n", input[i].init_depth);

                /* CPU side output */
                // FIXME: Not implemented, for now. It is easy to search path
                // from init state to this root.

                /* GPU side output */
                printf("gpu len=%d: ", stat[i].len);
                for (int j = 0; j < stat[i].len; ++j)
                    printf("%c ", dir_char[(int) plan[i * PLAN_LEN_MAX + j]]);
                putchar('\n');

                goto solution_found;
            }

        long long int sum_of_expansion = 0;
        for (int i = 0; i < cnt_inputs; ++i)
            sum_of_expansion += stat[i].nodes_expanded;

        long long int sum_of_pruned = 0;
        for (int i = 0; i < cnt_inputs; ++i)
            sum_of_pruned += stat[i].nodes_pruned;

        long long int increased             = 0;
        long long int avarage_expected_load = sum_of_expansion / N_WORKERS;

        int stat_cnt[10] = {0, 0, 0, 0, 0, 0, 0};
        for (int i = 0; i < cnt_inputs; ++i)
        {
            if (stat[i].nodes_expanded < avarage_expected_load)
                stat_cnt[0]++;
            else if (stat[i].nodes_expanded < 2 * avarage_expected_load)
                stat_cnt[1]++;
            else if (stat[i].nodes_expanded < 4 * avarage_expected_load)
                stat_cnt[2]++;
            else if (stat[i].nodes_expanded < 8 * avarage_expected_load)
                stat_cnt[3]++;
            else if (stat[i].nodes_expanded < 16 * avarage_expected_load)
                stat_cnt[4]++;
            else if (stat[i].nodes_expanded < 32 * avarage_expected_load)
                stat_cnt[5]++;
            else
                stat_cnt[6]++;

            int policy =
                stat[i].nodes_expanded / (avarage_expected_load + 1) + 1;

            if (policy > 1 && stat[i].nodes_expanded > 20)
                increased += input_devide(input, stat, i, policy,
                                          cnt_inputs + increased);
        }
        elog("STAT: sum of expanded nodes: %lld\n", sum_of_expansion);
        elog("STAT: avarage expanded nodes: %lld\n", avarage_expected_load);
        elog("STAT: av=%d, 2av=%d, 4av=%d, 8av=%d, 16av=%d, 32av=%d, more=%d\n",
             stat_cnt[0], stat_cnt[1], stat_cnt[2], stat_cnt[3], stat_cnt[4],
             stat_cnt[5], stat_cnt[6]);

        elog("STAT: sum of pruned nodes: %lld\n", sum_of_pruned);

        if (cnt_inputs + increased > N_INPUTS)
        {
            elog("cnt_inputs too large");
            abort();
        }

        cnt_inputs += increased;
        elog("input count: %d\n", cnt_inputs);

        /* NOTE: optionally sort here by expected cost or g/h-value */

        int id = 0;
        for (int i = 0, load = 0; i < cnt_inputs; ++i)
        {
            load += stat[i].nodes_expanded;
            if (load >= avarage_expected_load)
            {
                load             = 0;
                input_ends[id++] = i;
            }
        }

        while (id < N_WORKERS)
            input_ends[id++] = cnt_inputs;
    }
solution_found:

    CUDA_CHECK(cudaFree(d_input));
    CUDA_CHECK(cudaFree(d_input_ends));
    CUDA_CHECK(cudaFree(d_plan));
    CUDA_CHECK(cudaFree(d_stat));
    CUDA_CHECK(cudaFree(d_movable_table));
    CUDA_CHECK(cudaFree(d_h_diff_table));
    CUDA_CHECK(cudaDeviceReset());

    avoid_unused_static_assertions();

    return 0;
}

	.file	"tmpxft_002514bb_00000000-6_idas_black.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_, @function
_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_:
.LFB2072:
	.cfi_startproc
	movl	8(%rsi), %edx
	movb	$1, %al
	cmpl	%edx, 8(%rdi)
	jl	.L1
	movb	$0, %al
	jne	.L1
	movl	12(%rsi), %eax
	cmpl	%eax, 12(%rdi)
	setge	%al
.L1:
	ret
	.cfi_endproc
.LFE2072:
	.size	_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_, .-_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_
	.type	_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag, @function
_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag:
.LFB2088:
	.cfi_startproc
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	%rsi, %rcx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r8
.L7:
	movl	%esi, %eax
	cmpq	(%rcx), %rax
	jnb	.L17
	movq	16(%rcx), %rdx
	movq	(%rdx,%rax,8), %rax
.L8:
	testq	%rax, %rax
	je	.L18
	movq	(%rax), %r9
	movq	8(%rax), %r10
	xorl	%eax, %eax
.L9:
	movl	%eax, %edx
	movq	%rax, %r11
	incq	%rax
	sarl	$2, %edx
	andl	$3, %r11d
	movslq	%edx, %rdx
	leaq	(%r10,%r11,4), %r11
	movb	4(%rdx,%r11), %dl
	movb	%dl, -1(%rax,%r8)
	cmpq	$16, %rax
	jne	.L9
	movzbl	8(%rsp), %edx
	movl	$1, %eax
.L10:
	movzbl	(%r8,%rax), %r11d
	incq	%rax
	leaq	(%r11,%rdx,4), %rdx
	cmpq	$16, %rax
	jne	.L10
	movq	%rdx, %rax
	movups	8(%rsp), %xmm0
	movslq	%edx, %rdx
	andl	$1024, %eax
	salq	$5, %rax
	addq	%rdi, %rax
	movq	%rdx, 16(%rax)
	movups	%xmm0, (%rax)
	movl	(%r10), %edx
	movl	%edx, 24(%rax)
	movq	%r9, %rax
	jmp	.L8
.L18:
	incl	%esi
	jmp	.L7
.L17:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2088:
	.size	_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag, .-_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2098:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2098:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_ZL13pq_swap_entryP6pq_tagmm.isra.0, @function
_ZL13pq_swap_entryP6pq_tagmm.isra.0:
.LFB2241:
	.cfi_startproc
	salq	$4, %rsi
	salq	$4, %rdx
	addq	%rdi, %rsi
	addq	%rdx, %rdi
	movq	(%rsi), %rcx
	movq	8(%rsi), %rax
	movups	(%rdi), %xmm0
	movups	%xmm0, (%rsi)
	movq	%rcx, (%rdi)
	movq	%rax, 8(%rdi)
	ret
	.cfi_endproc
.LFE2241:
	.size	_ZL13pq_swap_entryP6pq_tagmm.isra.0, .-_ZL13pq_swap_entryP6pq_tagmm.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"malloc failed\n"
	.text
	.globl	_Z6pallocm
	.type	_Z6pallocm, @function
_Z6pallocm:
.LFB2042:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	call	malloc@PLT
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	.L21
	movq	stderr(%rip), %rdi
	leaq	.LC0(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L21:
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2042:
	.size	_Z6pallocm, .-_Z6pallocm
	.section	.rodata.str1.1
.LC1:
	.string	"realloc failed\n"
	.text
	.globl	_Z8repallocPvm
	.type	_Z8repallocPvm, @function
_Z8repallocPvm:
.LFB2043:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	call	realloc@PLT
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	.L24
	movq	stderr(%rip), %rdi
	leaq	.LC1(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L24:
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2043:
	.size	_Z8repallocPvm, .-_Z8repallocPvm
	.section	.rodata.str1.1
.LC2:
	.string	"empty ptr\n"
	.text
	.globl	_Z5pfreePv
	.type	_Z5pfreePv, @function
_Z5pfreePv:
.LFB2044:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	jne	.L28
	movq	stderr(%rip), %rdi
	leaq	.LC2(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L28:
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE2044:
	.size	_Z5pfreePv, .-_Z5pfreePv
	.globl	_Z13state_is_goalP13state_tag_cpu
	.type	_Z13state_is_goalP13state_tag_cpu, @function
_Z13state_is_goalP13state_tag_cpu:
.LFB2047:
	.cfi_startproc
	endbr64
	cmpl	$0, 24(%rdi)
	sete	%al
	ret
	.cfi_endproc
.LFE2047:
	.size	_Z13state_is_goalP13state_tag_cpu, .-_Z13state_is_goalP13state_tag_cpu
	.globl	_Z10state_initPhi
	.type	_Z10state_initPhi, @function
_Z10state_initPhi:
.LFB2050:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	movl	$28, %edi
	pushq	%rcx
	.cfi_def_cfa_offset 32
	call	_Z6pallocm
	xorl	%edx, %edx
	movl	%ebp, (%rax)
	movb	$-1, 22(%rax)
.L32:
	movl	%edx, %r10d
	leaq	(%rbx,%rdx,4), %r9
	leaq	(%rdx,%rax), %r8
	xorl	%ecx, %ecx
.L34:
	movb	(%r9,%rcx), %dil
	testb	%dil, %dil
	jne	.L33
	movb	%cl, 20(%rax)
	movb	%r10b, 21(%rax)
.L33:
	movb	%dil, 4(%r8,%rcx,4)
	incq	%rcx
	movq	%rax, %rsi
	cmpq	$4, %rcx
	jne	.L34
	incq	%rdx
	cmpq	$4, %rdx
	jne	.L32
	xorl	%ecx, %ecx
	leaq	_ZL6from_x(%rip), %r8
	leaq	_ZL6from_y(%rip), %r9
.L35:
	xorl	%edx, %edx
.L36:
	movzbl	4(%rsi,%rdx), %edi
	movb	%dl, (%r9,%rdi)
	incq	%rdx
	movb	%cl, (%r8,%rdi)
	cmpq	$4, %rdx
	jne	.L36
	incl	%ecx
	addq	$4, %rsi
	cmpb	$4, %cl
	jne	.L35
	movl	$1, %edx
	xorl	%ecx, %ecx
.L37:
	movl	%edx, %r10d
	movzbl	(%r8,%rdx), %r11d
	movl	%edx, %ebp
	movl	%edx, %esi
	andl	$3, %r10d
	andl	$3, %ebp
	movl	%r10d, %edi
	subl	%r11d, %edi
	cmpb	%r11b, %bpl
	jnb	.L39
	movl	%r11d, %edi
	subl	%r10d, %edi
.L39:
	shrb	$2, %sil
	movzbl	(%r9,%rdx), %r11d
	addl	%edi, %ecx
	movzbl	%sil, %r10d
	movl	%r10d, %edi
	subl	%r11d, %edi
	cmpb	%r11b, %sil
	jnb	.L41
	movl	%r11d, %edi
	subl	%r10d, %edi
.L41:
	incq	%rdx
	addl	%edi, %ecx
	cmpq	$16, %rdx
	jne	.L37
	movl	%ecx, 24(%rax)
	popq	%rdx
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2050:
	.size	_Z10state_initPhi, .-_Z10state_initPhi
	.globl	_Z10state_finiP13state_tag_cpu
	.type	_Z10state_finiP13state_tag_cpu, @function
_Z10state_finiP13state_tag_cpu:
.LFB2051:
	.cfi_startproc
	endbr64
	jmp	_Z5pfreePv
	.cfi_endproc
.LFE2051:
	.size	_Z10state_finiP13state_tag_cpu, .-_Z10state_finiP13state_tag_cpu
	.globl	_Z10state_copyP13state_tag_cpu
	.type	_Z10state_copyP13state_tag_cpu, @function
_Z10state_copyP13state_tag_cpu:
.LFB2052:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	movl	$28, %edi
	call	_Z6pallocm
	movups	(%rbx), %xmm0
	movups	12(%rbx), %xmm1
	movups	%xmm0, (%rax)
	movups	%xmm1, 12(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2052:
	.size	_Z10state_copyP13state_tag_cpu, .-_Z10state_copyP13state_tag_cpu
	.globl	_Z13state_movableP13state_tag_cpua
	.type	_Z13state_movableP13state_tag_cpua, @function
_Z13state_movableP13state_tag_cpua:
.LFB2057:
	.cfi_startproc
	endbr64
	cmpb	$2, %sil
	jne	.L52
	cmpb	$0, 20(%rdi)
	jmp	.L57
.L52:
	cmpb	$3, %sil
	jne	.L54
	cmpb	$3, 21(%rdi)
	jmp	.L57
.L54:
	cmpb	$1, %sil
	jne	.L55
	cmpb	$3, 20(%rdi)
	jmp	.L57
.L55:
	movb	$1, %al
	testb	%sil, %sil
	jne	.L51
	cmpb	$0, 21(%rdi)
.L57:
	setne	%al
.L51:
	ret
	.cfi_endproc
.LFE2057:
	.size	_Z13state_movableP13state_tag_cpua, .-_Z13state_movableP13state_tag_cpua
	.section	.rodata.str1.1
.LC3:
	.string	"unexpected direction"
	.text
	.globl	_Z10state_moveP13state_tag_cpua
	.type	_Z10state_moveP13state_tag_cpua, @function
_Z10state_moveP13state_tag_cpua:
.LFB2058:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	cmpb	$2, %sil
	je	.L59
	jg	.L60
	testb	%sil, %sil
	je	.L61
	cmpb	$1, %sil
	jne	.L63
	movzbl	20(%rdi), %edx
	movzbl	21(%rdi), %esi
	leal	1(%rdx), %ecx
	movl	%edx, %eax
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	leaq	(%rdi,%rdx,4), %rdx
	incl	%eax
	leaq	(%rdi,%rcx,4), %rcx
	movb	4(%rsi,%rcx), %bpl
	movb	%bpl, 4(%rsi,%rdx)
	jmp	.L67
.L60:
	cmpb	$3, %sil
	jne	.L63
	movzbl	21(%rdi), %edx
	movzbl	20(%rdi), %esi
	leal	1(%rdx), %ecx
	leaq	(%rdi,%rsi,4), %rsi
	movl	%edx, %eax
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	incl	%eax
	movb	4(%rcx,%rsi), %bpl
	movb	%bpl, 4(%rsi,%rdx)
	jmp	.L68
.L59:
	movzbl	20(%rdi), %edx
	movzbl	21(%rdi), %esi
	leal	-1(%rdx), %ecx
	movl	%edx, %eax
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	leaq	(%rdi,%rdx,4), %rdx
	decl	%eax
	leaq	(%rdi,%rcx,4), %rcx
	movb	4(%rsi,%rcx), %bpl
	movb	%bpl, 4(%rsi,%rdx)
.L67:
	movb	%al, 20(%rbx)
	jmp	.L65
.L61:
	movzbl	21(%rdi), %edx
	movzbl	20(%rdi), %esi
	leal	-1(%rdx), %ecx
	leaq	(%rdi,%rsi,4), %rsi
	movl	%edx, %eax
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	decl	%eax
	movb	4(%rcx,%rsi), %bpl
	movb	%bpl, 4(%rsi,%rdx)
.L68:
	movb	%al, 21(%rbx)
	jmp	.L65
.L63:
	movq	stderr(%rip), %rdi
	leaq	.LC3(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L65:
	movzbl	21(%rbx), %eax
	movzbl	%bpl, %ebp
	movzbl	20(%rbx), %edx
	movb	%r12b, 22(%rbx)
	sall	$6, %ebp
	sall	$4, %eax
	addl	%ebp, %eax
	leal	(%rax,%rdx,4), %eax
	movb	$3, %dl
	subl	%r12d, %edx
	movsbl	%dl, %edx
	addl	%edx, %eax
	leaq	_ZL12h_diff_table(%rip), %rdx
	cltq
	movl	(%rdx,%rax,4), %eax
	addl	%eax, 24(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2058:
	.size	_Z10state_moveP13state_tag_cpua, .-_Z10state_moveP13state_tag_cpua
	.globl	_Z15state_pos_equalP13state_tag_cpuS0_
	.type	_Z15state_pos_equalP13state_tag_cpuS0_, @function
_Z15state_pos_equalP13state_tag_cpuS0_:
.LFB2059:
	.cfi_startproc
	endbr64
	xorl	%edx, %edx
.L70:
	movq	%rdx, %rax
	movb	$4, %cl
.L72:
	movb	4(%rsi,%rax), %r8b
	cmpb	%r8b, 4(%rdi,%rax)
	jne	.L73
	incq	%rax
	decb	%cl
	jne	.L72
	addq	$4, %rdx
	cmpq	$16, %rdx
	jne	.L70
	movb	$1, %al
	ret
.L73:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE2059:
	.size	_Z15state_pos_equalP13state_tag_cpuS0_, .-_Z15state_pos_equalP13state_tag_cpuS0_
	.globl	_Z10state_hashP13state_tag_cpu
	.type	_Z10state_hashP13state_tag_cpu, @function
_Z10state_hashP13state_tag_cpu:
.LFB2060:
	.cfi_startproc
	endbr64
	xorl	%esi, %esi
	xorl	%r8d, %r8d
.L77:
	leal	0(,%rsi,4), %ecx
	xorl	%edx, %edx
.L78:
	movzbl	4(%rdi,%rdx), %eax
	incq	%rdx
	sall	%cl, %eax
	addl	$4, %ecx
	cltq
	xorq	%rax, %r8
	cmpq	$4, %rdx
	jne	.L78
	addl	$3, %esi
	addq	$4, %rdi
	cmpl	$12, %esi
	jne	.L77
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE2060:
	.size	_Z10state_hashP13state_tag_cpu, .-_Z10state_hashP13state_tag_cpu
	.globl	_Z16state_get_hvalueP13state_tag_cpu
	.type	_Z16state_get_hvalueP13state_tag_cpu, @function
_Z16state_get_hvalueP13state_tag_cpu:
.LFB2061:
	.cfi_startproc
	endbr64
	movl	24(%rdi), %eax
	ret
	.cfi_endproc
.LFE2061:
	.size	_Z16state_get_hvalueP13state_tag_cpu, .-_Z16state_get_hvalueP13state_tag_cpu
	.globl	_Z15state_get_depthP13state_tag_cpu
	.type	_Z15state_get_depthP13state_tag_cpu, @function
_Z15state_get_depthP13state_tag_cpu:
.LFB2062:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE2062:
	.size	_Z15state_get_depthP13state_tag_cpu, .-_Z15state_get_depthP13state_tag_cpu
	.globl	_Z7ht_initm
	.type	_Z7ht_initm, @function
_Z7ht_initm:
.LFB2068:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	$1, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 32
.L84:
	cmpq	%rdi, %rbx
	jnb	.L87
	addq	%rbx, %rbx
	jmp	.L84
.L87:
	movl	$24, %edi
	call	_Z6pallocm
	movq	%rax, %rbp
	movq	%rbx, (%rax)
	xorl	%eax, %eax
	salq	$3, %rbx
	movq	%rax, 8(%rbp)
	movq	%rbx, %rdi
	call	_Z6pallocm
	movq	%rbx, %rcx
	movq	%rax, %rdx
	movq	%rax, 16(%rbp)
	xorl	%eax, %eax
	movq	%rdx, %rdi
	rep stosb
	movq	%rbp, %rax
	popq	%rdx
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2068:
	.size	_Z7ht_initm, .-_Z7ht_initm
	.globl	_Z7ht_finiP6ht_tag
	.type	_Z7ht_finiP6ht_tag, @function
_Z7ht_finiP6ht_tag:
.LFB2070:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 48
.L89:
	movq	16(%rbx), %rdi
	cmpq	(%rbx), %r12
	jnb	.L94
	movq	(%rdi,%r12,8), %rbp
.L90:
	testq	%rbp, %rbp
	je	.L95
	movq	8(%rbp), %rdi
	movq	0(%rbp), %r13
	call	_Z5pfreePv
	movq	%rbp, %rdi
	movq	%r13, %rbp
	call	_Z5pfreePv
	jmp	.L90
.L95:
	incq	%r12
	jmp	.L89
.L94:
	call	_Z5pfreePv
	popq	%rax
	.cfi_def_cfa_offset 40
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	_Z5pfreePv
	.cfi_endproc
.LFE2070:
	.size	_Z7ht_finiP6ht_tag, .-_Z7ht_finiP6ht_tag
	.globl	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	.type	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi, @function
_Z9ht_insertP6ht_tagP13state_tag_cpuPPi:
.LFB2071:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	(%rdi), %rcx
	movq	%rsi, (%rsp)
	cmpq	%rcx, 8(%rdi)
	jb	.L97
	leaq	(%rcx,%rcx), %rbp
	salq	$4, %rcx
	movq	%rcx, %rdi
	movq	%rcx, %r15
	call	_Z6pallocm
	movq	%r15, %rcx
	movq	(%rbx), %r12
	movq	16(%rbx), %r15
	movq	%rax, %r14
	xorl	%eax, %eax
	leaq	-1(%rbp), %r11
	xorl	%r10d, %r10d
	movq	%r14, %rdi
	rep stosb
.L98:
	cmpq	%r12, %r10
	je	.L107
	movq	(%r15,%r10,8), %r9
.L99:
	testq	%r9, %r9
	je	.L108
	movq	(%r9), %rax
	movq	8(%r9), %rdi
	movq	%rax, 8(%rsp)
	call	_Z10state_hashP13state_tag_cpu
	andq	%r11, %rax
	leaq	(%r14,%rax,8), %rax
	movq	(%rax), %rsi
	movq	%rsi, (%r9)
	movq	%r9, (%rax)
	movq	8(%rsp), %r9
	jmp	.L99
.L108:
	incq	%r10
	jmp	.L98
.L107:
	movq	%r15, %rdi
	call	_Z5pfreePv
	movq	%rbp, (%rbx)
	movq	%r14, 16(%rbx)
.L97:
	movq	(%rsp), %rdi
	call	_Z10state_hashP13state_tag_cpu
	movq	%rax, %rdx
	movq	(%rbx), %rax
	decq	%rax
	andq	%rdx, %rax
	movq	16(%rbx), %rdx
	leaq	0(,%rax,8), %r14
	movq	(%rdx,%rax,8), %r9
.L102:
	testq	%r9, %r9
	je	.L109
	movq	8(%r9), %rsi
	movq	(%rsp), %rdi
	call	_Z15state_pos_equalP13state_tag_cpuS0_
	testb	%al, %al
	je	.L103
	addq	$16, %r9
	movl	$1, %eax
	movq	%r9, 0(%r13)
	jmp	.L96
.L103:
	movq	(%r9), %r9
	jmp	.L102
.L109:
	movl	$24, %edi
	call	_Z6pallocm
	movq	(%rsp), %rdi
	movq	%rax, %rbp
	call	_Z10state_copyP13state_tag_cpu
	addq	16(%rbx), %r14
	movq	%rax, 8(%rbp)
	xorl	%eax, %eax
	movq	%rax, 0(%rbp)
	movq	(%r14), %rax
	movq	%rax, 0(%rbp)
	xorl	%eax, %eax
	movq	%rbp, (%r14)
	addq	$16, %rbp
	movq	%rbp, 0(%r13)
	incq	8(%rbx)
.L96:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2071:
	.size	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi, .-_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	.globl	_Z7pq_initm
	.type	_Z7pq_initm, @function
_Z7pq_initm:
.LFB2074:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	movl	$24, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%rcx
	.cfi_def_cfa_offset 32
	call	_Z6pallocm
	xorl	%esi, %esi
	movl	$1, %edi
	movq	%rsi, (%rax)
	movq	%rax, %rbx
.L111:
	cmpq	%rbp, %rdi
	jnb	.L114
	addq	%rdi, %rdi
	jmp	.L111
.L114:
	decq	%rdi
	movq	%rdi, 8(%rbx)
	salq	$4, %rdi
	call	_Z6pallocm
	movq	%rax, 16(%rbx)
	movq	%rbx, %rax
	popq	%rdx
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2074:
	.size	_Z7pq_initm, .-_Z7pq_initm
	.globl	_Z7pq_finiP6pq_tag
	.type	_Z7pq_finiP6pq_tag, @function
_Z7pq_finiP6pq_tag:
.LFB2075:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 32
.L116:
	movq	16(%rbx), %rdi
	cmpq	(%rbx), %rbp
	jnb	.L119
	movq	%rbp, %rax
	incq	%rbp
	salq	$4, %rax
	movq	(%rdi,%rax), %rdi
	call	_Z5pfreePv
	jmp	.L116
.L119:
	call	_Z5pfreePv
	popq	%rax
	.cfi_def_cfa_offset 24
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	_Z5pfreePv
	.cfi_endproc
.LFE2075:
	.size	_Z7pq_finiP6pq_tag, .-_Z7pq_finiP6pq_tag
	.globl	_Z6pq_putP6pq_tagP13state_tag_cpuii
	.type	_Z6pq_putP6pq_tagP13state_tag_cpuii, @function
_Z6pq_putP6pq_tagP13state_tag_cpuii:
.LFB2082:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
	movq	8(%rdi), %rsi
	cmpq	%rsi, (%rdi)
	jne	.L121
	addq	%rsi, %rsi
	movq	16(%rdi), %rdi
	incq	%rsi
	movq	%rsi, 8(%rbx)
	salq	$4, %rsi
	call	_Z8repallocPvm
	movq	%rax, 16(%rbx)
.L121:
	movq	(%rbx), %r14
	movq	%r13, %rdi
	salq	$4, %r14
	addq	16(%rbx), %r14
	call	_Z10state_copyP13state_tag_cpu
	movq	(%rbx), %r8
	movq	16(%rbx), %r10
	movq	%rax, (%r14)
	movq	%r8, %rax
	movq	%r8, %rcx
	salq	$4, %rax
	addq	%r10, %rax
	movl	%r12d, 8(%rax)
	movl	%ebp, 12(%rax)
.L122:
	testq	%rcx, %rcx
	je	.L123
	leaq	-1(%rcx), %r9
	movq	%rcx, %rdi
	shrq	%r9
	salq	$4, %rdi
	movq	%r9, %rsi
	addq	%r10, %rdi
	salq	$4, %rsi
	addq	%r10, %rsi
	call	_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_
	testb	%al, %al
	je	.L123
	movq	%rcx, %rsi
	movq	%r9, %rdx
	movq	%r10, %rdi
	call	_ZL13pq_swap_entryP6pq_tagmm.isra.0
	movq	%r9, %rcx
	jmp	.L122
.L123:
	incq	%r8
	movq	%r8, (%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2082:
	.size	_Z6pq_putP6pq_tagP13state_tag_cpuii, .-_Z6pq_putP6pq_tagP13state_tag_cpuii
	.globl	_Z6pq_popP6pq_tag
	.type	_Z6pq_popP6pq_tag, @function
_Z6pq_popP6pq_tag:
.LFB2084:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	(%rdi), %r10
	testq	%r10, %r10
	je	.L129
	decq	%r10
	movq	16(%rdi), %r8
	xorl	%ecx, %ecx
	movq	%r10, %rax
	salq	$4, %rax
	movq	(%r8), %rbp
	movq	%r10, (%rdi)
	movups	(%r8,%rax), %xmm0
	movups	%xmm0, (%r8)
.L131:
	leaq	(%rcx,%rcx), %r9
	leaq	1(%r9), %rbx
	cmpq	%r10, %rbx
	jnb	.L129
	movq	%rbx, %rax
	movq	%rcx, %r11
	addq	$2, %r9
	salq	$4, %rax
	salq	$4, %r11
	leaq	(%r8,%rax), %rdi
	addq	%r8, %r11
	cmpq	%r10, %r9
	jb	.L133
	movq	%r11, %rsi
	call	_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_
	testb	%al, %al
	je	.L129
	movq	%rbx, %rdx
	movq	%rcx, %rsi
	movq	%r8, %rdi
	call	_ZL13pq_swap_entryP6pq_tagmm.isra.0
	jmp	.L129
.L133:
	leaq	16(%r8,%rax), %r12
	movq	%r12, %rsi
	call	_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_
	movq	%r11, %rsi
	testb	%al, %al
	je	.L135
	call	_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_
	testb	%al, %al
	je	.L129
	movq	%rbx, %rdx
	movq	%rcx, %rsi
	movq	%r8, %rdi
	movq	%rbx, %r9
	call	_ZL13pq_swap_entryP6pq_tagmm.isra.0
.L136:
	movq	%r9, %rcx
	jmp	.L131
.L135:
	movq	%r12, %rdi
	call	_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_
	testb	%al, %al
	je	.L129
	movq	%r9, %rdx
	movq	%rcx, %rsi
	movq	%r8, %rdi
	call	_ZL13pq_swap_entryP6pq_tagmm.isra.0
	jmp	.L136
.L129:
	movq	%rbp, %rax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2084:
	.size	_Z6pq_popP6pq_tag, .-_Z6pq_popP6pq_tag
	.section	.rodata.str1.1
.LC4:
	.string	"pq_dump"
.LC5:
	.string	"%s: n_elems=%zu, capa=%zu\n"
.LC6:
	.string	"\n"
.LC7:
	.string	"%d,"
.LC8:
	.string	"%d "
	.text
	.globl	_Z7pq_dumpP6pq_tag
	.type	_Z7pq_dumpP6pq_tag, @function
_Z7pq_dumpP6pq_tag:
.LFB2085:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC4(%rip), %rcx
	movl	$2, %esi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC5(%rip), %rdx
	leaq	.LC6(%rip), %r14
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
	movq	8(%rdi), %r9
	movq	(%rdi), %r8
	movq	stderr(%rip), %rdi
	call	__fprintf_chk@PLT
.L146:
	movq	stderr(%rip), %rdi
	cmpq	(%rbx), %rbp
	jnb	.L150
	cmpq	%r12, %rbp
	jne	.L147
	movq	%r14, %rdx
	movl	$2, %esi
	leaq	0(%rbp,%rbp), %r12
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	incq	%r12
.L147:
	movq	16(%rbx), %rax
	movq	%rbp, %r13
	incq	%rbp
	movq	stderr(%rip), %rdi
	salq	$4, %r13
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	movl	8(%rax,%r13), %ecx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	16(%rbx), %rax
	movl	$2, %esi
	movq	stderr(%rip), %rdi
	leaq	.LC8(%rip), %rdx
	movl	12(%rax,%r13), %ecx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	jmp	.L146
.L150:
	popq	%rbx
	.cfi_def_cfa_offset 40
	leaq	.LC6(%rip), %rdx
	popq	%rbp
	.cfi_def_cfa_offset 32
	movl	$2, %esi
	popq	%r12
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	__fprintf_chk@PLT
	.cfi_endproc
.LFE2085:
	.size	_Z7pq_dumpP6pq_tag, .-_Z7pq_dumpP6pq_tag
	.section	.rodata.str1.1
.LC9:
	.string	"distr_n=%d, n_worers=%d, cnt=%d\n"
	.text
	.globl	_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_
	.type	_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_, @function
_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_:
.LFB2086:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	leal	10(%rcx), %edi
	movslq	%edi, %rdi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%r8, 32(%rsp)
	movq	%r9, 40(%rsp)
	movq	%rsi, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	_Z7pq_initm
	movl	$10000, %edi
	movq	%rax, 8(%rsp)
	call	_Z7ht_initm
	movl	$1000, %edi
	movq	%rax, _ZL6closed(%rip)
	call	_Z7ht_initm
	movl	$1000, %edi
	movq	%rax, _ZL3BL1(%rip)
	call	_Z7ht_initm
	movq	_ZL6closed(%rip), %rdi
	movq	%rbx, %rsi
	movq	%rax, _ZL3BL2(%rip)
	leaq	48(%rsp), %rax
	movq	%rax, %rdx
	movq	%rax, 16(%rsp)
	call	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	movq	48(%rsp), %rax
	xorl	%edx, %edx
	movq	%rbx, %rdi
	movl	%edx, (%rax)
	movl	24(%rbx), %r12d
	call	_Z10state_copyP13state_tag_cpu
	movq	8(%rsp), %rdi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	movq	%rax, %rsi
	movl	$1, %r12d
	call	_Z6pq_putP6pq_tagP13state_tag_cpuii
.L152:
	movq	8(%rsp), %rdi
	call	_Z6pq_popP6pq_tag
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.L153
	decl	%r12d
	cmpl	$0, 24(%rbx)
	je	.L168
	movq	16(%rsp), %rdx
	movq	_ZL6closed(%rip), %rdi
	movq	%rbx, %rsi
	call	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	decl	%eax
	movq	48(%rsp), %rax
	jne	.L154
	movl	(%rbx), %ecx
	cmpl	%ecx, (%rax)
	jge	.L154
	movq	%rbx, %rdi
	call	_Z5pfreePv
	jmp	.L152
.L154:
	movl	(%rbx), %edx
	xorl	%r13d, %r13d
	movl	%edx, (%rax)
.L160:
	movb	$3, %al
	subl	%r13d, %eax
	cmpb	%al, 22(%rbx)
	je	.L159
	movl	%r13d, %esi
	movq	%rbx, %rdi
	call	_Z13state_movableP13state_tag_cpua
	testb	%al, %al
	je	.L159
	call	_Z10state_copyP13state_tag_cpu
	movl	%r13d, %esi
	movq	%rax, %r15
	movq	%rax, %rdi
	call	_Z10state_moveP13state_tag_cpua
	incl	(%r15)
	movq	16(%rsp), %rdx
	movq	%r15, %rsi
	movq	_ZL6closed(%rip), %rdi
	call	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	decl	%eax
	movq	48(%rsp), %rax
	jne	.L157
	movl	(%r15), %ecx
	cmpl	%ecx, (%rax)
	jle	.L158
.L157:
	movl	(%r15), %ecx
	movq	8(%rsp), %rdi
	movq	%r15, %rsi
	incl	%r12d
	movl	%ecx, (%rax)
	movl	24(%r15), %edx
	addl	%ecx, %edx
	call	_Z6pq_putP6pq_tagP13state_tag_cpuii
	jmp	.L159
.L158:
	movq	%r15, %rdi
	call	_Z5pfreePv
.L159:
	incl	%r13d
	cmpl	$4, %r13d
	jne	.L160
	movq	%rbx, %rdi
	call	_Z5pfreePv
	cmpl	%ebp, %r12d
	jl	.L152
	xorl	%ebx, %ebx
	jmp	.L153
.L168:
	movb	$1, %bl
.L153:
	movq	32(%rsp), %rax
	movl	%r12d, (%rax)
	testb	%bl, %bl
	jne	.L162
	movq	24(%rsp), %r13
	xorl	%ecx, %ecx
	movl	$2147483647, %r15d
.L163:
	cmpl	%ecx, %r12d
	jle	.L177
	movq	8(%rsp), %rdi
	movl	%ecx, 16(%rsp)
	call	_Z6pq_popP6pq_tag
	movl	16(%rsp), %ecx
	xorl	%edx, %edx
.L164:
	movl	%edx, %esi
	movq	%rdx, %rdi
	sarl	$2, %esi
	andl	$3, %edi
	movslq	%esi, %rsi
	leaq	(%rax,%rdi,4), %rdi
	movb	4(%rsi,%rdi), %sil
	movb	%sil, 0(%r13,%rdx)
	incq	%rdx
	cmpq	$16, %rdx
	jne	.L164
	movzbl	21(%rax), %esi
	movzbl	20(%rax), %edx
	leal	(%rdx,%rsi,4), %edx
	movslq	%edx, %rdx
	movb	$0, 0(%r13,%rdx)
	movl	(%rax), %edx
	movl	%edx, 16(%r13)
	movb	22(%rax), %dl
	movb	%dl, 20(%r13)
	movl	24(%rax), %edx
	addl	(%rax), %edx
	cmpl	%edx, %r15d
	cmovg	%edx, %r15d
	incl	%ecx
	addq	$24, %r13
	jmp	.L163
.L177:
	movq	40(%rsp), %rax
	movl	$3072, %ecx
	movl	%ebp, %edx
	movl	%r12d, %r8d
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	movl	%r15d, (%rax)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%ebp, %eax
	movl	$3072, %ecx
	cltd
	idivl	%ecx
	xorl	%edx, %edx
	leal	-1(%rax), %ecx
.L166:
	movl	%ecx, (%r14,%rdx,4)
	incq	%rdx
	addl	%eax, %ecx
	cmpq	$3072, %rdx
	jne	.L166
	movl	%r12d, 12284(%r14)
.L162:
	movq	8(%rsp), %rdi
	call	_Z7pq_finiP6pq_tag
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L167
	call	__stack_chk_fail@PLT
.L167:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2086:
	.size	_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_, .-_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_
	.globl	_Z90__device_stub__Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_PbP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.type	_Z90__device_stub__Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_PbP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb, @function
_Z90__device_stub__Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_PbP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb:
.LFB2120:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	224(%rsp), %rax
	movq	%rdi, 56(%rsp)
	leaq	88(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	100(%rsp), %rsi
	movq	%rax, 8(%rsp)
	movq	232(%rsp), %rax
	movq	%rdx, 40(%rsp)
	leaq	72(%rsp), %rdx
	movq	%rcx, 32(%rsp)
	leaq	80(%rsp), %rcx
	movq	%r8, 24(%rsp)
	movl	%r9d, 20(%rsp)
	movq	%rax, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movl	$1, 96(%rsp)
	movq	%rax, 136(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 184(%rsp)
	movq	%rsp, %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 88(%rsp)
	movq	%rax, 100(%rsp)
	movl	$1, 108(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L178
	pushq	80(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb(%rip), %rdi
	pushq	80(%rsp)
	.cfi_def_cfa_offset 240
	movq	116(%rsp), %rcx
	movl	124(%rsp), %r8d
	movq	104(%rsp), %rsi
	movl	112(%rsp), %edx
	leaq	152(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L178:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L180
	call	__stack_chk_fail@PLT
.L180:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2120:
	.size	_Z90__device_stub__Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_PbP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb, .-_Z90__device_stub__Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_PbP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.globl	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.type	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb, @function
_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb:
.LFB2121:
	.cfi_startproc
	endbr64
	jmp	_Z90__device_stub__Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_PbP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.cfi_endproc
.LFE2121:
	.size	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb, .-_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.section	.rodata.str1.1
.LC10:
	.string	"usage: bin/cumain <ifname>\n"
.LC11:
	.string	"r"
.LC12:
	.string	"load_state_from_file"
.LC13:
	.string	"%s: %s cannot be opened\n"
.LC14:
	.string	"%s: fgets failed\n"
.LC15:
	.string	"pop_int_from_str"
.LC16:
	.string	"%s: reach end of string"
.LC17:
	.string	"%s: too big number, %ld\n"
.LC18:
	.string	"solution is found by distributor"
.LC19:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/TakefumiYamamura/sliding-puzzle/master/src_horie/idas_black.cu"
.LC20:
	.string	"Error: %s:%d code:%d, reason: %s\n"
.LC21:
	.string	"f=%d\n"
.LC22:
	.string	"BL1: %zu, BL2: %zu\n"
.LC23:
	.string	"kernel(block=%d, thread=%d)\n"
.LC24:
	.string	"core id = %d\n"
.LC25:
	.string	"cpu len=%d: \n"
.LC26:
	.string	"gpu len=%d: "
.LC27:
	.string	"%c "
.LC28:
	.string	"STAT: sum of expanded nodes: %lld\n"
.LC29:
	.string	"STAT: avarage expanded nodes: %lld\n"
.LC30:
	.string	"STAT: av=%d, 2av=%d, 4av=%d, 8av=%d, 16av=%d, 32av=%d, more=%d\n"
.LC31:
	.string	"STAT: sum of pruned nodes: %lld\n"
.LC32:
	.string	"cnt_inputs too large"
.LC33:
	.string	"input count: %d\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2095:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-8245248(%rsp), %r11
	.cfi_def_cfa 11, 8245304
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 8246656
	xorl	%r10d, %r10d
	movq	%fs:40, %rax
	movq	%rax, 8246584(%rsp)
	xorl	%eax, %eax
	decl	%edi
	movl	%r10d, 156(%rsp)
	jg	.L184
	leaq	.LC10(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L309
.L184:
	movq	8(%rsi), %rbx
	leaq	.LC11(%rip), %rsi
	movq	%rbx, %rdi
	call	fopen@PLT
	movq	%rax, %r12
	testq	%rax, %rax
	jne	.L185
	movq	%rbx, %rcx
	leaq	.LC12(%rip), %rdx
	leaq	.LC13(%rip), %rsi
.L310:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L309:
	movl	$1, %edi
	call	exit@PLT
.L185:
	movl	$100, %edx
	movl	$100, %esi
	movq	%rax, %rcx
	xorl	%r14d, %r14d
	leaq	1979704(%rsp), %rbx
	movl	$2147483648, %r15d
	movq	%rbx, %rdi
	call	__fgets_chk@PLT
	leaq	.LC12(%rip), %rdx
	movl	$2, %edi
	leaq	.LC14(%rip), %rsi
	testq	%rax, %rax
	je	.L311
.L186:
	movq	%rbx, %rdi
	leaq	232(%rsp), %rsi
	xorl	%edx, %edx
	call	__isoc23_strtol@PLT
	movq	%rax, %rbp
	call	__errno_location@PLT
	xorl	%r9d, %r9d
	movl	%r9d, (%rax)
	movq	%rbx, %rax
	movq	232(%rsp), %rbx
	cmpq	%rbx, %rax
	jne	.L187
	leaq	.LC15(%rip), %rdx
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
.L311:
	call	__printf_chk@PLT
	jmp	.L309
.L187:
	leaq	0(%rbp,%r15), %rax
	movl	$4294967295, %edx
	cmpq	%rax, %rdx
	jnb	.L188
	movq	%rbp, %rcx
	leaq	.LC15(%rip), %rdx
	leaq	.LC17(%rip), %rsi
	jmp	.L310
.L188:
	movb	%bpl, 602424(%rsp,%r14)
	incq	%r14
	leaq	602424(%rsp), %r13
	cmpq	$16, %r14
	jne	.L186
	movq	%r12, %rdi
	leaq	1978680(%rsp), %rbx
	call	fclose@PLT
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	_Z10state_initPhi
	leaq	312(%rsp), %rdx
	movl	$12288, %ecx
	movq	%r13, %rsi
	movq	%rax, %rdi
	leaq	156(%rsp), %r9
	leaq	152(%rsp), %r8
	call	_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_
	movl	%eax, %edx
	xorl	%eax, %eax
	testb	%dl, %dl
	je	.L189
	leaq	.LC18(%rip), %rdi
	call	puts@PLT
	jmp	.L190
.L189:
	movl	%eax, %r10d
	movl	%eax, %r9d
	movl	%eax, %edx
	xorl	%ecx, %ecx
	sarl	$2, %r9d
	andl	$3, %r10d
	sall	$6, %edx
.L196:
	movl	%ecx, %ebp
	movl	%ecx, %r8d
	leal	2(%rdx), %esi
	movslq	%edx, %r12
	sarl	$2, %ebp
	andl	$3, %r8d
	movslq	%esi, %rsi
	cmpl	%ebp, %r9d
	setle	%dil
	cmpl	%r8d, %r10d
	leal	-1(%rdi,%rdi), %edi
	setle	%r11b
	setge	%r8b
	cmpl	%ebp, %r9d
	movb	%dil, (%rbx,%r12)
	leal	1(%rdx), %edi
	leal	-1(%r11,%r11), %r11d
	movslq	%edi, %rdi
	leal	-1(%r8,%r8), %r8d
	movb	%r8b, 1978680(%rsp,%rdi)
	setge	%dil
	incl	%ecx
	movb	%r11b, (%rbx,%rsi)
	leal	3(%rdx), %esi
	leal	-1(%rdi,%rdi), %edi
	addl	$4, %edx
	movslq	%esi, %rsi
	movb	%dil, 1978680(%rsp,%rsi)
	cmpl	$16, %ecx
	jne	.L196
	incl	%eax
	cmpl	$16, %eax
	jne	.L189
	leaq	248(%rsp), %rax
	xorl	%edx, %edx
	movq	%rax, %rbp
.L199:
	movl	%edx, %ecx
	movl	%edx, %esi
	sarl	$2, %ecx
	testl	%ecx, %ecx
	setg	(%rax)
	andl	$3, %esi
	cmpl	$2, %esi
	setle	1(%rax)
	testl	%esi, %esi
	setg	2(%rax)
	cmpl	$2, %ecx
	setle	3(%rax)
	incl	%edx
	addq	$4, %rax
	cmpl	$16, %edx
	jne	.L199
	leaq	160(%rsp), %rdi
	movl	$589824, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L206
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1424, %ecx
	movq	%rax, %r9
	jmp	.L312
.L206:
	leaq	168(%rsp), %rdi
	movl	$12288, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L207
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1425, %ecx
	movq	%rax, %r9
	jmp	.L312
.L207:
	leaq	176(%rsp), %rdi
	movl	$6266880, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L208
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1426, %ecx
	movq	%rax, %r9
	jmp	.L312
.L208:
	leaq	184(%rsp), %rdi
	movl	$589824, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L209
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1427, %ecx
	movq	%rax, %r9
	jmp	.L312
.L209:
	leaq	192(%rsp), %rdi
	movl	$32768, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L210
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1428, %ecx
	movq	%rax, %r9
	jmp	.L312
.L210:
	leaq	200(%rsp), %rdi
	movl	$64, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L211
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1429, %ecx
	movq	%rax, %r9
	jmp	.L312
.L211:
	leaq	208(%rsp), %rdi
	movl	$1024, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L212
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1430, %ecx
	movq	%rax, %r9
	jmp	.L312
.L212:
	movq	200(%rsp), %rdi
	movl	$1, %ecx
	movl	$64, %edx
	movq	%rbp, %rsi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L213
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1431, %ecx
	movq	%rax, %r9
	jmp	.L312
.L213:
	movq	208(%rsp), %rdi
	movl	$1, %ecx
	movl	$1024, %edx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L214
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1433, %ecx
	movq	%rax, %r9
	jmp	.L312
.L214:
	movq	160(%rsp), %rdi
	xorl	%esi, %esi
	movl	$589824, %edx
	call	cudaMemset@PLT
	testl	%eax, %eax
	je	.L215
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1436, %ecx
	movq	%rax, %r9
	jmp	.L312
.L215:
	movq	176(%rsp), %rdi
	xorl	%esi, %esi
	movl	$6266880, %edx
	call	cudaMemset@PLT
	testl	%eax, %eax
	je	.L216
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1437, %ecx
	movq	%rax, %r9
	jmp	.L312
.L216:
	movq	184(%rsp), %rdi
	xorl	%esi, %esi
	movl	$589824, %edx
	call	cudaMemset@PLT
	testl	%eax, %eax
	je	.L217
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1438, %ecx
	movq	%rax, %r9
	jmp	.L312
.L217:
	movq	192(%rsp), %rdi
	xorl	%esi, %esi
	movl	$32768, %edx
	call	cudaMemset@PLT
	testl	%eax, %eax
	je	.L218
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1439, %ecx
	movq	%rax, %r9
	jmp	.L312
.L218:
	movb	156(%rsp), %al
	movb	%al, 67(%rsp)
.L274:
	movzbl	67(%rsp), %ebx
	movq	stderr(%rip), %rdi
	leaq	.LC21(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	movl	%ebx, %ecx
	call	__fprintf_chk@PLT
	movl	$1, %ecx
	movl	$589824, %edx
	movq	160(%rsp), %rdi
	leaq	602424(%rsp), %rsi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L219
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1444, %ecx
	movq	%rax, %r9
	jmp	.L312
.L219:
	movq	168(%rsp), %rdi
	movl	$1, %ecx
	movl	$12288, %edx
	leaq	312(%rsp), %rsi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L220
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1446, %ecx
	movq	%rax, %r9
	jmp	.L312
.L220:
	leaq	1192248(%rsp), %rbp
	movq	_ZL3BL2(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag
	movq	_ZL3BL1(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag
	movq	192(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rsi
	movl	$32768, %edx
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L221
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1450, %ecx
	movq	%rax, %r9
	jmp	.L312
.L221:
	movq	_ZL3BL1(%rip), %rax
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC22(%rip), %rdx
	movq	8(%rax), %rcx
	movq	_ZL3BL2(%rip), %rax
	movq	8(%rax), %r8
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	stderr(%rip), %rdi
	xorl	%eax, %eax
	movl	$32, %r8d
	movl	$96, %ecx
	leaq	.LC23(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movl	$134217729, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$134217731, %edi
	salq	$5, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	salq	$5, %rdi
	movq	%rdx, 232(%rsp)
	movl	$1, 240(%rsp)
	movq	%rdi, 220(%rsp)
	movl	$1, 228(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L222
	pushq	200(%rsp)
	.cfi_def_cfa_offset 8246664
	movl	%ebx, %r9d
	pushq	216(%rsp)
	.cfi_def_cfa_offset 8246672
	movq	200(%rsp), %r8
	movq	208(%rsp), %rcx
	movq	192(%rsp), %rdx
	movq	184(%rsp), %rsi
	movq	176(%rsp), %rdi
	call	_Z90__device_stub__Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_PbP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	popq	%rdi
	.cfi_def_cfa_offset 8246664
	popq	%r8
	.cfi_def_cfa_offset 8246656
.L222:
	call	cudaGetLastError@PLT
	testl	%eax, %eax
	je	.L223
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1458, %ecx
	movq	%rax, %r9
	jmp	.L312
.L223:
	leaq	1979704(%rsp), %r12
	movl	$2, %ecx
	movl	$6266880, %edx
	movq	176(%rsp), %rsi
	movq	%r12, %rdi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L224
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1460, %ecx
	movq	%rax, %r9
	jmp	.L312
.L224:
	leaq	12600(%rsp), %rbp
	movl	$2, %ecx
	movl	$589824, %edx
	movq	184(%rsp), %rsi
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	jne	.L225
	movl	152(%rsp), %eax
	movq	%rbp, 88(%rsp)
	xorl	%ebx, %ebx
	movl	%eax, 4(%rsp)
	movq	%rbp, %rax
	jmp	.L226
.L225:
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1461, %ecx
	movq	%rax, %r9
	jmp	.L312
.L227:
	incl	%ebx
.L226:
	cmpl	%ebx, 4(%rsp)
	jle	.L313
	addq	$24, %rax
	cmpb	$0, -24(%rax)
	je	.L227
	movslq	%ebx, %rbp
	movq	stderr(%rip), %rdi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	imulq	$24, %rbp, %rbp
	leaq	.LC24(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	leaq	.LC25(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	imull	$255, %ebx, %ebx
	movl	602440(%rsp,%rbp), %edx
	call	__printf_chk@PLT
	movl	$2, %edi
	xorl	%eax, %eax
	addq	%r12, %rbx
	movl	12604(%rsp,%rbp), %edx
	leaq	.LC26(%rip), %rsi
	xorl	%r12d, %r12d
	call	__printf_chk@PLT
	leaq	8246592(%rbp), %rax
	leaq	(%rsp,%rax), %rbp
.L228:
	cmpl	%r12d, -8233988(%rbp)
	jle	.L314
	movsbq	(%rbx,%r12), %rax
	leaq	_ZL8dir_char(%rip), %rdx
	movl	$2, %edi
	incq	%r12
	leaq	.LC27(%rip), %rsi
	movsbl	(%rdx,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L228
.L314:
	movl	$10, %edi
	call	putchar@PLT
	movq	160(%rsp), %rdi
	call	cudaFree@PLT
	testl	%eax, %eax
	je	.L307
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1553, %ecx
	movq	%rax, %r9
	jmp	.L312
.L313:
	xorl	%esi, %esi
	movq	%rbp, %rdx
	xorl	%eax, %eax
	movq	%rsi, 24(%rsp)
.L233:
	addq	$24, %rdx
	cmpl	%eax, 4(%rsp)
	jle	.L315
	movq	-16(%rdx), %rcx
	incl	%eax
	addq	%rcx, 24(%rsp)
	jmp	.L233
.L315:
	xorl	%ecx, %ecx
	movq	%rbp, %rdx
	xorl	%eax, %eax
	movq	%rcx, 56(%rsp)
.L235:
	addq	$24, %rdx
	cmpl	%eax, 4(%rsp)
	jle	.L316
	movslq	-8(%rdx), %rcx
	incl	%eax
	addq	%rcx, 56(%rsp)
	jmp	.L235
.L316:
	movq	24(%rsp), %rax
	movl	$3072, %ecx
	movq	%rbp, 32(%rsp)
	leaq	602424(%rsp), %r14
	cqto
	idivq	%rcx
	xorl	%edx, %edx
	movq	%rdx, 16(%rsp)
	movq	%rax, %r12
	leaq	(%rax,%rax), %rax
	movq	%rax, 128(%rsp)
	leaq	0(,%r12,4), %rax
	movq	%rax, 104(%rsp)
	leaq	0(,%r12,8), %rax
	movq	%rax, 112(%rsp)
	xorl	%eax, %eax
	movl	%eax, 52(%rsp)
	movl	%eax, 48(%rsp)
	movl	%eax, 120(%rsp)
	movl	%eax, 76(%rsp)
	movl	%eax, 72(%rsp)
	movl	%eax, 68(%rsp)
	movl	%eax, 44(%rsp)
	movl	%eax, 40(%rsp)
	leaq	1(%r12), %rax
	movq	%rax, 136(%rsp)
.L237:
	movl	40(%rsp), %ebx
	cmpl	%ebx, 4(%rsp)
	jle	.L317
	movq	32(%rsp), %rax
	movq	8(%rax), %rcx
	cmpq	%r12, %rcx
	jge	.L238
	incl	44(%rsp)
	jmp	.L239
.L238:
	movq	128(%rsp), %rax
	cmpq	%rax, %rcx
	jge	.L240
	incl	68(%rsp)
	jmp	.L239
.L240:
	movq	104(%rsp), %rax
	cmpq	%rax, %rcx
	jge	.L241
	incl	72(%rsp)
	jmp	.L239
.L241:
	movq	112(%rsp), %rax
	cmpq	%rax, %rcx
	jge	.L242
	incl	76(%rsp)
	jmp	.L239
.L242:
	movq	%r12, %rax
	salq	$4, %rax
	cmpq	%rax, %rcx
	jge	.L243
	incl	120(%rsp)
	jmp	.L239
.L243:
	movq	%r12, %rax
	salq	$5, %rax
	cmpq	%rax, %rcx
	jge	.L244
	incl	48(%rsp)
	jmp	.L239
.L244:
	incl	52(%rsp)
.L239:
	movq	%rcx, %rax
	cqto
	idivq	136(%rsp)
	incl	%eax
	movl	%eax, 80(%rsp)
	cmpq	$20, %rcx
	jle	.L245
	decl	%eax
	jle	.L245
	movl	16(%rsp), %ebx
	movl	4(%rsp), %eax
	movq	%r14, %rdi
	movl	16(%r14), %esi
	addl	%ebx, %eax
	movl	%eax, 124(%rsp)
	call	_Z10state_initPhi
	movl	$32, %edi
	movq	%rax, %rbx
	movb	20(%r14), %al
	movb	%al, 22(%rbx)
	call	_Z7pq_initm
	movq	_ZL3BL1(%rip), %rdi
	leaq	232(%rsp), %rdx
	movq	%rbx, %rsi
	movq	%rax, 8(%rsp)
	call	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	decl	%eax
	jne	.L246
	movq	232(%rsp), %rax
	movl	(%rbx), %edx
	cmpl	%edx, (%rax)
	jle	.L246
	movl	%edx, (%rax)
.L246:
	movl	24(%rbx), %edx
	movq	8(%rsp), %rdi
	xorl	%ecx, %ecx
	movq	%rbx, %rsi
	movl	$1, %r13d
	call	_Z6pq_putP6pq_tagP13state_tag_cpuii
	leaq	232(%rsp), %rax
	movq	%rax, 96(%rsp)
.L247:
	movq	8(%rsp), %rdi
	call	_Z6pq_popP6pq_tag
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.L260
	cmpl	$0, 24(%rbx)
	leal	-1(%r13), %ebp
	jne	.L248
	movl	(%rbx), %edx
	movq	8(%rsp), %rdi
	movq	%rbx, %rsi
	movl	%edx, %ecx
	call	_Z6pq_putP6pq_tagP13state_tag_cpuii
.L260:
	movl	%r13d, %ebp
	jmp	.L249
.L248:
	movq	96(%rsp), %rdx
	movq	_ZL6closed(%rip), %rdi
	movq	%rbx, %rsi
	call	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	decl	%eax
	movq	232(%rsp), %rax
	jne	.L250
	movl	(%rbx), %ecx
	cmpl	%ecx, (%rax)
	jl	.L251
.L250:
	movl	(%rbx), %edx
	xorl	%r13d, %r13d
	movl	%edx, (%rax)
	jmp	.L252
.L251:
	movq	%rbx, %rdi
	call	_Z5pfreePv
	jmp	.L253
.L320:
	movl	%r13d, %esi
	movq	%rbx, %rdi
	call	_Z13state_movableP13state_tag_cpua
	testb	%al, %al
	jne	.L318
.L256:
	incl	%r13d
	cmpl	$4, %r13d
	je	.L319
.L252:
	movb	$3, %al
	subl	%r13d, %eax
	cmpb	%al, 22(%rbx)
	jne	.L320
	jmp	.L256
.L318:
	call	_Z10state_copyP13state_tag_cpu
	movl	%r13d, %esi
	movq	%rax, %r15
	movq	%rax, %rdi
	call	_Z10state_moveP13state_tag_cpua
	incl	(%r15)
	movq	96(%rsp), %rdx
	movq	%r15, %rsi
	movq	_ZL6closed(%rip), %rdi
	call	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	decl	%eax
	movq	232(%rsp), %rax
	jne	.L257
	movl	(%r15), %ecx
	cmpl	%ecx, (%rax)
	jl	.L258
.L257:
	movl	(%r15), %ecx
	movq	8(%rsp), %rdi
	movq	%r15, %rsi
	incl	%ebp
	movl	%ecx, (%rax)
	movl	24(%r15), %edx
	addl	%ecx, %edx
	call	_Z6pq_putP6pq_tagP13state_tag_cpuii
	jmp	.L256
.L258:
	movq	%r15, %rdi
	call	_Z5pfreePv
	jmp	.L256
.L319:
	movq	%rbx, %rdi
	call	_Z5pfreePv
	cmpl	%ebp, 80(%rsp)
	jle	.L249
.L253:
	movl	%ebp, %r13d
	jmp	.L247
.L249:
	movslq	%ebp, %rax
	xorl	%ebx, %ebx
	movq	%rax, 96(%rsp)
.L261:
	cmpl	%ebx, %ebp
	jle	.L321
	movq	32(%rsp), %rax
	movl	40(%rsp), %r13d
	movq	8(%rax), %rax
	cqto
	idivq	96(%rsp)
	movq	%rax, 80(%rsp)
	testl	%ebx, %ebx
	je	.L262
	movl	124(%rsp), %eax
	leal	-1(%rax,%rbx), %r13d
.L262:
	movq	8(%rsp), %rdi
	call	_Z6pq_popP6pq_tag
	movq	_ZL3BL2(%rip), %rdi
	leaq	232(%rsp), %rdx
	movq	%rax, %rsi
	movq	%rax, %r15
	call	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	decl	%eax
	jne	.L263
	movq	232(%rsp), %rax
	movl	(%r15), %edx
	cmpl	%edx, (%rax)
	jle	.L263
	movl	%edx, (%rax)
.L263:
	movslq	%r13d, %rax
	xorl	%esi, %esi
	imulq	$24, %rax, %rax
	leaq	602424(%rsp,%rax), %rdi
.L264:
	movl	%esi, %edx
	movq	%rsi, %r8
	sarl	$2, %edx
	andl	$3, %r8d
	movslq	%edx, %rdx
	leaq	(%r15,%r8,4), %r8
	movb	4(%rdx,%r8), %dl
	movb	%dl, (%rdi,%rsi)
	incq	%rsi
	cmpq	$16, %rsi
	jne	.L264
	movzbl	21(%r15), %esi
	movzbl	20(%r15), %edx
	incl	%ebx
	movslq	80(%rsp), %r13
	leal	(%rdx,%rsi,4), %edx
	movslq	%edx, %rdx
	movb	$0, (%rdi,%rdx)
	movl	(%r15), %edx
	movl	%edx, 16(%rdi)
	movb	22(%r15), %dl
	movq	%r13, 12608(%rsp,%rax)
	movb	%dl, 20(%rdi)
	jmp	.L261
.L321:
	movq	8(%rsp), %rdi
	call	_Z7pq_finiP6pq_tag
	cmpl	$1, %ebp
	adcl	$-1, %ebp
	movslq	%ebp, %rbp
	addq	%rbp, 16(%rsp)
.L245:
	incl	40(%rsp)
	addq	$24, %r14
	addq	$24, 32(%rsp)
	jmp	.L237
.L317:
	movq	24(%rsp), %rcx
	movq	stderr(%rip), %rdi
	leaq	.LC28(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movq	%r12, %rcx
	movl	$2, %esi
	xorl	%eax, %eax
	movq	stderr(%rip), %rdi
	leaq	.LC29(%rip), %rdx
	call	__fprintf_chk@PLT
	movl	52(%rsp), %eax
	movl	$2, %esi
	movq	stderr(%rip), %rdi
	leaq	.LC30(%rip), %rdx
	pushq	%rax
	.cfi_def_cfa_offset 8246664
	movl	56(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 8246672
	movl	136(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 8246680
	movl	100(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 8246688
	movl	104(%rsp), %r9d
	xorl	%eax, %eax
	movl	100(%rsp), %r8d
	movl	76(%rsp), %ecx
	call	__fprintf_chk@PLT
	movq	88(%rsp), %rcx
	addq	$32, %rsp
	.cfi_def_cfa_offset 8246656
	xorl	%eax, %eax
	movq	stderr(%rip), %rdi
	leaq	.LC31(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movslq	4(%rsp), %rax
	movq	16(%rsp), %rbx
	movq	stderr(%rip), %rdi
	addq	%rbx, %rax
	cmpq	$24576, %rax
	jle	.L268
	leaq	.LC32(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	abort@PLT
.L268:
	movl	16(%rsp), %eax
	movl	4(%rsp), %ebx
	movl	$2, %esi
	leaq	.LC33(%rip), %rdx
	addl	%eax, %ebx
	xorl	%eax, %eax
	movl	%ebx, %ecx
	movl	%ebx, 152(%rsp)
	call	__fprintf_chk@PLT
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	xorl	%eax, %eax
.L269:
	cmpl	%edx, %ebx
	jle	.L322
	movq	88(%rsp), %rsi
	addl	8(%rsi), %ecx
	movslq	%ecx, %rsi
	cmpq	%r12, %rsi
	jl	.L270
	movslq	%eax, %rcx
	incl	%eax
	movl	%edx, 312(%rsp,%rcx,4)
	xorl	%ecx, %ecx
.L270:
	addq	$24, 88(%rsp)
	incl	%edx
	jmp	.L269
.L322:
	cltq
.L272:
	cmpl	$3071, %eax
	jg	.L323
	movl	%ebx, 312(%rsp,%rax,4)
	incq	%rax
	jmp	.L272
.L323:
	addb	$2, 67(%rsp)
	jmp	.L274
.L307:
	movq	168(%rsp), %rdi
	call	cudaFree@PLT
	testl	%eax, %eax
	je	.L275
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1554, %ecx
	movq	%rax, %r9
	jmp	.L312
.L275:
	movq	176(%rsp), %rdi
	call	cudaFree@PLT
	testl	%eax, %eax
	je	.L276
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1555, %ecx
	movq	%rax, %r9
	jmp	.L312
.L276:
	movq	184(%rsp), %rdi
	call	cudaFree@PLT
	testl	%eax, %eax
	je	.L277
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1556, %ecx
	movq	%rax, %r9
	jmp	.L312
.L277:
	movq	200(%rsp), %rdi
	call	cudaFree@PLT
	testl	%eax, %eax
	je	.L278
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1557, %ecx
	movq	%rax, %r9
	jmp	.L312
.L278:
	movq	208(%rsp), %rdi
	call	cudaFree@PLT
	testl	%eax, %eax
	je	.L279
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1558, %ecx
	movq	%rax, %r9
	jmp	.L312
.L279:
	call	cudaDeviceReset@PLT
	testl	%eax, %eax
	je	.L190
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	cudaGetErrorString@PLT
	movl	4(%rsp), %r8d
	movl	$1559, %ecx
	movq	%rax, %r9
.L312:
	leaq	.LC19(%rip), %rdx
	leaq	.LC20(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L309
.L190:
	movq	8246584(%rsp), %rax
	subq	%fs:40, %rax
	je	.L282
	call	__stack_chk_fail@PLT
.L282:
	addq	$8246600, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2095:
	.size	main, .-main
	.section	.rodata.str1.1
.LC34:
	.string	"_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb"
.LC35:
	.string	"assert_direction2"
.LC36:
	.string	"assert_direction"
.LC37:
	.string	"pos_diff_table"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2123:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC34(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC35(%rip), %rdx
	movl	$1, %r9d
	leaq	_ZL17assert_direction2(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC36(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$1, %r9d
	leaq	_ZL16assert_direction(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC37(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$16, %r9d
	movq	%rdx, %rcx
	leaq	_ZL14pos_diff_table(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r8
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2123:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata
	.type	_ZL8dir_char, @object
	.size	_ZL8dir_char, 4
_ZL8dir_char:
	.ascii	"URLD"
	.local	_ZL3BL2
	.comm	_ZL3BL2,8,8
	.local	_ZL3BL1
	.comm	_ZL3BL1,8,8
	.local	_ZL6closed
	.comm	_ZL6closed,8,8
	.align 32
	.type	_ZL12h_diff_table, @object
	.size	_ZL12h_diff_table, 4096
_ZL12h_diff_table:
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	-1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.long	1
	.local	_ZL6from_y
	.comm	_ZL6from_y,16,16
	.local	_ZL6from_x
	.comm	_ZL6from_x,16,16
	.align 16
	.type	_ZL14pos_diff_table, @object
	.size	_ZL14pos_diff_table, 16
_ZL14pos_diff_table:
	.long	-4
	.long	1
	.long	-1
	.long	4
	.local	_ZL16assert_direction
	.comm	_ZL16assert_direction,1,1
	.local	_ZL17assert_direction2
	.comm	_ZL17assert_direction2,1,1
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <stdbool.h>

#define BLOCK_DIM 32
#define N_BLOCKS (48 * 2)
// bug?? #define N_BLOCKS (48 * 4)
#define N_WORKERS (N_BLOCKS * BLOCK_DIM)
#define N_INIT_DISTRIBUTION (N_WORKERS * 4)
#define N_INPUTS (N_WORKERS * 8)
#define PLAN_LEN_MAX 255
#define BLACKLIST_BITS 10

#define STATE_WIDTH 4
#define STATE_N (STATE_WIDTH * STATE_WIDTH)

typedef unsigned char uchar;
typedef signed char   Direction;
#define dir_reverse(dir) ((Direction)(3 - (dir)))
#define DIR_N 4
#define DIR_FIRST 0
#define DIR_UP 0
#define DIR_RIGHT 1
#define DIR_LEFT 2
#define DIR_DOWN 3

/* stack implementation */

__device__ __shared__ static struct dir_stack_tag
{
    uchar i, j;
    int   init_depth;
    uchar buf[PLAN_LEN_MAX];
} stack[BLOCK_DIM];

#define STACK (stack[threadIdx.x])

typedef struct search_stat_tag
{
    bool      solved;
    int       len;
    long long nodes_expanded;
    int nodes_pruned;
} search_stat;
typedef struct input_tag
{
    uchar     tiles[STATE_N];
    int       init_depth;
    Direction parent_dir;
} Input;

__host__ static inline long long
korf_hash(uchar tiles[])
{
	long long  h = tiles[0];
	for (int i = 1; i < STATE_N; ++i)
		h += h*3 + tiles[i];
	return h;
}
__device__ static inline long long
korf_hash_dev(uchar tiles[])
{
	long long h = tiles[0];
	for (long long i = 1; i < STATE_N; ++i)
		h += h*3 + tiles[i];
	return h;
}
typedef struct blacklist_entry_tag
{
	uchar tiles[STATE_N];
	long long hash;
	int g_value;
} BlackListEntry;
__shared__ BlackListEntry blacklist_dev[1 << BLACKLIST_BITS];

__device__ static inline void
stack_init(Input input)
{
    STACK.i          = 0;
	STACK.j          = 0;
    STACK.init_depth = input.init_depth;
}

__device__ static inline void
stack_put(Direction dir)
{
    STACK.buf[STACK.i] = dir;
    ++STACK.i;
}
__device__ static inline bool
stack_is_empty(void)
{
    return STACK.i == STACK.j;
}
__device__ static inline Direction
stack_pop(void)
{
    --STACK.i;
    return STACK.buf[STACK.i];
}
__device__ static inline Direction
stack_peak(void)
{
    return STACK.buf[STACK.i - 1];
}

/* state implementation */

static char assert_state_width_is_four[STATE_WIDTH == 4 ? 1 : -1];
#define POS_X(pos) ((pos) &3)
#define POS_Y(pos) ((pos) >> 2)

/*
 * goal: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
 */

__device__ __shared__ static struct state_tag
{
    uchar tile[STATE_N];
    uchar empty;
    uchar h_value; /* ub of h_value is 6*16 */
} state[BLOCK_DIM];

#define STATE_TILE(i) (state[threadIdx.x].tile[(i)])
#define STATE_EMPTY (state[threadIdx.x].empty)
#define STATE_HVALUE (state[threadIdx.x].h_value)
#define distance(i, j) ((i) > (j) ? (i) - (j) : (j) - (i))

#define H_DIFF(opponent, empty, empty_dir)                                     \
    h_diff_table_shared[opponent][empty][empty_dir]
__device__ __shared__ static signed char h_diff_table_shared[STATE_N][STATE_N]
                                                            [DIR_N];

__device__ static void
state_init_hvalue(void)
{
    uchar from_x[STATE_N], from_y[STATE_N];

    STATE_HVALUE = 0;

    for (int i = 0; i < STATE_N; ++i)
    {
        from_x[STATE_TILE(i)] = POS_X(i);
        from_y[STATE_TILE(i)] = POS_Y(i);
    }
    for (int i = 1; i < STATE_N; ++i)
    {
        STATE_HVALUE += distance(from_x[i], POS_X(i));
        STATE_HVALUE += distance(from_y[i], POS_Y(i));
    }
}

__device__ static void
state_tile_fill(Input input)
{
    for (int i = 0; i < STATE_N; ++i)
    {
        if (input.tiles[i] == 0)
            STATE_EMPTY = i;
        STATE_TILE(i)   = input.tiles[i];
    }
}

__device__ static inline bool
state_is_goal(void)
{
    return STATE_HVALUE == 0;
}

__device__ static char assert_direction2
    [DIR_UP == 0 && DIR_RIGHT == 1 && DIR_LEFT == 2 && DIR_DOWN == 3 ? 1 : -1];
__device__ __shared__ static bool movable_table_shared[STATE_N][DIR_N];

__device__ static inline bool
state_movable(Direction dir)
{
    return movable_table_shared[STATE_EMPTY][dir];
}

__device__ static char assert_direction
    [DIR_UP == 0 && DIR_RIGHT == 1 && DIR_LEFT == 2 && DIR_DOWN == 3 ? 1 : -1];
__device__ __constant__ const static int pos_diff_table[DIR_N] = {
    -STATE_WIDTH, 1, -1, +STATE_WIDTH};

__device__ static inline bool
state_move_with_limit(Direction dir, unsigned int f_limit)
{
    int new_empty   = STATE_EMPTY + pos_diff_table[dir];
    int opponent    = STATE_TILE(new_empty);
    int new_h_value = STATE_HVALUE + H_DIFF(opponent, new_empty, dir);

    if (STACK.i + STACK.init_depth + 1 + new_h_value > f_limit)
        return false;

    STATE_HVALUE            = new_h_value;
    STATE_TILE(STATE_EMPTY) = opponent;
    STATE_EMPTY             = new_empty;

    return true;
}

__device__ static inline void
state_move(Direction dir)
{
    int new_empty = STATE_EMPTY + pos_diff_table[dir];
    int opponent  = STATE_TILE(new_empty);

    STATE_HVALUE += H_DIFF(opponent, new_empty, dir);
    STATE_TILE(STATE_EMPTY) = opponent;
    STATE_EMPTY             = new_empty;
}

__device__ static inline bool
blacklist_query(int *g_value)
{
	long long hash = korf_hash_dev(state[threadIdx.x].tile);
	BlackListEntry e = blacklist_dev[hash & ((1u<<BLACKLIST_BITS) - 1)];
	if (e.hash != hash)
		return false;
	for (int i = 0; i < STATE_N; ++i)
		if (e.tiles[i] != STATE_TILE(i))
			return false;
	return true;
}

/*
 * solver implementation
 */

__device__ static void
idas_internal(int f_limit, Input *input, int *input_ends, search_stat *stat)
{
    int       tid            = threadIdx.x;
    int       bid            = blockIdx.x;
    int       id             = tid + bid * blockDim.x;

    for (int i = id == 0 ? 0 : input_ends[id - 1];
         i < input_ends[id]; ++i)
    {
		long long nodes_expanded = 0;
		int nodes_pruned = 0;
		uchar     dir            = 0;
		int blacklist_g;
		Input this_input = input[i];
        stack_init(this_input);
        state_tile_fill(this_input);
        state_init_hvalue();

		for (;;)
		{
			if (state_is_goal())
				asm("trap;"); /* solution found */
			/* if continue search until solution found, just return true */

			if (((stack_is_empty() && dir_reverse(dir) != this_input.parent_dir) ||
						stack_peak() != dir_reverse(dir)) &&
					state_movable(dir))
			{
				++nodes_expanded;
				/* sometimes check idle here */
				/* and load balance if needed */

				if (state_move_with_limit(dir, f_limit))
				{
					if (!(blacklist_query(&blacklist_g) &&
							blacklist_g <= this_input.init_depth + STACK.i))
					{
						stack_put(dir);
						dir = 0;
						continue;
					}
					else
						++nodes_pruned;
				}
			}

			while (++dir == DIR_N)
			{
				if (stack_is_empty())
					goto END_THIS_NODE;

				dir = stack_pop();
				state_move(dir_reverse(dir));
			}
		}

END_THIS_NODE:
        stat[i].nodes_expanded = nodes_expanded;
        stat[i].nodes_pruned = nodes_pruned;

		/* if my own works have done, get other's work here */

		/* if every work finished, then return*/
    }
}

__global__ void
idas_kernel(Input *input, int *input_ends, signed char *plan,
		BlackListEntry *blacklist, search_stat *stat,
            int f_limit, signed char *h_diff_table, bool *movable_table)
{
    int       tid            = threadIdx.x;

    for (int dir = 0; dir < DIR_N; ++dir)
        for (int i = tid; i < STATE_N; i += blockDim.x)
            if (i < STATE_N)
                movable_table_shared[i][dir] = movable_table[i * DIR_N + dir];
    for (int i = 0; i < STATE_N * DIR_N; ++i)
        for (int j = tid; j < STATE_N; j += blockDim.x)
            if (j < STATE_N)
                h_diff_table_shared[j][i / DIR_N][i % DIR_N] =
                    h_diff_table[j * STATE_N * DIR_N + i];
	for (int i = tid; i < 1<<BLACKLIST_BITS; i += blockDim.x)
		blacklist_dev[i] = blacklist[i];

    __syncthreads();

	idas_internal(f_limit, input, input_ends, stat);
}

/* host library implementation */

#include <errno.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>

#ifndef UNABLE_LOG
#define elog(...) fprintf(stderr, __VA_ARGS__)
#else
#define elog(...) ;
#endif

void *
palloc(size_t size)
{
    void *ptr = malloc(size);
    if (!ptr)
        elog("malloc failed\n");

    return ptr;
}

void *
repalloc(void *old_ptr, size_t new_size)
{
    void *ptr = realloc(old_ptr, new_size);
    if (!ptr)
        elog("realloc failed\n");

    return ptr;
}

void
pfree(void *ptr)
{
    if (!ptr)
        elog("empty ptr\n");
    free(ptr);
}

#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

typedef unsigned char idx_t;
/*
 *  [0,0] [1,0] [2,0] [3,0]
 *  [0,1] [1,1] [2,1] [3,1]
 *  [0,2] [1,2] [2,2] [3,2]
 *  [0,3] [1,3] [2,3] [3,3]
 */

/*
 * goal state is
 * [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
 */

typedef struct state_tag_cpu
{
    int       depth; /* XXX: needed? */
    uchar     pos[STATE_WIDTH][STATE_WIDTH];
    idx_t     i, j; /* pos of empty */
    Direction parent_dir;
    int       h_value;
} * State;

#define v(state, i, j) ((state)->pos[i][j])
#define ev(state) (v(state, state->i, state->j))
#define lv(state) (v(state, state->i - 1, state->j))
#define dv(state) (v(state, state->i, state->j + 1))
#define rv(state) (v(state, state->i + 1, state->j))
#define uv(state) (v(state, state->i, state->j - 1))

static uchar from_x[STATE_WIDTH * STATE_WIDTH],
    from_y[STATE_WIDTH * STATE_WIDTH];

static inline void
fill_from_xy(State from)
{
    for (idx_t x = 0; x < STATE_WIDTH; ++x)
        for (idx_t y = 0; y < STATE_WIDTH; ++y)
        {
            from_x[v(from, x, y)] = x;
            from_y[v(from, x, y)] = y;
        }
}

static char assert_state_width_is_four2[STATE_WIDTH == 4 ? 1 : -1];
static inline int
heuristic_manhattan_distance(State from)
{
    int h_value = 0;

    fill_from_xy(from);

    for (idx_t i = 1; i < STATE_N; ++i)
    {
        h_value += distance(from_x[i], i & 3);
        h_value += distance(from_y[i], i >> 2);
    }

    return h_value;
}

bool
state_is_goal(State state)
{
    return state->h_value == 0;
}

static inline State
state_alloc(void)
{
    return (State) palloc(sizeof(struct state_tag_cpu));
}

static inline void
state_free(State state)
{
    pfree(state);
}

State
state_init(uchar v_list[STATE_WIDTH * STATE_WIDTH], int init_depth)
{
    State state = state_alloc();
    int   cnt   = 0;

    state->depth      = init_depth;
    state->parent_dir = (Direction) -1;

    for (idx_t j = 0; j < STATE_WIDTH; ++j)
        for (idx_t i = 0; i < STATE_WIDTH; ++i)
        {
            if (v_list[cnt] == 0)
            {
                state->i = i;
                state->j = j;
            }
            v(state, i, j) = v_list[cnt++];
        }

    state->h_value = heuristic_manhattan_distance(state);

    return state;
}

void
state_fini(State state)
{
    state_free(state);
}

State
state_copy(State src)
{
    State dst = state_alloc();

    memcpy(dst, src, sizeof(*src));

    return dst;
}

static inline bool
state_left_movable(State state)
{
    return state->i != 0;
}
static inline bool
state_down_movable(State state)
{
    return state->j != STATE_WIDTH - 1;
}
static inline bool
state_right_movable(State state)
{
    return state->i != STATE_WIDTH - 1;
}
static inline bool
state_up_movable(State state)
{
    return state->j != 0;
}

bool
state_movable(State state, Direction dir)
{
    return (dir != DIR_LEFT || state_left_movable(state)) &&
           (dir != DIR_DOWN || state_down_movable(state)) &&
           (dir != DIR_RIGHT || state_right_movable(state)) &&
           (dir != DIR_UP || state_up_movable(state));
}

#define h_diff(who, from_i, from_j, dir)                                       \
    (h_diff_table[((who) << 6) + ((from_j) << 4) + ((from_i) << 2) + (dir)])
static int h_diff_table[STATE_N * STATE_N * DIR_N] = {
    1,  1,  1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,
    1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,
    -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1,
    1,  -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,
    1,  1,  -1, 1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1,
    1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, -1,
    1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,  1,  1,
    -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  -1, -1, 1,  1,  -1, -1, 1,  1,
    -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,
    1,  -1, 1,  -1, 1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,
    -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1,  -1,
    -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, -1, 1,  1,
    -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, -1, 1,  1,  -1, -1, 1,
    1,  -1, -1, 1,  1,  -1, 1,  1,  1,  1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,
    -1, -1, 1,  1,  -1, -1, 1,  1,  1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,
    1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,
    -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,
    -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  -1, 1,  1,  1,  1,
    1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1,
    1,  -1, 1,  -1, 1,  -1, 1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,
    -1, 1,  -1, 1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1,
    -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  -1, -1,
    1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, -1, 1,  1,  -1,
    -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,  -1, 1,  -1, 1,  -1, 1,  -1,
    1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,
    1,  1,  1,  1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,
    1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  1,
    1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  1,  -1,
    1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  1,  1,  1,  1,  -1,
    1,  1,  1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,
    -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,
    1,  -1, -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1,
    1,  -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  -1, -1, 1,
    1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  -1, 1,  -1, 1,  -1,
    1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,
    1,  1,  -1, 1,  1,  -1, -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1,
    1,  1,  -1, 1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, 1,  1,  1,  -1, 1,  -1,
    1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1,
    1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  1,  1,
    -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,
    -1, -1, 1,  1,  -1, 1,  1,  1,  1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1,
    -1, 1,  1,  -1, -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,
    -1, -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,
    1,  1,  1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  -1, 1,  -1,
    1,  1,  1,  -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  -1, 1,  -1, 1,  1,  1,
    -1, 1,  1,  -1, -1, 1,  1,  -1, -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,
    -1, -1, 1,  1,  -1, -1, 1,  -1, 1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  1,
    1,  -1, 1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1,
    1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  -1, 1,
    -1, 1,  -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  -1, -1, 1,  -1, 1,  1,  1,  -1,
    1,  1,  1,  1,  1,  1,  1,  1,  -1, 1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,
    -1, 1,  -1, 1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1,
    1,  1,  1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  -1, 1,  1,  1,
    -1, 1,  -1, 1,  1,  1,  -1, 1,  1,  1,  -1, 1,  1,  1,  1,  1,  1};

void
state_move(State state, Direction dir)
{
    idx_t who;
    assert(state_movable(state, dir));

    switch (dir)
    {
    case DIR_LEFT:
        who = ev(state) = lv(state);
        state->i--;
        break;
    case DIR_DOWN:
        who = ev(state) = dv(state);
        state->j++;
        break;
    case DIR_RIGHT:
        who = ev(state) = rv(state);
        state->i++;
        break;
    case DIR_UP:
        who = ev(state) = uv(state);
        state->j--;
        break;
    default:
        elog("unexpected direction");
        assert(false);
    }

    state->h_value =
        state->h_value + h_diff(who, state->i, state->j, dir_reverse(dir));
    state->parent_dir = dir;
}

bool
state_pos_equal(State s1, State s2)
{
    for (idx_t i = 0; i < STATE_WIDTH; ++i)
        for (idx_t j = 0; j < STATE_WIDTH; ++j)
            if (v(s1, i, j) != v(s2, i, j))
                return false;

    return true;
}

size_t
state_hash(State state)
{
    /* FIXME: for A* */
    size_t hash_value = 0;
    for (idx_t i = 0; i < STATE_WIDTH; ++i)
        for (idx_t j = 0; j < STATE_WIDTH; ++j)
            hash_value ^= (v(state, i, j) << ((i * 3 + j) << 2));
    return hash_value;
}
int
state_get_hvalue(State state)
{
    return state->h_value;
}

int
state_get_depth(State state)
{
    return state->depth;
}

#include <stddef.h>
#include <stdint.h>
#include <string.h>
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t) -1)
#endif

typedef enum {
    HT_SUCCESS = 0,
    HT_FAILED_FOUND,
    HT_FAILED_NOT_FOUND,
} HTStatus;

/* XXX: hash function for State should be surveyed */
inline static size_t
hashfunc(State key)
{
    return state_hash(key);
}

typedef struct ht_entry_tag *HTEntry;
struct ht_entry_tag
{
    HTEntry next;
    State   key;
    int     value;
};

static HTEntry
ht_entry_init(State key)
{
    HTEntry entry = (HTEntry) palloc(sizeof(*entry));

    entry->key  = state_copy(key);
    entry->next = NULL;

    return entry;
}

static void
ht_entry_fini(HTEntry entry)
{
    pfree(entry);
}

typedef struct ht_tag
{
    size_t   n_bins;
    size_t   n_elems;
    HTEntry *bin;
} * HT;

static bool
ht_rehash_required(HT ht)
{
    return ht->n_bins <= ht->n_elems; /* TODO: local policy is also needed */
}

static size_t
calc_n_bins(size_t required)
{
    /* NOTE: n_bins is used for mask and hence it should be pow of 2, fon now */
    size_t size = 1;
    assert(required > 0);

    while (required > size)
        size <<= 1;

    return size;
}

HT
ht_init(size_t init_size_hint)
{
    size_t n_bins = calc_n_bins(init_size_hint);
    HT     ht     = (HT) palloc(sizeof(*ht));

    ht->n_bins  = n_bins;
    ht->n_elems = 0;

    assert(sizeof(*ht->bin) <= SIZE_MAX / n_bins);
    ht->bin = (HTEntry *) palloc(sizeof(*ht->bin) * n_bins);
    memset(ht->bin, 0, sizeof(*ht->bin) * n_bins);

    return ht;
}

static void
ht_rehash(HT ht)
{
    HTEntry *new_bin;
    size_t   new_size = ht->n_bins << 1;

    assert(ht->n_bins<SIZE_MAX>> 1);

    new_bin = (HTEntry *) palloc(sizeof(*new_bin) * new_size);
    memset(new_bin, 0, sizeof(*new_bin) * new_size);

    for (size_t i = 0; i < ht->n_bins; ++i)
    {
        HTEntry entry = ht->bin[i];

        while (entry)
        {
            HTEntry next = entry->next;

            size_t idx   = hashfunc(entry->key) & (new_size - 1);
            entry->next  = new_bin[idx];
            new_bin[idx] = entry;

            entry = next;
        }
    }

    pfree(ht->bin);
    ht->n_bins = new_size;
    ht->bin    = new_bin;
}

void
ht_fini(HT ht)
{
    for (size_t i = 0; i < ht->n_bins; ++i)
    {
        HTEntry entry = ht->bin[i];
        while (entry)
        {
            HTEntry next = entry->next;
            state_fini(entry->key);
            ht_entry_fini(entry);
            entry = next;
        }
    }

    pfree(ht->bin);
    pfree(ht);
}

HTStatus
ht_insert(HT ht, State key, int **value)
{
    size_t  i;
    HTEntry entry, new_entry;

    if (ht_rehash_required(ht))
        ht_rehash(ht);

    i     = hashfunc(key) & (ht->n_bins - 1);
    entry = ht->bin[i];

    while (entry)
    {
        if (state_pos_equal(key, entry->key))
        {
            *value = &entry->value;
            return HT_FAILED_FOUND;
        }

        entry = entry->next;
    }

    new_entry = ht_entry_init(key);

    new_entry->next = ht->bin[i];
    ht->bin[i]      = new_entry;
    *value          = &new_entry->value;

    assert(ht->n_elems < SIZE_MAX);
    ht->n_elems++;

    return HT_SUCCESS;
}

/*
 * Priority Queue implementation
 */

#include <assert.h>
#include <stdint.h>

typedef struct pq_entry_tag
{
    State state;
    int   f, g;
} PQEntryData;
typedef PQEntryData *PQEntry;

/* tiebreaking is done comparing g value */
static inline bool
pq_entry_higher_priority(PQEntry e1, PQEntry e2)
{
    return e1->f < e2->f || (e1->f == e2->f && e1->g >= e2->g);
}

/*
 * NOTE:
 * This priority queue is implemented doubly reallocated array.
 * It will only extend and will not shrink, for now.
 * It may be improved by using array of layers of iteratively widened array
 */
typedef struct pq_tag
{
    size_t       n_elems;
    size_t       capa;
    PQEntryData *array;
} * PQ;

static inline size_t
calc_init_capa(size_t capa_hint)
{
    size_t capa = 1;
    assert(capa_hint > 0);

    while (capa < capa_hint)
        capa <<= 1;
    return capa - 1;
}

PQ
pq_init(size_t init_capa_hint)
{
    PQ pq = (PQ) palloc(sizeof(*pq));

    pq->n_elems = 0;
    pq->capa    = calc_init_capa(init_capa_hint);

    assert(pq->capa <= SIZE_MAX / sizeof(PQEntryData));
    pq->array = (PQEntryData *) palloc(sizeof(PQEntryData) * pq->capa);

    return pq;
}

void
pq_fini(PQ pq)
{
    for (size_t i = 0; i < pq->n_elems; ++i)
        state_fini(pq->array[i].state);

    pfree(pq->array);
    pfree(pq);
}

static inline bool
pq_is_full(PQ pq)
{
    assert(pq->n_elems <= pq->capa);
    return pq->n_elems == pq->capa;
}

static inline void
pq_extend(PQ pq)
{
    pq->capa = (pq->capa << 1) + 1;
    assert(pq->capa <= SIZE_MAX / sizeof(PQEntryData));

    pq->array =
        (PQEntryData *) repalloc(pq->array, sizeof(PQEntryData) * pq->capa);
}

static inline void
pq_swap_entry(PQ pq, size_t i, size_t j)
{
    PQEntryData tmp = pq->array[i];
    pq->array[i]    = pq->array[j];
    pq->array[j]    = tmp;
}

static inline size_t
pq_up(size_t i)
{
    /* NOTE: By using 1-origin, it may be written more simply, i >> 1 */
    return (i - 1) >> 1;
}

static inline size_t
pq_left(size_t i)
{
    return (i << 1) + 1;
}

static void
heapify_up(PQ pq)
{
    for (size_t i = pq->n_elems; i > 0;)
    {
        size_t ui = pq_up(i);
        assert(i > 0);
        if (!pq_entry_higher_priority(&pq->array[i], &pq->array[ui]))
            break;

        pq_swap_entry(pq, i, ui);
        i = ui;
    }
}

void
pq_put(PQ pq, State state, int f, int g)
{
    if (pq_is_full(pq))
        pq_extend(pq);

    pq->array[pq->n_elems].state = state_copy(state);
    pq->array[pq->n_elems].f     = f; /* this may be abundant */
    pq->array[pq->n_elems].g     = g;
    heapify_up(pq);
    ++pq->n_elems;
}

static void
heapify_down(PQ pq)
{
    size_t sentinel = pq->n_elems;

    for (size_t i = 0;;)
    {
        size_t ri, li = pq_left(i);
        if (li >= sentinel)
            break;

        ri = li + 1;
        if (ri >= sentinel)
        {
            if (pq_entry_higher_priority(&pq->array[li], &pq->array[i]))
                pq_swap_entry(pq, i, li);
            /* Reached the bottom */
            break;
        }

        /* NOTE: If p(ri) == p(li), it may be good to go right
         * since the filling order is left-first */
        if (pq_entry_higher_priority(&pq->array[li], &pq->array[ri]))
        {
            if (!pq_entry_higher_priority(&pq->array[li], &pq->array[i]))
                break;

            pq_swap_entry(pq, i, li);
            i = li;
        }
        else
        {
            if (!pq_entry_higher_priority(&pq->array[ri], &pq->array[i]))
                break;

            pq_swap_entry(pq, i, ri);
            i = ri;
        }
    }
}

State
pq_pop(PQ pq)
{
    State ret_state;

    if (pq->n_elems == 0)
        return NULL;

    ret_state = pq->array[0].state;

    --pq->n_elems;
    pq->array[0] = pq->array[pq->n_elems];
    heapify_down(pq);

    return ret_state;
}

void
pq_dump(PQ pq)
{
    elog("%s: n_elems=%zu, capa=%zu\n", __func__, pq->n_elems, pq->capa);
    for (size_t i = 0, cr_required = 1; i < pq->n_elems; i++)
    {
        if (i == cr_required)
        {
            elog("\n");
            cr_required = (cr_required << 1) + 1;
        }
        elog("%d,", pq->array[i].f);
        elog("%d ", pq->array[i].g);
    }
    elog("\n");
}

static HT closed, BL1, BL2;

bool
distribute_astar(State init_state, Input input[], int input_ends[], int distr_n,
                 int *cnt_inputs, int *min_fvalue)
{
    int      cnt = 0;
    State    state;
    PQ       q = pq_init(distr_n + 10);
    HTStatus ht_status;
    int *    ht_value;
    bool     solved = false;
    closed          = ht_init(10000);
    BL1      = ht_init(1000);
    BL2      = ht_init(1000);

    ht_status = ht_insert(closed, init_state, &ht_value);
    *ht_value = 0;
    pq_put(q, state_copy(init_state), state_get_hvalue(init_state), 0);
    ++cnt;

    while ((state = pq_pop(q)))
    {
        --cnt;
        if (state_is_goal(state))
        {
            solved = true;
            break;
        }

        ht_status = ht_insert(closed, state, &ht_value);
        if (ht_status == HT_FAILED_FOUND && *ht_value < state_get_depth(state))
        {
            state_fini(state);
            continue;
        }
        else
            *ht_value = state_get_depth(state);

        for (int dir = 0; dir < DIR_N; ++dir)
        {
            if (state->parent_dir != dir_reverse(dir) &&
                state_movable(state, (Direction) dir))
            {
                State next_state = state_copy(state);
                state_move(next_state, (Direction) dir);
                next_state->depth++;

                ht_status = ht_insert(closed, next_state, &ht_value);
                if (ht_status == HT_FAILED_FOUND &&
                    *ht_value <= state_get_depth(next_state))
                    state_fini(next_state);
                else
                {
                    ++cnt;
                    *ht_value = state_get_depth(next_state);
                    pq_put(q, next_state,
                           *ht_value + state_get_hvalue(next_state), *ht_value);
                }
            }
        }

        state_fini(state);

        if (cnt >= distr_n)
            break;
    }

    *cnt_inputs = cnt;
    if (!solved)
    {
        int minf = INT_MAX;
        for (int id = 0; id < cnt; ++id)
        {
            State state = pq_pop(q);
            assert(state);

            for (int i = 0; i < STATE_N; ++i)
                input[id].tiles[i] = state->pos[i%STATE_WIDTH][i/STATE_WIDTH];
            input[id].tiles[state->i + (state->j * STATE_WIDTH)] = 0;

            input[id].init_depth = state_get_depth(state);
            input[id].parent_dir = state->parent_dir;
            if (minf > state_get_depth(state) + state_get_hvalue(state))
                minf = state_get_depth(state) + state_get_hvalue(state);
        }
        *min_fvalue = minf;

        printf("distr_n=%d, n_worers=%d, cnt=%d\n", distr_n, N_WORKERS, cnt);
        for (int id               = 0; id < N_WORKERS; ++id)
            input_ends[id]        = (distr_n / N_WORKERS) * (id + 1) - 1;
        input_ends[N_WORKERS - 1] = cnt;
    }

    pq_fini(q);

    return solved;
}

static int
input_devide(Input input[], search_stat stat[], int i, int devide_n, int tail)
{
    int   cnt = 0;
    int * ht_value;
    State state       = state_init(input[i].tiles, input[i].init_depth);
    state->parent_dir = input[i].parent_dir;
    PQ       pq       = pq_init(32);
    HTStatus ht_status = ht_insert(BL1, state, &ht_value);

	if (ht_status == HT_FAILED_FOUND && *ht_value > state_get_depth(state))
		*ht_value = state_get_depth(state);

    pq_put(pq, state, state_get_hvalue(state), 0);
    ++cnt;

    while ((state = pq_pop(pq)))
    {
        --cnt;
        if (state_is_goal(state))
        {
            /* It may not be optimal goal */
            pq_put(pq, state, state_get_depth(state) + state_get_hvalue(state),
                   state_get_depth(state));
            ++cnt;
            break;
        }

        ht_status = ht_insert(closed, state, &ht_value);
        if (ht_status == HT_FAILED_FOUND && *ht_value < state_get_depth(state))
        {
            state_fini(state);
            continue;
        }
        else
            *ht_value = state_get_depth(state);

        for (int dir = 0; dir < DIR_N; ++dir)
        {
            if (state->parent_dir != dir_reverse(dir) &&
                state_movable(state, (Direction) dir))
            {
                State next_state = state_copy(state);
                state_move(next_state, (Direction) dir);
                next_state->depth++;

                ht_status = ht_insert(closed, next_state, &ht_value);
                if (ht_status == HT_FAILED_FOUND &&
                    *ht_value < state_get_depth(next_state))
                    state_fini(next_state);
                else
                {
                    ++cnt;
                    *ht_value = state_get_depth(next_state);
                    pq_put(pq, next_state,
                           *ht_value + state_get_hvalue(next_state), *ht_value);
                }
            }
        }

        state_fini(state);

        if (cnt >= devide_n)
            break;
    }

    for (int id = 0; id < cnt; ++id)
    {
        int   estimation_after_devision = stat[i].nodes_expanded / cnt;
        int   ofs                       = id == 0 ? i : tail - 1 + id;
        State state                     = pq_pop(pq);
        assert(state);

		ht_status = ht_insert(BL2, state, &ht_value);
		if (ht_status == HT_FAILED_FOUND && *ht_value > state_get_depth(state))
			*ht_value = state_get_depth(state);

        for (int j              = 0; j < STATE_N; ++j)
            input[ofs].tiles[j] = state->pos[j%STATE_WIDTH][j/STATE_WIDTH];
        input[ofs].tiles[state->i + (state->j * STATE_WIDTH)] = 0;

        input[ofs].init_depth = state_get_depth(state);
        input[ofs].parent_dir = state->parent_dir;

        stat[ofs].nodes_expanded = estimation_after_devision;
    }

    pq_fini(pq);

    return cnt == 0 ? 0 : cnt - 1;
}

static void
fill_blacklist_internal(BlackListEntry blacklist[], HT bl)
{
	for (unsigned int i = 0; i < bl->n_bins; ++i)
	{
		HTEntry e = bl->bin[i];
		while (e)
		{
			HTEntry next = e->next;
			State s = e->key;
			uchar til[STATE_N];
			for (int j = 0; j < STATE_N; ++j)
				til[j] = s->pos[j%STATE_WIDTH][j/STATE_WIDTH];
			int hash = korf_hash(til);
			BlackListEntry *ble = &blacklist[hash & (1u << BLACKLIST_BITS)];
			ble->hash = hash;
			for (int p = 0; p < STATE_N; ++p)
				ble->tiles[p] = til[p];
			ble->g_value = state_get_depth(s);
e = next;
		}
	}
}

static void
fill_blacklist(BlackListEntry blacklist[])
{
	fill_blacklist_internal(blacklist, BL2);
	fill_blacklist_internal(blacklist, BL1);
}

/* main */

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>

#define exit_failure(...)                                                      \
    do                                                                         \
    {                                                                          \
        printf(__VA_ARGS__);                                                   \
        exit(EXIT_FAILURE);                                                    \
    } while (0)

static int
pop_int_from_str(const char *str, char **end_ptr)
{
    long int rv = strtol(str, end_ptr, 0);
    errno       = 0;

    if (errno != 0)
        exit_failure("%s: %s cannot be converted into long\n", __func__, str);
    else if (end_ptr && str == *end_ptr)
        exit_failure("%s: reach end of string", __func__);

    if (rv > INT_MAX || rv < INT_MIN)
        exit_failure("%s: too big number, %ld\n", __func__, rv);

    return (int) rv;
}

#define MAX_LINE_LEN 100
static void
load_state_from_file(const char *fname, uchar *s)
{
    FILE *fp;
    char  str[MAX_LINE_LEN];
    char *str_ptr = str, *end_ptr;

    fp = fopen(fname, "r");
    if (!fp)
        exit_failure("%s: %s cannot be opened\n", __func__, fname);

    if (!fgets(str, MAX_LINE_LEN, fp))
        exit_failure("%s: fgets failed\n", __func__);

    for (int i = 0; i < STATE_N; ++i)
    {
        s[i]    = pop_int_from_str(str_ptr, &end_ptr);
        str_ptr = end_ptr;
    }

    fclose(fp);
}
#undef MAX_LINE_LEN

#define CUDA_CHECK(call)                                                       \
    do                                                                         \
    {                                                                          \
        const hipError_t e = call;                                            \
        if (e != hipSuccess)                                                  \
            exit_failure("Error: %s:%d code:%d, reason: %s\n", __FILE__,       \
                         __LINE__, e, hipGetErrorString(e));                  \
    } while (0)

#define h_d_t(op, i, dir)                                                      \
    (h_diff_table[(op) *STATE_N * DIR_N + (i) *DIR_N + (dir)])
__host__ static void
init_mdist(signed char h_diff_table[])
{
    for (int opponent = 0; opponent < STATE_N; ++opponent)
    {
        int goal_x = POS_X(opponent), goal_y = POS_Y(opponent);

        for (int i = 0; i < STATE_N; ++i)
        {
            int from_x = POS_X(i), from_y = POS_Y(i);
            for (uchar dir = 0; dir < DIR_N; ++dir)
            {
                if (dir == DIR_LEFT)
                    h_d_t(opponent, i, dir) = goal_x > from_x ? -1 : 1;
                if (dir == DIR_RIGHT)
                    h_d_t(opponent, i, dir) = goal_x < from_x ? -1 : 1;
                if (dir == DIR_UP)
                    h_d_t(opponent, i, dir) = goal_y > from_y ? -1 : 1;
                if (dir == DIR_DOWN)
                    h_d_t(opponent, i, dir) = goal_y < from_y ? -1 : 1;
            }
        }
    }
}
#undef h_d_t

#define m_t(i, d) (movable_table[(i) *DIR_N + (d)])
__host__ static void
init_movable_table(bool movable_table[])
{
    for (int i = 0; i < STATE_N; ++i)
        for (unsigned int d = 0; d < DIR_N; ++d)
        {
            if (d == DIR_RIGHT)
                m_t(i, d) = (POS_X(i) < STATE_WIDTH - 1);
            else if (d == DIR_LEFT)
                m_t(i, d) = (POS_X(i) > 0);
            else if (d == DIR_DOWN)
                m_t(i, d) = (POS_Y(i) < STATE_WIDTH - 1);
            else if (d == DIR_UP)
                m_t(i, d) = (POS_Y(i) > 0);
        }
}
#undef m_t

static void
avoid_unused_static_assertions(void)
{
    (void) assert_direction[0];
    (void) assert_direction2[0];
    (void) assert_state_width_is_four[0];
    (void) assert_state_width_is_four2[0];
}

static char dir_char[] = {'U', 'R', 'L', 'D'};

int
main(int argc, char *argv[])
{
    int cnt_inputs;

    int    input_size = sizeof(Input) * N_INPUTS;
    Input  input[N_INPUTS];
    Input *d_input;

    int  input_ends_size = sizeof(int) * N_WORKERS;
    int  input_ends[N_WORKERS];
    int *d_input_ends;

    int          plan_size = sizeof(signed char) * PLAN_LEN_MAX * N_INPUTS;
    signed char  plan[PLAN_LEN_MAX * N_INPUTS];
    signed char *d_plan;

    int          stat_size = sizeof(search_stat) * N_INPUTS;
    search_stat  stat[N_INPUTS];
    search_stat *d_stat;

    int          blacklist_size = sizeof(BlackListEntry) * (1 << BLACKLIST_BITS);
    BlackListEntry  h_blacklist[N_INPUTS];
    BlackListEntry *d_blacklist;

    bool         movable_table[STATE_N * DIR_N];
    bool *       d_movable_table;
    int          movable_table_size = sizeof(bool) * STATE_N * DIR_N;

    signed char  h_diff_table[STATE_N * STATE_N * DIR_N];
    signed char *d_h_diff_table;
    int h_diff_table_size = sizeof(signed char) * STATE_N * STATE_N * DIR_N;

    int min_fvalue = 0;

    if (argc < 2)
    {
        printf("usage: bin/cumain <ifname>\n");
        exit(EXIT_FAILURE);
    }

    load_state_from_file(argv[1], input[0].tiles);

    {
        State init_state = state_init(input[0].tiles, 0);

        if (distribute_astar(init_state, input, input_ends, N_INIT_DISTRIBUTION,
                             &cnt_inputs, &min_fvalue))
        {
            puts("solution is found by distributor");
            return 0;
        }
    }

    init_mdist(h_diff_table);
    init_movable_table(movable_table);

    CUDA_CHECK(hipMalloc((void **) &d_input, input_size));
    CUDA_CHECK(hipMalloc((void **) &d_input_ends, input_ends_size));
    CUDA_CHECK(hipMalloc((void **) &d_plan, plan_size));
    CUDA_CHECK(hipMalloc((void **) &d_stat, stat_size));
    CUDA_CHECK(hipMalloc((void **) &d_blacklist, blacklist_size));
    CUDA_CHECK(hipMalloc((void **) &d_movable_table, movable_table_size));
    CUDA_CHECK(hipMalloc((void **) &d_h_diff_table, h_diff_table_size));
    CUDA_CHECK(hipMemcpy(d_movable_table, movable_table, movable_table_size,
                          hipMemcpyHostToDevice));
    CUDA_CHECK(hipMemcpy(d_h_diff_table, h_diff_table, h_diff_table_size,
                          hipMemcpyHostToDevice));

    CUDA_CHECK(hipMemset(d_input, 0, input_size));
    CUDA_CHECK(hipMemset(d_plan, 0, plan_size));
    CUDA_CHECK(hipMemset(d_stat, 0, stat_size));
    CUDA_CHECK(hipMemset(d_blacklist, 0, blacklist_size));

    for (uchar f_limit = min_fvalue;; f_limit += 2)
    {
        elog("f=%d\n", (int) f_limit);
        CUDA_CHECK(
            hipMemcpy(d_input, input, input_size, hipMemcpyHostToDevice));
        CUDA_CHECK(hipMemcpy(d_input_ends, input_ends, input_ends_size,
                              hipMemcpyHostToDevice));

		fill_blacklist(h_blacklist);
        CUDA_CHECK(hipMemcpy(d_blacklist, h_blacklist, blacklist_size,
                              hipMemcpyHostToDevice));

        elog("BL1: %zu, BL2: %zu\n", BL1->n_elems, BL2->n_elems);
        elog("kernel(block=%d, thread=%d)\n", N_BLOCKS, BLOCK_DIM);
        idas_kernel<<<N_BLOCKS, BLOCK_DIM>>>(d_input, d_input_ends, d_plan,
                                             d_blacklist, d_stat, f_limit,
											 d_h_diff_table, d_movable_table);
        CUDA_CHECK(hipGetLastError());

        CUDA_CHECK(hipMemcpy(plan, d_plan, plan_size, hipMemcpyDeviceToHost));
        CUDA_CHECK(hipMemcpy(stat, d_stat, stat_size, hipMemcpyDeviceToHost));

        for (int i = 0; i < cnt_inputs; ++i)
            if (stat[i].solved)
            {
                elog("core id = %d\n", i);
                printf("cpu len=%d: \n", input[i].init_depth);

                /* CPU side output */
                // FIXME: Not implemented, for now. It is easy to search path
                // from init state to this root.

                /* GPU side output */
                printf("gpu len=%d: ", stat[i].len);
                for (int j = 0; j < stat[i].len; ++j)
                    printf("%c ", dir_char[(int) plan[i * PLAN_LEN_MAX + j]]);
                putchar('\n');

                goto solution_found;
            }

        long long int sum_of_expansion = 0;
        for (int i = 0; i < cnt_inputs; ++i)
            sum_of_expansion += stat[i].nodes_expanded;

        long long int sum_of_pruned = 0;
        for (int i = 0; i < cnt_inputs; ++i)
            sum_of_pruned += stat[i].nodes_pruned;

        long long int increased             = 0;
        long long int avarage_expected_load = sum_of_expansion / N_WORKERS;

        int stat_cnt[10] = {0, 0, 0, 0, 0, 0, 0};
        for (int i = 0; i < cnt_inputs; ++i)
        {
            if (stat[i].nodes_expanded < avarage_expected_load)
                stat_cnt[0]++;
            else if (stat[i].nodes_expanded < 2 * avarage_expected_load)
                stat_cnt[1]++;
            else if (stat[i].nodes_expanded < 4 * avarage_expected_load)
                stat_cnt[2]++;
            else if (stat[i].nodes_expanded < 8 * avarage_expected_load)
                stat_cnt[3]++;
            else if (stat[i].nodes_expanded < 16 * avarage_expected_load)
                stat_cnt[4]++;
            else if (stat[i].nodes_expanded < 32 * avarage_expected_load)
                stat_cnt[5]++;
            else
                stat_cnt[6]++;

            int policy =
                stat[i].nodes_expanded / (avarage_expected_load + 1) + 1;

            if (policy > 1 && stat[i].nodes_expanded > 20)
                increased += input_devide(input, stat, i, policy,
                                          cnt_inputs + increased);
        }
        elog("STAT: sum of expanded nodes: %lld\n", sum_of_expansion);
        elog("STAT: avarage expanded nodes: %lld\n", avarage_expected_load);
        elog("STAT: av=%d, 2av=%d, 4av=%d, 8av=%d, 16av=%d, 32av=%d, more=%d\n",
             stat_cnt[0], stat_cnt[1], stat_cnt[2], stat_cnt[3], stat_cnt[4],
             stat_cnt[5], stat_cnt[6]);

        elog("STAT: sum of pruned nodes: %lld\n", sum_of_pruned);

        if (cnt_inputs + increased > N_INPUTS)
        {
            elog("cnt_inputs too large");
            abort();
        }

        cnt_inputs += increased;
        elog("input count: %d\n", cnt_inputs);

        /* NOTE: optionally sort here by expected cost or g/h-value */

        int id = 0;
        for (int i = 0, load = 0; i < cnt_inputs; ++i)
        {
            load += stat[i].nodes_expanded;
            if (load >= avarage_expected_load)
            {
                load             = 0;
                input_ends[id++] = i;
            }
        }

        while (id < N_WORKERS)
            input_ends[id++] = cnt_inputs;
    }
solution_found:

    CUDA_CHECK(hipFree(d_input));
    CUDA_CHECK(hipFree(d_input_ends));
    CUDA_CHECK(hipFree(d_plan));
    CUDA_CHECK(hipFree(d_stat));
    CUDA_CHECK(hipFree(d_movable_table));
    CUDA_CHECK(hipFree(d_h_diff_table));
    CUDA_CHECK(hipDeviceReset());

    avoid_unused_static_assertions();

    return 0;
}

	.text
	.file	"idas_black.hip"
	.globl	_Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb # -- Begin function _Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.type	_Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb,@function
_Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb: # @_Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	4(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	216(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb, .Lfunc_end0-_Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.cfi_endproc
                                        # -- End function
	.globl	_Z6pallocm                      # -- Begin function _Z6pallocm
	.type	_Z6pallocm,@function
_Z6pallocm:                             # @_Z6pallocm
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	callq	malloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.LBB1_1
.LBB1_2:
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB1_1:
	.cfi_def_cfa_offset 16
	movq	stderr(%rip), %rcx
	movl	$.L.str, %edi
	movl	$14, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	jmp	.LBB1_2
.Lfunc_end1:
	.size	_Z6pallocm, .Lfunc_end1-_Z6pallocm
	.cfi_endproc
                                        # -- End function
	.globl	_Z8repallocPvm                  # -- Begin function _Z8repallocPvm
	.type	_Z8repallocPvm,@function
_Z8repallocPvm:                         # @_Z8repallocPvm
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	callq	realloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.LBB2_1
.LBB2_2:
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB2_1:
	.cfi_def_cfa_offset 16
	movq	stderr(%rip), %rcx
	movl	$.L.str.1, %edi
	movl	$15, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	jmp	.LBB2_2
.Lfunc_end2:
	.size	_Z8repallocPvm, .Lfunc_end2-_Z8repallocPvm
	.cfi_endproc
                                        # -- End function
	.globl	_Z5pfreePv                      # -- Begin function _Z5pfreePv
	.type	_Z5pfreePv,@function
_Z5pfreePv:                             # @_Z5pfreePv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	je	.LBB3_1
.LBB3_2:
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	free                            # TAILCALL
.LBB3_1:
	.cfi_def_cfa_offset 16
	movq	stderr(%rip), %rcx
	movl	$.L.str.2, %edi
	movl	$10, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	jmp	.LBB3_2
.Lfunc_end3:
	.size	_Z5pfreePv, .Lfunc_end3-_Z5pfreePv
	.cfi_endproc
                                        # -- End function
	.globl	_Z13state_is_goalP13state_tag_cpu # -- Begin function _Z13state_is_goalP13state_tag_cpu
	.type	_Z13state_is_goalP13state_tag_cpu,@function
_Z13state_is_goalP13state_tag_cpu:      # @_Z13state_is_goalP13state_tag_cpu
	.cfi_startproc
# %bb.0:
	cmpl	$0, 24(%rdi)
	sete	%al
	retq
.Lfunc_end4:
	.size	_Z13state_is_goalP13state_tag_cpu, .Lfunc_end4-_Z13state_is_goalP13state_tag_cpu
	.cfi_endproc
                                        # -- End function
	.globl	_Z10state_initPhi               # -- Begin function _Z10state_initPhi
	.type	_Z10state_initPhi,@function
_Z10state_initPhi:                      # @_Z10state_initPhi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebp
	movq	%rdi, %rbx
	movl	$28, %edi
	callq	_Z6pallocm
	movl	%ebp, (%rax)
	movb	$-1, 22(%rax)
	leaq	4(%rax), %rcx
	xorl	%edx, %edx
	xorl	%esi, %esi
.LBB5_1:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_2 Depth 2
	movslq	%esi, %rsi
	leaq	(%rbx,%rsi), %r8
	xorl	%edi, %edi
.LBB5_2:                                #   Parent Loop BB5_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movb	(%r8,%rdi), %r9b
	testb	%r9b, %r9b
	jne	.LBB5_4
# %bb.3:                                #   in Loop: Header=BB5_2 Depth=2
	movb	%dil, 20(%rax)
	movb	%dl, 21(%rax)
.LBB5_4:                                #   in Loop: Header=BB5_2 Depth=2
	movb	%r9b, (%rcx,%rdi,4)
	incq	%rdi
	cmpq	$4, %rdi
	jne	.LBB5_2
# %bb.5:                                #   in Loop: Header=BB5_1 Depth=1
	incq	%rdx
	addq	%rdi, %rsi
	incq	%rcx
	cmpq	$4, %rdx
	jne	.LBB5_1
# %bb.6:                                # %.preheader.i.i.preheader
	movq	%rax, %rcx
	addq	$4, %rcx
	xorl	%edx, %edx
.LBB5_7:                                # %.preheader.i.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_8 Depth 2
	xorl	%esi, %esi
.LBB5_8:                                #   Parent Loop BB5_7 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%rcx,%rsi), %edi
	movb	%dl, _ZL6from_x(%rdi)
	movb	%sil, _ZL6from_y(%rdi)
	incq	%rsi
	cmpq	$4, %rsi
	jne	.LBB5_8
# %bb.9:                                #   in Loop: Header=BB5_7 Depth=1
	incq	%rdx
	addq	$4, %rcx
	cmpq	$4, %rdx
	jne	.LBB5_7
# %bb.10:                               # %_ZL12fill_from_xyP13state_tag_cpu.exit.i.preheader
	xorl	%ecx, %ecx
	movl	$1, %edx
.LBB5_11:                               # %_ZL12fill_from_xyP13state_tag_cpu.exit.i
                                        # =>This Inner Loop Header: Depth=1
	movzbl	_ZL6from_y(%rdx), %esi
	movl	%edx, %edi
	shrl	$2, %edi
	movl	%edi, %r8d
	subl	%esi, %r8d
	negl	%r8d
	subl	%esi, %edi
	movzbl	_ZL6from_x(%rdx), %esi
	cmovbl	%r8d, %edi
	movl	%edx, %r8d
	andl	$3, %r8d
	movl	%r8d, %r9d
	subl	%esi, %r9d
	negl	%r9d
	subl	%esi, %r8d
	cmovbl	%r9d, %r8d
	addl	%r8d, %ecx
	addl	%edi, %ecx
	incq	%rdx
	cmpq	$16, %rdx
	jne	.LBB5_11
# %bb.12:                               # %_ZL28heuristic_manhattan_distanceP13state_tag_cpu.exit
	movl	%ecx, 24(%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z10state_initPhi, .Lfunc_end5-_Z10state_initPhi
	.cfi_endproc
                                        # -- End function
	.globl	_Z10state_finiP13state_tag_cpu  # -- Begin function _Z10state_finiP13state_tag_cpu
	.type	_Z10state_finiP13state_tag_cpu,@function
_Z10state_finiP13state_tag_cpu:         # @_Z10state_finiP13state_tag_cpu
	.cfi_startproc
# %bb.0:
	jmp	_Z5pfreePv                      # TAILCALL
.Lfunc_end6:
	.size	_Z10state_finiP13state_tag_cpu, .Lfunc_end6-_Z10state_finiP13state_tag_cpu
	.cfi_endproc
                                        # -- End function
	.globl	_Z10state_copyP13state_tag_cpu  # -- Begin function _Z10state_copyP13state_tag_cpu
	.type	_Z10state_copyP13state_tag_cpu,@function
_Z10state_copyP13state_tag_cpu:         # @_Z10state_copyP13state_tag_cpu
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movl	$28, %edi
	callq	_Z6pallocm
	movups	(%rbx), %xmm0
	movups	12(%rbx), %xmm1
	movups	%xmm0, (%rax)
	movups	%xmm1, 12(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z10state_copyP13state_tag_cpu, .Lfunc_end7-_Z10state_copyP13state_tag_cpu
	.cfi_endproc
                                        # -- End function
	.globl	_Z13state_movableP13state_tag_cpua # -- Begin function _Z13state_movableP13state_tag_cpua
	.type	_Z13state_movableP13state_tag_cpua,@function
_Z13state_movableP13state_tag_cpua:     # @_Z13state_movableP13state_tag_cpua
	.cfi_startproc
# %bb.0:
	cmpl	$3, %esi
	ja	.LBB8_1
# %bb.2:
	movl	%esi, %eax
	jmpq	*.LJTI8_0(,%rax,8)
.LBB8_6:
	cmpb	$0, 21(%rdi)
	jmp	.LBB8_7
.LBB8_3:
	cmpb	$0, 20(%rdi)
	jmp	.LBB8_7
.LBB8_4:
	cmpb	$3, 21(%rdi)
	jmp	.LBB8_7
.LBB8_5:
	cmpb	$3, 20(%rdi)
.LBB8_7:
	setne	%al
	retq
.LBB8_1:
	movb	$1, %al
	retq
.Lfunc_end8:
	.size	_Z13state_movableP13state_tag_cpua, .Lfunc_end8-_Z13state_movableP13state_tag_cpua
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI8_0:
	.quad	.LBB8_6
	.quad	.LBB8_5
	.quad	.LBB8_3
	.quad	.LBB8_4
                                        # -- End function
	.text
	.globl	_Z10state_moveP13state_tag_cpua # -- Begin function _Z10state_moveP13state_tag_cpua
	.type	_Z10state_moveP13state_tag_cpua,@function
_Z10state_moveP13state_tag_cpua:        # @_Z10state_moveP13state_tag_cpua
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%esi, %ebx
	movq	%rdi, %r14
	cmpl	$3, %esi
	ja	.LBB9_6
# %bb.1:
	movl	%ebx, %eax
	jmpq	*.LJTI9_0(,%rax,8)
.LBB9_5:
	movzbl	20(%r14), %eax
	movzbl	21(%r14), %ecx
	leaq	(%r14,%rax,4), %rdx
	movb	3(%rcx,%rdx), %al
	movb	%al, 4(%rcx,%rdx)
	decb	21(%r14)
	jmp	.LBB9_7
.LBB9_2:
	movzbl	20(%r14), %eax
	movzbl	21(%r14), %ecx
	leaq	(%r14,%rax,4), %rdx
	movb	(%rcx,%rdx), %al
	movb	%al, 4(%rcx,%rdx)
	decb	20(%r14)
	jmp	.LBB9_7
.LBB9_3:
	movzbl	20(%r14), %eax
	movzbl	21(%r14), %ecx
	leaq	(%r14,%rax,4), %rdx
	movb	5(%rcx,%rdx), %al
	movb	%al, 4(%rcx,%rdx)
	incb	21(%r14)
	jmp	.LBB9_7
.LBB9_4:
	movzbl	20(%r14), %eax
	movzbl	21(%r14), %ecx
	leaq	(%r14,%rax,4), %rdx
	movb	8(%rcx,%rdx), %al
	movb	%al, 4(%rcx,%rdx)
	incb	20(%r14)
.LBB9_7:
	movzbl	%al, %eax
	shll	$6, %eax
	movzbl	21(%r14), %ecx
	shll	$4, %ecx
	movzbl	20(%r14), %edx
	movb	$3, %sil
	subb	%bl, %sil
	movsbl	%sil, %esi
	addl	%eax, %esi
	movslq	%esi, %rax
	addq	%rcx, %rax
	leaq	(%rax,%rdx,4), %rax
	movl	_ZL12h_diff_table(,%rax,4), %eax
	addl	%eax, 24(%r14)
	movb	%bl, 22(%r14)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB9_6:
	.cfi_def_cfa_offset 32
	movq	stderr(%rip), %rcx
	movl	$.L.str.3, %edi
	movl	$20, %esi
	movl	$1, %edx
	callq	fwrite@PLT
                                        # implicit-def: $al
	jmp	.LBB9_7
.Lfunc_end9:
	.size	_Z10state_moveP13state_tag_cpua, .Lfunc_end9-_Z10state_moveP13state_tag_cpua
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI9_0:
	.quad	.LBB9_5
	.quad	.LBB9_4
	.quad	.LBB9_2
	.quad	.LBB9_3
                                        # -- End function
	.text
	.globl	_Z15state_pos_equalP13state_tag_cpuS0_ # -- Begin function _Z15state_pos_equalP13state_tag_cpuS0_
	.type	_Z15state_pos_equalP13state_tag_cpuS0_,@function
_Z15state_pos_equalP13state_tag_cpuS0_: # @_Z15state_pos_equalP13state_tag_cpuS0_
	.cfi_startproc
# %bb.0:
	addq	$4, %rdi
	addq	$4, %rsi
	xorl	%ecx, %ecx
	xorl	%eax, %eax
.LBB10_1:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_3 Depth 2
	xorl	%edx, %edx
.LBB10_3:                               #   Parent Loop BB10_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movb	(%rdi,%rdx), %r8b
	cmpb	(%rsi,%rdx), %r8b
	jne	.LBB10_5
# %bb.2:                                #   in Loop: Header=BB10_3 Depth=2
	incq	%rdx
	cmpq	$4, %rdx
	jne	.LBB10_3
# %bb.4:                                #   in Loop: Header=BB10_1 Depth=1
	cmpq	$3, %rcx
	leaq	1(%rcx), %rdx
	setae	%al
	addq	$4, %rdi
	addq	$4, %rsi
	movq	%rdx, %rcx
	cmpq	$4, %rdx
	jne	.LBB10_1
.LBB10_5:                               # %.loopexit
	andb	$1, %al
                                        # kill: def $al killed $al killed $rax
	retq
.Lfunc_end10:
	.size	_Z15state_pos_equalP13state_tag_cpuS0_, .Lfunc_end10-_Z15state_pos_equalP13state_tag_cpuS0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z10state_hashP13state_tag_cpu  # -- Begin function _Z10state_hashP13state_tag_cpu
	.type	_Z10state_hashP13state_tag_cpu,@function
_Z10state_hashP13state_tag_cpu:         # @_Z10state_hashP13state_tag_cpu
	.cfi_startproc
# %bb.0:
	addq	$4, %rdi
	xorl	%edx, %edx
	xorl	%esi, %esi
	xorl	%eax, %eax
.LBB11_1:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_2 Depth 2
	movl	%edx, %ecx
	xorl	%r8d, %r8d
.LBB11_2:                               #   Parent Loop BB11_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%rdi,%r8), %r9d
	shll	%cl, %r9d
	movslq	%r9d, %r9
	xorq	%r9, %rax
	incq	%r8
	addl	$4, %ecx
	cmpq	$4, %r8
	jne	.LBB11_2
# %bb.3:                                #   in Loop: Header=BB11_1 Depth=1
	incq	%rsi
	addq	$4, %rdi
	addl	$12, %edx
	cmpq	$4, %rsi
	jne	.LBB11_1
# %bb.4:
	retq
.Lfunc_end11:
	.size	_Z10state_hashP13state_tag_cpu, .Lfunc_end11-_Z10state_hashP13state_tag_cpu
	.cfi_endproc
                                        # -- End function
	.globl	_Z16state_get_hvalueP13state_tag_cpu # -- Begin function _Z16state_get_hvalueP13state_tag_cpu
	.type	_Z16state_get_hvalueP13state_tag_cpu,@function
_Z16state_get_hvalueP13state_tag_cpu:   # @_Z16state_get_hvalueP13state_tag_cpu
	.cfi_startproc
# %bb.0:
	movl	24(%rdi), %eax
	retq
.Lfunc_end12:
	.size	_Z16state_get_hvalueP13state_tag_cpu, .Lfunc_end12-_Z16state_get_hvalueP13state_tag_cpu
	.cfi_endproc
                                        # -- End function
	.globl	_Z15state_get_depthP13state_tag_cpu # -- Begin function _Z15state_get_depthP13state_tag_cpu
	.type	_Z15state_get_depthP13state_tag_cpu,@function
_Z15state_get_depthP13state_tag_cpu:    # @_Z15state_get_depthP13state_tag_cpu
	.cfi_startproc
# %bb.0:
	movl	(%rdi), %eax
	retq
.Lfunc_end13:
	.size	_Z15state_get_depthP13state_tag_cpu, .Lfunc_end13-_Z15state_get_depthP13state_tag_cpu
	.cfi_endproc
                                        # -- End function
	.globl	_Z7ht_initm                     # -- Begin function _Z7ht_initm
	.type	_Z7ht_initm,@function
_Z7ht_initm:                            # @_Z7ht_initm
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	$1, %eax
.LBB14_1:                               # =>This Inner Loop Header: Depth=1
	movq	%rax, %rbx
	addq	%rax, %rax
	cmpq	%rdi, %rbx
	jb	.LBB14_1
# %bb.2:                                # %_ZL11calc_n_binsm.exit
	movl	$24, %edi
	callq	_Z6pallocm
	movq	%rax, %r14
	movq	%rbx, (%rax)
	movq	$0, 8(%rax)
	shlq	$3, %rbx
	movq	%rbx, %rdi
	callq	_Z6pallocm
	movq	%rax, 16(%r14)
	movq	%rax, %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	memset@PLT
	movq	%r14, %rax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end14:
	.size	_Z7ht_initm, .Lfunc_end14-_Z7ht_initm
	.cfi_endproc
                                        # -- End function
	.globl	_Z7ht_finiP6ht_tag              # -- Begin function _Z7ht_finiP6ht_tag
	.type	_Z7ht_finiP6ht_tag,@function
_Z7ht_finiP6ht_tag:                     # @_Z7ht_finiP6ht_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.LBB15_6
# %bb.1:                                # %.lr.ph16
	xorl	%r15d, %r15d
.LBB15_2:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB15_3 Depth 2
	movq	16(%rbx), %rcx
	movq	(%rcx,%r15,8), %r14
	testq	%r14, %r14
	je	.LBB15_5
.LBB15_3:                               # %.lr.ph
                                        #   Parent Loop BB15_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%r14), %r12
	movq	8(%r14), %rdi
	callq	_Z5pfreePv
	movq	%r14, %rdi
	callq	_Z5pfreePv
	movq	%r12, %r14
	testq	%r12, %r12
	jne	.LBB15_3
# %bb.4:                                # %._crit_edge.loopexit
                                        #   in Loop: Header=BB15_2 Depth=1
	movq	(%rbx), %rax
.LBB15_5:                               # %._crit_edge
                                        #   in Loop: Header=BB15_2 Depth=1
	incq	%r15
	cmpq	%rax, %r15
	jb	.LBB15_2
.LBB15_6:                               # %_Z5pfreePv.exit
	movq	16(%rbx), %rdi
	callq	_Z5pfreePv
	movq	%rbx, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	free                            # TAILCALL
.Lfunc_end15:
	.size	_Z7ht_finiP6ht_tag, .Lfunc_end15-_Z7ht_finiP6ht_tag
	.cfi_endproc
                                        # -- End function
	.globl	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi # -- Begin function _Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	.type	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi,@function
_Z9ht_insertP6ht_tagP13state_tag_cpuPPi: # @_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdi), %r13
	cmpq	8(%rdi), %r13
	jbe	.LBB16_2
# %bb.1:
	movq	%r13, %rbp
	jmp	.LBB16_12
.LBB16_2:
	movq	%r15, (%rsp)                    # 8-byte Spill
	movq	%rbx, 16(%rsp)                  # 8-byte Spill
	leaq	(,%r13,2), %rbp
	shlq	$4, %r13
	movq	%r13, %rdi
	callq	_Z6pallocm
	movq	%rax, %r12
	movq	%rax, %rdi
	xorl	%esi, %esi
	movq	%r13, %rdx
	callq	memset@PLT
	movq	(%r14), %rax
	movq	%r14, 8(%rsp)                   # 8-byte Spill
	movq	16(%r14), %rdi
	testq	%rax, %rax
	je	.LBB16_11
# %bb.3:                                # %.lr.ph29.i
	leaq	-1(%rbp), %rdx
	xorl	%esi, %esi
.LBB16_4:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB16_5 Depth 2
                                        #       Child Loop BB16_6 Depth 3
                                        #         Child Loop BB16_7 Depth 4
	movq	(%rdi,%rsi,8), %r8
	testq	%r8, %r8
	je	.LBB16_10
.LBB16_5:                               # %.lr.ph.i
                                        #   Parent Loop BB16_4 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB16_6 Depth 3
                                        #         Child Loop BB16_7 Depth 4
	movq	(%r8), %r9
	movq	8(%r8), %r10
	addq	$4, %r10
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	xorl	%r11d, %r11d
.LBB16_6:                               # %.preheader.i.i.i
                                        #   Parent Loop BB16_4 Depth=1
                                        #     Parent Loop BB16_5 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB16_7 Depth 4
	movl	%r13d, %ecx
	xorl	%r15d, %r15d
.LBB16_7:                               #   Parent Loop BB16_4 Depth=1
                                        #     Parent Loop BB16_5 Depth=2
                                        #       Parent Loop BB16_6 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movzbl	(%r10,%r15), %r14d
	shll	%cl, %r14d
	movslq	%r14d, %r14
	xorq	%r14, %r11
	incq	%r15
	addl	$4, %ecx
	cmpq	$4, %r15
	jne	.LBB16_7
# %bb.8:                                #   in Loop: Header=BB16_6 Depth=3
	incq	%rbx
	addl	$12, %r13d
	addq	$4, %r10
	cmpq	$4, %rbx
	jne	.LBB16_6
# %bb.9:                                # %_ZL8hashfuncP13state_tag_cpu.exit.i
                                        #   in Loop: Header=BB16_5 Depth=2
	andq	%rdx, %r11
	movq	(%r12,%r11,8), %rcx
	movq	%rcx, (%r8)
	movq	%r8, (%r12,%r11,8)
	movq	%r9, %r8
	testq	%r9, %r9
	jne	.LBB16_5
.LBB16_10:                              # %._crit_edge.i
                                        #   in Loop: Header=BB16_4 Depth=1
	incq	%rsi
	cmpq	%rax, %rsi
	jne	.LBB16_4
.LBB16_11:                              # %_ZL9ht_rehashP6ht_tag.exit
	callq	_Z5pfreePv
	movq	8(%rsp), %r14                   # 8-byte Reload
	movq	%rbp, (%r14)
	movq	%r12, 16(%r14)
	movq	16(%rsp), %rbx                  # 8-byte Reload
	movq	(%rsp), %r15                    # 8-byte Reload
.LBB16_12:
	leaq	4(%r15), %rax
	xorl	%edx, %edx
	xorl	%edi, %edi
	xorl	%esi, %esi
.LBB16_13:                              # %.preheader.i.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB16_14 Depth 2
	movl	%edx, %ecx
	xorl	%r8d, %r8d
.LBB16_14:                              #   Parent Loop BB16_13 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%rax,%r8), %r9d
	shll	%cl, %r9d
	movslq	%r9d, %r9
	xorq	%r9, %rsi
	incq	%r8
	addl	$4, %ecx
	cmpq	$4, %r8
	jne	.LBB16_14
# %bb.15:                               #   in Loop: Header=BB16_13 Depth=1
	incq	%rdi
	addl	$12, %edx
	addq	$4, %rax
	cmpq	$4, %rdi
	jne	.LBB16_13
# %bb.16:                               # %_ZL8hashfuncP13state_tag_cpu.exit
	decq	%rbp
	andq	%rsi, %rbp
	leaq	(,%rbp,8), %rax
	addq	16(%r14), %rax
	leaq	4(%r15), %rcx
.LBB16_17:                              # =>This Loop Header: Depth=1
                                        #     Child Loop BB16_19 Depth 2
                                        #       Child Loop BB16_21 Depth 3
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.LBB16_25
# %bb.18:                               #   in Loop: Header=BB16_17 Depth=1
	movq	8(%rax), %rdx
	addq	$4, %rdx
	xorl	%r8d, %r8d
	movq	%rcx, %rsi
	xorl	%edi, %edi
.LBB16_19:                              # %.preheader.i
                                        #   Parent Loop BB16_17 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB16_21 Depth 3
	xorl	%r9d, %r9d
.LBB16_21:                              #   Parent Loop BB16_17 Depth=1
                                        #     Parent Loop BB16_19 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movb	(%rsi,%r9), %r10b
	cmpb	(%rdx,%r9), %r10b
	jne	.LBB16_23
# %bb.20:                               #   in Loop: Header=BB16_21 Depth=3
	incq	%r9
	cmpq	$4, %r9
	jne	.LBB16_21
# %bb.22:                               #   in Loop: Header=BB16_19 Depth=2
	cmpq	$3, %r8
	leaq	1(%r8), %r9
	setae	%dil
	addq	$4, %rdx
	addq	$4, %rsi
	movq	%r9, %r8
	cmpq	$4, %r9
	jne	.LBB16_19
.LBB16_23:                              # %_Z15state_pos_equalP13state_tag_cpuS0_.exit
                                        #   in Loop: Header=BB16_17 Depth=1
	testb	$1, %dil
	je	.LBB16_17
# %bb.24:
	addq	$16, %rax
	movq	%rax, (%rbx)
	movl	$1, %eax
	jmp	.LBB16_26
.LBB16_25:
	movl	$24, %edi
	callq	_Z6pallocm
	movq	%rax, %r12
	movl	$28, %edi
	callq	_Z6pallocm
	movups	(%r15), %xmm0
	movups	12(%r15), %xmm1
	movups	%xmm0, (%rax)
	movups	%xmm1, 12(%rax)
	movq	%rax, 8(%r12)
	movq	16(%r14), %rax
	movq	(%rax,%rbp,8), %rcx
	movq	%rcx, (%r12)
	movq	%r12, (%rax,%rbp,8)
	addq	$16, %r12
	movq	%r12, (%rbx)
	incq	8(%r14)
	xorl	%eax, %eax
.LBB16_26:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end16:
	.size	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi, .Lfunc_end16-_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z7pq_initm                     # -- Begin function _Z7pq_initm
	.type	_Z7pq_initm,@function
_Z7pq_initm:                            # @_Z7pq_initm
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %r14
	movl	$24, %edi
	callq	_Z6pallocm
	movq	%rax, %rbx
	movq	$0, (%rax)
	movl	$1, %eax
.LBB17_1:                               # =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	addq	%rax, %rax
	cmpq	%r14, %rdi
	jb	.LBB17_1
# %bb.2:                                # %_ZL14calc_init_capam.exit
	decq	%rdi
	movq	%rdi, 8(%rbx)
	shlq	$4, %rdi
	callq	_Z6pallocm
	movq	%rax, 16(%rbx)
	movq	%rbx, %rax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end17:
	.size	_Z7pq_initm, .Lfunc_end17-_Z7pq_initm
	.cfi_endproc
                                        # -- End function
	.globl	_Z7pq_finiP6pq_tag              # -- Begin function _Z7pq_finiP6pq_tag
	.type	_Z7pq_finiP6pq_tag,@function
_Z7pq_finiP6pq_tag:                     # @_Z7pq_finiP6pq_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	cmpq	$0, (%rdi)
	je	.LBB18_3
# %bb.1:                                # %.lr.ph
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
.LBB18_2:                               # =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rax
	movq	(%rax,%r14), %rdi
	callq	_Z5pfreePv
	incq	%r15
	addq	$16, %r14
	cmpq	(%rbx), %r15
	jb	.LBB18_2
.LBB18_3:                               # %_Z5pfreePv.exit
	movq	16(%rbx), %rdi
	callq	_Z5pfreePv
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	free                            # TAILCALL
.Lfunc_end18:
	.size	_Z7pq_finiP6pq_tag, .Lfunc_end18-_Z7pq_finiP6pq_tag
	.cfi_endproc
                                        # -- End function
	.globl	_Z6pq_putP6pq_tagP13state_tag_cpuii # -- Begin function _Z6pq_putP6pq_tagP13state_tag_cpuii
	.type	_Z6pq_putP6pq_tagP13state_tag_cpuii,@function
_Z6pq_putP6pq_tagP13state_tag_cpuii:    # @_Z6pq_putP6pq_tagP13state_tag_cpuii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%ecx, %ebp
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	cmpq	8(%rdi), %rax
	jne	.LBB19_2
# %bb.1:
	leaq	1(,%rax,2), %rsi
	movq	%rsi, 8(%rbx)
	movq	16(%rbx), %rdi
	shlq	$4, %rsi
	callq	_Z8repallocPvm
	movq	%rax, 16(%rbx)
.LBB19_2:
	movl	$28, %edi
	callq	_Z6pallocm
	movups	(%r15), %xmm0
	movups	12(%r15), %xmm1
	movups	%xmm0, (%rax)
	movups	%xmm1, 12(%rax)
	movq	(%rbx), %rcx
	movq	16(%rbx), %rdx
	movq	%rcx, %rsi
	shlq	$4, %rsi
	movq	%rax, (%rdx,%rsi)
	movl	%r14d, 8(%rdx,%rsi)
	movl	%ebp, 12(%rdx,%rsi)
	testq	%rcx, %rcx
	je	.LBB19_3
.LBB19_4:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movq	%rcx, %rdx
	leaq	-1(%rcx), %rax
	movq	%rax, %rcx
	shrq	%rcx
	movq	16(%rbx), %rdi
	shlq	$4, %rdx
	movq	%rcx, %rsi
	shlq	$4, %rsi
	movl	8(%rdi,%rsi), %r8d
	cmpl	%r8d, 8(%rdi,%rdx)
	jl	.LBB19_7
# %bb.5:                                #   in Loop: Header=BB19_4 Depth=1
	jne	.LBB19_8
# %bb.6:                                # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit.i
                                        #   in Loop: Header=BB19_4 Depth=1
	movl	12(%rdi,%rdx), %r8d
	cmpl	12(%rdi,%rsi), %r8d
	jl	.LBB19_8
.LBB19_7:                               # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit.thread.i
                                        #   in Loop: Header=BB19_4 Depth=1
	addq	%rdi, %rdx
	addq	%rsi, %rdi
	movups	(%rdx), %xmm0
	movaps	%xmm0, (%rsp)
	movups	(%rdi), %xmm0
	movups	%xmm0, (%rdx)
	movq	16(%rbx), %rdx
	movaps	(%rsp), %xmm0
	movups	%xmm0, (%rdx,%rsi)
	cmpq	$1, %rax
	ja	.LBB19_4
.LBB19_8:                               # %_ZL10heapify_upP6pq_tag.exit.loopexit
	movq	(%rbx), %rax
	incq	%rax
	jmp	.LBB19_9
.LBB19_3:
	movl	$1, %eax
.LBB19_9:                               # %_ZL10heapify_upP6pq_tag.exit
	movq	%rax, (%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end19:
	.size	_Z6pq_putP6pq_tagP13state_tag_cpuii, .Lfunc_end19-_Z6pq_putP6pq_tagP13state_tag_cpuii
	.cfi_endproc
                                        # -- End function
	.globl	_Z6pq_popP6pq_tag               # -- Begin function _Z6pq_popP6pq_tag
	.type	_Z6pq_popP6pq_tag,@function
_Z6pq_popP6pq_tag:                      # @_Z6pq_popP6pq_tag
	.cfi_startproc
# %bb.0:
	movq	(%rdi), %rcx
	testq	%rcx, %rcx
	je	.LBB20_1
# %bb.3:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	16(%rdi), %rdx
	movq	(%rdx), %rax
	decq	%rcx
	movq	%rcx, (%rdi)
	shlq	$4, %rcx
	movups	(%rdx,%rcx), %xmm0
	movups	%xmm0, (%rdx)
	movq	(%rdi), %rcx
	cmpq	$2, %rcx
	jb	.LBB20_22
# %bb.4:                                # %.lr.ph.i.preheader
	movl	$1, %r8d
	xorl	%r10d, %r10d
	xorl	%edx, %edx
.LBB20_5:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	addq	$2, %r10
	movq	16(%rdi), %rsi
	movq	%r8, %r9
	shlq	$4, %r9
	leaq	(%rsi,%r9), %r11
	movl	8(%rsi,%r9), %ebp
	cmpq	%rcx, %r10
	jae	.LBB20_6
# %bb.10:                               #   in Loop: Header=BB20_5 Depth=1
	movq	%r10, %rbx
	shlq	$4, %rbx
	leaq	(%rsi,%rbx), %r14
	movl	8(%rsi,%rbx), %r15d
	cmpl	%r15d, %ebp
	jge	.LBB20_11
.LBB20_13:                              # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit39.thread.i
                                        #   in Loop: Header=BB20_5 Depth=1
	shlq	$4, %rdx
	cmpl	8(%rsi,%rdx), %ebp
	jl	.LBB20_16
# %bb.14:                               #   in Loop: Header=BB20_5 Depth=1
	jne	.LBB20_22
# %bb.15:                               # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit40.i
                                        #   in Loop: Header=BB20_5 Depth=1
	movl	12(%rsi,%r9), %r10d
	cmpl	12(%rsi,%rdx), %r10d
	jl	.LBB20_22
.LBB20_16:                              # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit40.thread.i
                                        #   in Loop: Header=BB20_5 Depth=1
	addq	%rdx, %rsi
	movups	(%rsi), %xmm0
	movaps	%xmm0, -16(%rsp)
	movups	(%r11), %xmm0
	movups	%xmm0, (%rsi)
	movq	16(%rdi), %rdx
	movaps	-16(%rsp), %xmm0
	movups	%xmm0, (%rdx,%r9)
	jmp	.LBB20_21
.LBB20_11:                              #   in Loop: Header=BB20_5 Depth=1
	jne	.LBB20_17
# %bb.12:                               # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit39.i
                                        #   in Loop: Header=BB20_5 Depth=1
	movl	12(%rsi,%r9), %r12d
	cmpl	12(%rsi,%rbx), %r12d
	jge	.LBB20_13
.LBB20_17:                              # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit39.thread43.i
                                        #   in Loop: Header=BB20_5 Depth=1
	shlq	$4, %rdx
	cmpl	8(%rsi,%rdx), %r15d
	jl	.LBB20_20
# %bb.18:                               #   in Loop: Header=BB20_5 Depth=1
	jne	.LBB20_22
# %bb.19:                               # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit41.i
                                        #   in Loop: Header=BB20_5 Depth=1
	movl	12(%rsi,%rbx), %r8d
	cmpl	12(%rsi,%rdx), %r8d
	jl	.LBB20_22
.LBB20_20:                              # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit41.thread.i
                                        #   in Loop: Header=BB20_5 Depth=1
	addq	%rdx, %rsi
	movups	(%rsi), %xmm0
	movaps	%xmm0, -16(%rsp)
	movups	(%r14), %xmm0
	movups	%xmm0, (%rsi)
	movq	16(%rdi), %rdx
	movaps	-16(%rsp), %xmm0
	movups	%xmm0, (%rdx,%rbx)
	movq	%r10, %r8
.LBB20_21:                              #   in Loop: Header=BB20_5 Depth=1
	movq	%r8, %rdx
	leaq	(%r8,%r8), %r10
	leaq	1(,%r8,2), %r8
	cmpq	%rcx, %r8
	jb	.LBB20_5
	jmp	.LBB20_22
.LBB20_1:
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %rbp
	.cfi_restore %r12
	.cfi_restore %r14
	.cfi_restore %r15
	xorl	%eax, %eax
	retq
.LBB20_6:
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %rbp, -16
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	shlq	$4, %rdx
	cmpl	8(%rsi,%rdx), %ebp
	jge	.LBB20_7
.LBB20_9:                               # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit.thread.i
	addq	%rdx, %rsi
	movups	(%rsi), %xmm0
	movaps	%xmm0, -16(%rsp)
	movups	(%r11), %xmm0
	movups	%xmm0, (%rsi)
	movq	16(%rdi), %rcx
	movaps	-16(%rsp), %xmm0
	movups	%xmm0, (%rcx,%r9)
	jmp	.LBB20_22
.LBB20_7:
	jne	.LBB20_22
# %bb.8:                                # %_ZL24pq_entry_higher_priorityP12pq_entry_tagS0_.exit.i
	movl	12(%rsi,%r9), %ecx
	cmpl	12(%rsi,%rdx), %ecx
	jge	.LBB20_9
.LBB20_22:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
	retq
.Lfunc_end20:
	.size	_Z6pq_popP6pq_tag, .Lfunc_end20-_Z6pq_popP6pq_tag
	.cfi_endproc
                                        # -- End function
	.globl	_Z7pq_dumpP6pq_tag              # -- Begin function _Z7pq_dumpP6pq_tag
	.type	_Z7pq_dumpP6pq_tag,@function
_Z7pq_dumpP6pq_tag:                     # @_Z7pq_dumpP6pq_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movq	stderr(%rip), %rdi
	movq	(%rbx), %rcx
	movq	8(%rbx), %r8
	movl	$.L.str.4, %esi
	movl	$.L__func__._Z7pq_dumpP6pq_tag, %edx
	xorl	%eax, %eax
	callq	fprintf
	cmpq	$0, (%rbx)
	je	.LBB21_5
# %bb.1:                                # %.lr.ph
	movl	$1, %r14d
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
.LBB21_2:                               # =>This Inner Loop Header: Depth=1
	cmpq	%r14, %r12
	jne	.LBB21_4
# %bb.3:                                #   in Loop: Header=BB21_2 Depth=1
	movq	stderr(%rip), %rsi
	movl	$10, %edi
	callq	fputc@PLT
	leaq	1(,%r14,2), %r14
.LBB21_4:                               #   in Loop: Header=BB21_2 Depth=1
	movq	stderr(%rip), %rdi
	movq	16(%rbx), %rax
	movl	8(%rax,%r15), %edx
	movl	$.L.str.6, %esi
	xorl	%eax, %eax
	callq	fprintf
	movq	stderr(%rip), %rdi
	movq	16(%rbx), %rax
	movl	12(%rax,%r15), %edx
	movl	$.L.str.7, %esi
	xorl	%eax, %eax
	callq	fprintf
	incq	%r12
	addq	$16, %r15
	cmpq	(%rbx), %r12
	jb	.LBB21_2
.LBB21_5:                               # %._crit_edge
	movq	stderr(%rip), %rsi
	movl	$10, %edi
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	fputc@PLT                       # TAILCALL
.Lfunc_end21:
	.size	_Z7pq_dumpP6pq_tag, .Lfunc_end21-_Z7pq_dumpP6pq_tag
	.cfi_endproc
                                        # -- End function
	.globl	_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_ # -- Begin function _Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_
	.type	_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_,@function
_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_: # @_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 40(%rsp)                   # 8-byte Spill
	movq	%r8, %r12
	movl	%ecx, %ebx
	movq	%rdx, 48(%rsp)                  # 8-byte Spill
	movq	%rsi, 32(%rsp)                  # 8-byte Spill
	movq	%rdi, %r15
	leal	10(%rbx), %eax
	movslq	%eax, %rdi
	callq	_Z7pq_initm
	movq	%rax, %r13
	movl	$10000, %edi                    # imm = 0x2710
	callq	_Z7ht_initm
	movq	%rax, _ZL6closed(%rip)
	movl	$1000, %edi                     # imm = 0x3E8
	callq	_Z7ht_initm
	movq	%rax, _ZL3BL1(%rip)
	movl	$1000, %edi                     # imm = 0x3E8
	callq	_Z7ht_initm
	movq	%rax, _ZL3BL2(%rip)
	movq	_ZL6closed(%rip), %rdi
	leaq	8(%rsp), %r14
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	movq	(%r14), %rax
	movl	$0, (%rax)
	movl	$28, %edi
	callq	_Z6pallocm
	movups	(%r15), %xmm0
	movups	12(%r15), %xmm1
	movups	%xmm0, (%rax)
	movups	%xmm1, 12(%rax)
	movl	24(%r15), %edx
	movq	%r13, %rdi
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	callq	_Z6pq_putP6pq_tagP13state_tag_cpuii
	movq	%r13, %rdi
	callq	_Z6pq_popP6pq_tag
	testq	%rax, %rax
	je	.LBB22_24
# %bb.1:                                # %.lr.ph.preheader
	movq	%rax, %r15
	movq	%r12, 16(%rsp)                  # 8-byte Spill
	movl	$1, %ebp
.LBB22_2:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB22_9 Depth 2
	decl	%ebp
	cmpl	$0, 24(%r15)
	je	.LBB22_3
# %bb.4:                                #   in Loop: Header=BB22_2 Depth=1
	movq	_ZL6closed(%rip), %rdi
	movq	%r15, %rsi
	leaq	8(%rsp), %rdx
	callq	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	movl	(%r15), %ecx
	movq	8(%rsp), %rdx
	testl	%eax, %eax
	je	.LBB22_8
# %bb.5:                                #   in Loop: Header=BB22_2 Depth=1
	cmpl	%ecx, (%rdx)
	jge	.LBB22_8
# %bb.6:                                #   in Loop: Header=BB22_2 Depth=1
	movq	%r15, %rdi
	callq	_Z5pfreePv
	jmp	.LBB22_7
.LBB22_8:                               #   in Loop: Header=BB22_2 Depth=1
	movl	%ecx, (%rdx)
	xorl	%r12d, %r12d
.LBB22_9:                               #   Parent Loop BB22_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsbl	22(%r15), %eax
	xorl	%r12d, %eax
	cmpl	$3, %eax
	je	.LBB22_20
# %bb.10:                               #   in Loop: Header=BB22_9 Depth=2
	cmpb	$3, %r12b
	ja	.LBB22_16
# %bb.11:                               #   in Loop: Header=BB22_9 Depth=2
	movzbl	%r12b, %eax
	jmpq	*.LJTI22_0(,%rax,8)
.LBB22_14:                              #   in Loop: Header=BB22_9 Depth=2
	cmpb	$0, 21(%r15)
	jne	.LBB22_16
	jmp	.LBB22_20
.LBB22_12:                              #   in Loop: Header=BB22_9 Depth=2
	cmpb	$0, 20(%r15)
	jne	.LBB22_16
	jmp	.LBB22_20
.LBB22_13:                              #   in Loop: Header=BB22_9 Depth=2
	cmpb	$3, 21(%r15)
	jne	.LBB22_16
	jmp	.LBB22_20
.LBB22_15:                              # %_Z13state_movableP13state_tag_cpua.exit
                                        #   in Loop: Header=BB22_9 Depth=2
	cmpb	$3, 20(%r15)
	je	.LBB22_20
.LBB22_16:                              # %_Z13state_movableP13state_tag_cpua.exit.thread
                                        #   in Loop: Header=BB22_9 Depth=2
	movl	$28, %edi
	callq	_Z6pallocm
	movq	%rax, %r14
	movups	(%r15), %xmm0
	movups	12(%r15), %xmm1
	movups	%xmm0, (%rax)
	movups	%xmm1, 12(%rax)
	movsbl	%r12b, %esi
	movq	%rax, %rdi
	callq	_Z10state_moveP13state_tag_cpua
	incl	(%r14)
	movq	_ZL6closed(%rip), %rdi
	movq	%r14, %rsi
	leaq	8(%rsp), %rdx
	callq	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	movl	(%r14), %ecx
	movq	8(%rsp), %rdx
	testl	%eax, %eax
	je	.LBB22_19
# %bb.17:                               #   in Loop: Header=BB22_9 Depth=2
	cmpl	%ecx, (%rdx)
	jle	.LBB22_18
.LBB22_19:                              #   in Loop: Header=BB22_9 Depth=2
	incl	%ebp
	movl	%ecx, (%rdx)
	movl	24(%r14), %edx
	addl	%ecx, %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_Z6pq_putP6pq_tagP13state_tag_cpuii
	jmp	.LBB22_20
.LBB22_18:                              #   in Loop: Header=BB22_9 Depth=2
	movq	%r14, %rdi
	callq	_Z5pfreePv
.LBB22_20:                              #   in Loop: Header=BB22_9 Depth=2
	incl	%r12d
	cmpl	$4, %r12d
	jne	.LBB22_9
# %bb.21:                               #   in Loop: Header=BB22_2 Depth=1
	movq	%r15, %rdi
	callq	_Z5pfreePv
	cmpl	%ebx, %ebp
	jge	.LBB22_22
.LBB22_7:                               # %.backedge
                                        #   in Loop: Header=BB22_2 Depth=1
	movq	%r13, %rdi
	callq	_Z6pq_popP6pq_tag
	movq	%rax, %r15
	testq	%rax, %rax
	jne	.LBB22_2
.LBB22_22:                              # %._crit_edge
	movq	%rbx, 24(%rsp)                  # 8-byte Spill
	movq	16(%rsp), %rax                  # 8-byte Reload
	movl	%ebp, (%rax)
	testl	%ebp, %ebp
	jle	.LBB22_30
# %bb.23:
	movq	%r13, %rbx
	jmp	.LBB22_25
.LBB22_24:                              # %._crit_edge.thread
	movq	%rbx, 24(%rsp)                  # 8-byte Spill
	movq	%r13, %rbx
	movl	$1, (%r12)
	movl	$1, %ebp
.LBB22_25:                              # %.lr.ph109.preheader
	movl	%ebp, %r15d
	movl	$2147483647, %r14d              # imm = 0x7FFFFFFF
	xorl	%r12d, %r12d
	movq	32(%rsp), %r13                  # 8-byte Reload
.LBB22_26:                              # %.lr.ph109
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB22_27 Depth 2
	movq	%rbx, %rdi
	callq	_Z6pq_popP6pq_tag
	movq	32(%rsp), %r9                   # 8-byte Reload
	leaq	(%r12,%r12,2), %rcx
	leaq	(%r9,%rcx,8), %rdx
	xorl	%esi, %esi
.LBB22_27:                              #   Parent Loop BB22_26 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%esi, %edi
	andl	$3, %edi
	movl	%esi, %r8d
	shrl	$2, %r8d
	leaq	(%rax,%rdi,4), %rdi
	movb	4(%r8,%rdi), %dil
	movb	%dil, (%r13,%rsi)
	incq	%rsi
	cmpq	$16, %rsi
	jne	.LBB22_27
# %bb.28:                               #   in Loop: Header=BB22_26 Depth=1
	movzbl	20(%rax), %esi
	movzbl	21(%rax), %edi
	leaq	(%rsi,%rdi,4), %rsi
	movb	$0, (%rdx,%rsi)
	movl	(%rax), %edx
	movl	%edx, 16(%r9,%rcx,8)
	movb	22(%rax), %sil
	movb	%sil, 20(%r9,%rcx,8)
	addl	24(%rax), %edx
	cmpl	%edx, %r14d
	cmovgel	%edx, %r14d
	incq	%r12
	addq	$24, %r13
	cmpq	%r15, %r12
	jne	.LBB22_26
# %bb.29:
	movq	%rbx, %r13
.LBB22_31:                              # %._crit_edge110
	movq	40(%rsp), %rax                  # 8-byte Reload
	movl	%r14d, (%rax)
	xorl	%ebx, %ebx
	movl	$.L.str.8, %edi
	movq	24(%rsp), %r14                  # 8-byte Reload
	movl	%r14d, %esi
	movl	$3072, %edx                     # imm = 0xC00
	movl	%ebp, %ecx
	xorl	%eax, %eax
	callq	printf
	movslq	%r14d, %rax
	imulq	$715827883, %rax, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$41, %rcx
	leal	(%rcx,%rdx), %eax
	addl	%edx, %ecx
	decl	%ecx
	movq	48(%rsp), %rdx                  # 8-byte Reload
.LBB22_32:                              # =>This Inner Loop Header: Depth=1
	movl	%ecx, (%rdx,%rbx,4)
	incq	%rbx
	addl	%eax, %ecx
	cmpq	$3072, %rbx                     # imm = 0xC00
	jne	.LBB22_32
# %bb.33:
	movl	%ebp, 12284(%rdx)
	xorl	%ebp, %ebp
	jmp	.LBB22_34
.LBB22_3:                               # %.thread
	movq	16(%rsp), %rax                  # 8-byte Reload
	movl	%ebp, (%rax)
	movb	$1, %bpl
.LBB22_34:
	movq	%r13, %rdi
	callq	_Z7pq_finiP6pq_tag
	movl	%ebp, %eax
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB22_30:
	.cfi_def_cfa_offset 112
	movl	$2147483647, %r14d              # imm = 0x7FFFFFFF
	jmp	.LBB22_31
.Lfunc_end22:
	.size	_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_, .Lfunc_end22-_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI22_0:
	.quad	.LBB22_14
	.quad	.LBB22_15
	.quad	.LBB22_12
	.quad	.LBB22_13
                                        # -- End function
	.text
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$8246616, %rsp                  # imm = 0x7DD558
	.cfi_def_cfa_offset 8246672
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$0, 52(%rsp)
	cmpl	$1, %edi
	jle	.LBB23_138
# %bb.1:
	movq	8(%rsi), %r14
	movl	$.L.str.26, %esi
	movq	%r14, %rdi
	callq	fopen
	testq	%rax, %rax
	je	.LBB23_139
# %bb.2:
	movq	%rax, %rbx
	leaq	1979728(%rsp), %r15
	movq	%r15, %rdi
	movl	$100, %esi
	movq	%rax, %rdx
	callq	fgets
	testq	%rax, %rax
	je	.LBB23_140
# %bb.3:                                # %.preheader.i.preheader
	xorl	%ebp, %ebp
	leaq	1193296(%rsp), %r14
.LBB23_4:                               # %.preheader.i
                                        # =>This Inner Loop Header: Depth=1
	movq	%r15, %r13
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	__isoc23_strtol
	movq	%rax, %r12
	callq	__errno_location
	movl	$0, (%rax)
	movq	1193296(%rsp), %r15
	cmpq	%r13, %r15
	je	.LBB23_126
# %bb.5:                                #   in Loop: Header=BB23_4 Depth=1
	movslq	%r12d, %rax
	cmpq	%r12, %rax
	jne	.LBB23_128
# %bb.6:                                # %_ZL16pop_int_from_strPKcPPc.exit.i
                                        #   in Loop: Header=BB23_4 Depth=1
	movb	%r12b, 603472(%rsp,%rbp)
	incq	%rbp
	cmpq	$16, %rbp
	jne	.LBB23_4
# %bb.7:                                # %_ZL20load_state_from_filePKcPh.exit
	movq	%rbx, %rdi
	callq	fclose
	leaq	603472(%rsp), %rbx
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_Z10state_initPhi
	leaq	1360(%rsp), %rdx
	leaq	124(%rsp), %r8
	leaq	52(%rsp), %r9
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movl	$12288, %ecx                    # imm = 0x3000
	callq	_Z16distribute_astarP13state_tag_cpuP9input_tagPiiS3_S3_
	testb	%al, %al
	je	.LBB23_10
# %bb.8:
	movl	$.L.str.10, %edi
	callq	puts
.LBB23_9:
	xorl	%eax, %eax
	addq	$8246616, %rsp                  # imm = 0x7DD558
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB23_10:                              # %.critedge.preheader
	.cfi_def_cfa_offset 8246672
	leaq	339(%rsp), %rax
.LBB23_11:                              # %.critedge
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB23_12 Depth 2
	movl	%r14d, %ecx
	andl	$3, %ecx
	movl	%r14d, %edx
	shrl	$2, %edx
	xorl	%esi, %esi
.LBB23_12:                              #   Parent Loop BB23_11 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%esi, %edi
	shrl	$2, %edi
	cmpl	%edi, %edx
	movl	$0, %r8d
	sbbl	%r8d, %r8d
	cmpl	%edi, %edx
	seta	%dil
	movl	%esi, %r9d
	andl	$3, %r9d
	cmpl	%r9d, %ecx
	movl	$0, %r10d
	sbbl	%r10d, %r10d
	cmpl	%r9d, %ecx
	seta	%r9b
	orb	$1, %r8b
	orb	$1, %r10b
	negb	%r9b
	orb	$1, %r9b
	negb	%dil
	orb	$1, %dil
	movb	%dil, -3(%rax,%rsi,4)
	movb	%r10b, -2(%rax,%rsi,4)
	movb	%r9b, -1(%rax,%rsi,4)
	movb	%r8b, (%rax,%rsi,4)
	incq	%rsi
	cmpq	$16, %rsi
	jne	.LBB23_12
# %bb.13:                               #   in Loop: Header=BB23_11 Depth=1
	incq	%r14
	addq	$64, %rax
	cmpq	$16, %r14
	jne	.LBB23_11
# %bb.14:                               # %_ZL10init_mdistPa.exit.preheader
	xorl	%eax, %eax
.LBB23_15:                              # %_ZL10init_mdistPa.exit
                                        # =>This Inner Loop Header: Depth=1
	movl	%eax, %ecx
	andl	$3, %ecx
	cmpq	$4, %rax
	setae	272(%rsp,%rax,4)
	cmpl	$3, %ecx
	setne	273(%rsp,%rax,4)
	testl	%ecx, %ecx
	setne	274(%rsp,%rax,4)
	cmpq	$12, %rax
	setb	275(%rsp,%rax,4)
	incq	%rax
	cmpq	$16, %rax
	jne	.LBB23_15
# %bb.16:                               # %_ZL18init_movable_tablePb.exit
	leaq	40(%rsp), %rdi
	movl	$589824, %esi                   # imm = 0x90000
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB23_141
# %bb.17:
	leaq	112(%rsp), %rdi
	movl	$12288, %esi                    # imm = 0x3000
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB23_142
# %bb.18:
	leaq	72(%rsp), %rdi
	movl	$6266880, %esi                  # imm = 0x5FA000
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB23_143
# %bb.19:
	leaq	64(%rsp), %rdi
	movl	$589824, %esi                   # imm = 0x90000
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB23_144
# %bb.20:
	leaq	104(%rsp), %rdi
	movl	$32768, %esi                    # imm = 0x8000
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB23_145
# %bb.21:
	leaq	96(%rsp), %rdi
	movl	$64, %esi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB23_146
# %bb.22:
	leaq	88(%rsp), %rdi
	movl	$1024, %esi                     # imm = 0x400
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB23_147
# %bb.23:
	movq	96(%rsp), %rdi
	leaq	272(%rsp), %rsi
	movl	$64, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB23_148
# %bb.24:
	movq	88(%rsp), %rdi
	leaq	336(%rsp), %rsi
	movl	$1024, %edx                     # imm = 0x400
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB23_149
# %bb.25:
	movq	40(%rsp), %rdi
	movl	$589824, %edx                   # imm = 0x90000
	xorl	%esi, %esi
	callq	hipMemset
	testl	%eax, %eax
	jne	.LBB23_150
# %bb.26:
	movq	72(%rsp), %rdi
	movl	$6266880, %edx                  # imm = 0x5FA000
	xorl	%esi, %esi
	callq	hipMemset
	testl	%eax, %eax
	jne	.LBB23_151
# %bb.27:
	movq	64(%rsp), %rdi
	movl	$589824, %edx                   # imm = 0x90000
	xorl	%esi, %esi
	callq	hipMemset
	testl	%eax, %eax
	jne	.LBB23_152
# %bb.28:
	movq	104(%rsp), %rdi
	movl	$32768, %edx                    # imm = 0x8000
	xorl	%esi, %esi
	callq	hipMemset
	testl	%eax, %eax
	jne	.LBB23_153
# %bb.29:
	movzbl	52(%rsp), %edx
	movl	124(%rsp), %r14d
	movq	stderr(%rip), %rdi
	movl	$.L.str.13, %esi
	movl	%edx, 28(%rsp)                  # 4-byte Spill
	xorl	%eax, %eax
	callq	fprintf
	movq	40(%rsp), %rdi
	leaq	603472(%rsp), %rsi
	movl	$589824, %edx                   # imm = 0x90000
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB23_131
# %bb.30:                               # %.lr.ph369.preheader
	movabsq	$4294967328, %rax               # imm = 0x100000020
	addq	$64, %rax
	movq	%rax, 176(%rsp)                 # 8-byte Spill
.LBB23_31:                              # %.lr.ph369
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB23_40 Depth 2
                                        #     Child Loop BB23_44 Depth 2
                                        #     Child Loop BB23_47 Depth 2
                                        #     Child Loop BB23_50 Depth 2
                                        #       Child Loop BB23_70 Depth 3
                                        #         Child Loop BB23_75 Depth 4
                                        #       Child Loop BB23_93 Depth 3
                                        #         Child Loop BB23_97 Depth 4
                                        #     Child Loop BB23_107 Depth 2
                                        #     Child Loop BB23_112 Depth 2
	movq	112(%rsp), %rdi
	movl	$12288, %edx                    # imm = 0x3000
	leaq	1360(%rsp), %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB23_132
# %bb.32:                               #   in Loop: Header=BB23_31 Depth=1
	movq	_ZL3BL2(%rip), %rsi
	leaq	1193296(%rsp), %rbx
	movq	%rbx, %rdi
	callq	_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag
	movq	_ZL3BL1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag
	movq	104(%rsp), %rdi
	movl	$32768, %edx                    # imm = 0x8000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB23_133
# %bb.33:                               #   in Loop: Header=BB23_31 Depth=1
	movq	stderr(%rip), %rdi
	movq	_ZL3BL1(%rip), %rax
	movq	8(%rax), %rdx
	movq	_ZL3BL2(%rip), %rax
	movq	8(%rax), %rcx
	movl	$.L.str.14, %esi
	xorl	%eax, %eax
	callq	fprintf
	movq	stderr(%rip), %rdi
	movl	$.L.str.15, %esi
	movl	$96, %edx
	movl	$32, %ecx
	xorl	%eax, %eax
	callq	fprintf
	movq	176(%rsp), %rdi                 # 8-byte Reload
	movl	$1, %esi
	movabsq	$4294967328, %rdx               # imm = 0x100000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB23_35
# %bb.34:                               #   in Loop: Header=BB23_31 Depth=1
	movq	40(%rsp), %rdi
	movq	112(%rsp), %rsi
	movq	72(%rsp), %rdx
	movq	104(%rsp), %rcx
	movq	64(%rsp), %r8
	movl	28(%rsp), %r9d                  # 4-byte Reload
	pushq	96(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	96(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.LBB23_35:                              #   in Loop: Header=BB23_31 Depth=1
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB23_134
# %bb.36:                               #   in Loop: Header=BB23_31 Depth=1
	movq	72(%rsp), %rsi
	movl	$6266880, %edx                  # imm = 0x5FA000
	leaq	1979728(%rsp), %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB23_135
# %bb.37:                               #   in Loop: Header=BB23_31 Depth=1
	movq	64(%rsp), %rsi
	movl	$589824, %edx                   # imm = 0x90000
	leaq	13648(%rsp), %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB23_136
# %bb.38:                               # %.preheader277
                                        #   in Loop: Header=BB23_31 Depth=1
	testl	%r14d, %r14d
	jle	.LBB23_102
# %bb.39:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB23_31 Depth=1
	movl	%r14d, %r8d
	leaq	(,%r8,8), %rax
	leaq	(%rax,%rax,2), %rax
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	xorl	%ebp, %ebp
.LBB23_40:                              # %.lr.ph
                                        #   Parent Loop BB23_31 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpb	$0, 13648(%rsp,%rbx)
	jne	.LBB23_115
# %bb.41:                               #   in Loop: Header=BB23_40 Depth=2
	addl	$255, %ebp
	incl	%edx
	addq	$24, %rbx
	cmpq	%rbx, %rax
	jne	.LBB23_40
# %bb.42:                               # %.critedge258.preheader
                                        #   in Loop: Header=BB23_31 Depth=1
	testl	%r14d, %r14d
	jle	.LBB23_102
# %bb.43:                               # %.critedge258.preheader376
                                        #   in Loop: Header=BB23_31 Depth=1
	xorl	%ecx, %ecx
	xorl	%edi, %edi
.LBB23_44:                              # %.critedge258
                                        #   Parent Loop BB23_31 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	addq	13656(%rsp,%rcx), %rdi
	addq	$24, %rcx
	cmpq	%rcx, %rax
	jne	.LBB23_44
# %bb.45:                               # %.preheader276
                                        #   in Loop: Header=BB23_31 Depth=1
	testl	%r14d, %r14d
	jle	.LBB23_103
# %bb.46:                               # %.lr.ph328.preheader
                                        #   in Loop: Header=BB23_31 Depth=1
	xorl	%ecx, %ecx
	xorl	%esi, %esi
.LBB23_47:                              # %.lr.ph328
                                        #   Parent Loop BB23_31 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	13664(%rsp,%rcx), %rdx
	addq	%rdx, %rsi
	addq	$24, %rcx
	cmpq	%rcx, %rax
	jne	.LBB23_47
# %bb.48:                               # %._crit_edge
                                        #   in Loop: Header=BB23_31 Depth=1
	movq	%rsi, 136(%rsp)                 # 8-byte Spill
	movq	%rdi, 128(%rsp)                 # 8-byte Spill
	movq	%rdi, %rax
	movabsq	$3074457345618258603, %rcx      # imm = 0x2AAAAAAAAAAAAAAB
	imulq	%rcx
	movq	%rdx, %r12
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$9, %r12
	addq	%rax, %r12
	testl	%r14d, %r14d
	jle	.LBB23_114
# %bb.49:                               # %.lr.ph341
                                        #   in Loop: Header=BB23_31 Depth=1
	leaq	(%r12,%r12), %rax
	movq	%rax, 208(%rsp)                 # 8-byte Spill
	leaq	(,%r12,4), %rax
	movq	%rax, 192(%rsp)                 # 8-byte Spill
	leaq	(,%r12,8), %rax
	movq	%rax, 184(%rsp)                 # 8-byte Spill
	movq	%r12, %rax
	shlq	$4, %rax
	movq	%rax, 168(%rsp)                 # 8-byte Spill
	movq	%r12, %rax
	shlq	$5, %rax
	movq	%rax, 160(%rsp)                 # 8-byte Spill
	leaq	1(%r12), %rax
	movq	%rax, 264(%rsp)                 # 8-byte Spill
	leal	-1(%r14), %eax
	movq	%rax, 200(%rsp)                 # 8-byte Spill
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	xorl	%r9d, %r9d
	xorl	%edi, %edi
	xorl	%r13d, %r13d
	movq	%r14, 232(%rsp)                 # 8-byte Spill
	movq	%r12, 224(%rsp)                 # 8-byte Spill
	movq	%r8, 216(%rsp)                  # 8-byte Spill
.LBB23_50:                              #   Parent Loop BB23_31 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB23_70 Depth 3
                                        #         Child Loop BB23_75 Depth 4
                                        #       Child Loop BB23_93 Depth 3
                                        #         Child Loop BB23_97 Depth 4
	leaq	(%rax,%rax,2), %rcx
	movq	%rcx, 56(%rsp)                  # 8-byte Spill
	movq	13656(%rsp,%rcx,8), %rcx
	cmpq	%r12, %rcx
	movq	%rax, 152(%rsp)                 # 8-byte Spill
	jge	.LBB23_52
# %bb.51:                               #   in Loop: Header=BB23_50 Depth=2
	incl	%edi
	jmp	.LBB23_63
.LBB23_52:                              #   in Loop: Header=BB23_50 Depth=2
	cmpq	208(%rsp), %rcx                 # 8-byte Folded Reload
	jge	.LBB23_54
# %bb.53:                               #   in Loop: Header=BB23_50 Depth=2
	incl	%r9d
	jmp	.LBB23_63
.LBB23_54:                              #   in Loop: Header=BB23_50 Depth=2
	cmpq	192(%rsp), %rcx                 # 8-byte Folded Reload
	jge	.LBB23_56
# %bb.55:                               #   in Loop: Header=BB23_50 Depth=2
	incl	%r10d
	jmp	.LBB23_63
.LBB23_56:                              #   in Loop: Header=BB23_50 Depth=2
	cmpq	184(%rsp), %rcx                 # 8-byte Folded Reload
	jge	.LBB23_58
# %bb.57:                               #   in Loop: Header=BB23_50 Depth=2
	incl	%r11d
	jmp	.LBB23_63
.LBB23_58:                              #   in Loop: Header=BB23_50 Depth=2
	cmpq	168(%rsp), %rcx                 # 8-byte Folded Reload
	jge	.LBB23_60
# %bb.59:                               #   in Loop: Header=BB23_50 Depth=2
	incl	%r15d
	jmp	.LBB23_63
.LBB23_60:                              #   in Loop: Header=BB23_50 Depth=2
	cmpq	160(%rsp), %rcx                 # 8-byte Folded Reload
	jge	.LBB23_62
# %bb.61:                               #   in Loop: Header=BB23_50 Depth=2
	incl	%ebp
	jmp	.LBB23_63
.LBB23_62:                              #   in Loop: Header=BB23_50 Depth=2
	incl	%ebx
.LBB23_63:                              #   in Loop: Header=BB23_50 Depth=2
	movq	%rcx, %rax
	cqto
	idivq	264(%rsp)                       # 8-byte Folded Reload
	cmpq	$21, %rcx
	jl	.LBB23_100
# %bb.64:                               #   in Loop: Header=BB23_50 Depth=2
	incl	%eax
	cmpl	$2, %eax
	jl	.LBB23_100
# %bb.65:                               #   in Loop: Header=BB23_50 Depth=2
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	movl	%r11d, (%rsp)                   # 4-byte Spill
	movl	%r10d, 4(%rsp)                  # 4-byte Spill
	movl	%r9d, 8(%rsp)                   # 4-byte Spill
	movl	%edi, 12(%rsp)                  # 4-byte Spill
	movq	%rbx, 240(%rsp)                 # 8-byte Spill
	movq	%rbp, 248(%rsp)                 # 8-byte Spill
	movq	%r15, 256(%rsp)                 # 8-byte Spill
	movq	56(%rsp), %rax                  # 8-byte Reload
	leaq	(%rsp,%rax,8), %rbx
	addq	$603472, %rbx                   # imm = 0x93550
	movl	16(%rbx), %esi
	movq	%rbx, %rdi
	callq	_Z10state_initPhi
	movq	%rax, %r15
	movb	20(%rbx), %al
	movb	%al, 22(%r15)
	movl	$32, %edi
	callq	_Z7pq_initm
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movq	_ZL3BL1(%rip), %rdi
	movq	%r15, %rsi
	leaq	16(%rsp), %rdx
	callq	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	testl	%eax, %eax
	je	.LBB23_68
# %bb.66:                               #   in Loop: Header=BB23_50 Depth=2
	movq	16(%rsp), %rax
	movl	(%r15), %ecx
	cmpl	%ecx, (%rax)
	jle	.LBB23_68
# %bb.67:                               #   in Loop: Header=BB23_50 Depth=2
	movl	%ecx, (%rax)
.LBB23_68:                              #   in Loop: Header=BB23_50 Depth=2
	movq	%r13, 144(%rsp)                 # 8-byte Spill
	movl	24(%r15), %edx
	movq	32(%rsp), %rbx                  # 8-byte Reload
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	callq	_Z6pq_putP6pq_tagP13state_tag_cpuii
	movq	%rbx, %rdi
	callq	_Z6pq_popP6pq_tag
	testq	%rax, %rax
	je	.LBB23_89
# %bb.69:                               # %.lr.ph.i.preheader
                                        #   in Loop: Header=BB23_50 Depth=2
	movq	%rax, %rbp
	movl	$1, %r13d
.LBB23_70:                              # %.lr.ph.i
                                        #   Parent Loop BB23_31 Depth=1
                                        #     Parent Loop BB23_50 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB23_75 Depth 4
	cmpl	$0, 24(%rbp)
	je	.LBB23_90
# %bb.71:                               #   in Loop: Header=BB23_70 Depth=3
	decl	%r13d
	movq	_ZL6closed(%rip), %rdi
	movq	%rbp, %rsi
	leaq	16(%rsp), %rdx
	callq	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	movl	(%rbp), %ecx
	movq	16(%rsp), %rdx
	testl	%eax, %eax
	je	.LBB23_74
# %bb.72:                               #   in Loop: Header=BB23_70 Depth=3
	cmpl	%ecx, (%rdx)
	jge	.LBB23_74
# %bb.73:                               #   in Loop: Header=BB23_70 Depth=3
	movq	%rbp, %rdi
	callq	free
	jmp	.LBB23_88
.LBB23_74:                              #   in Loop: Header=BB23_70 Depth=3
	movl	%ecx, (%rdx)
	xorl	%r14d, %r14d
.LBB23_75:                              #   Parent Loop BB23_31 Depth=1
                                        #     Parent Loop BB23_50 Depth=2
                                        #       Parent Loop BB23_70 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movsbl	22(%rbp), %eax
	xorl	%r14d, %eax
	cmpl	$3, %eax
	je	.LBB23_86
# %bb.76:                               #   in Loop: Header=BB23_75 Depth=4
	cmpb	$3, %r14b
	ja	.LBB23_82
# %bb.77:                               #   in Loop: Header=BB23_75 Depth=4
	movzbl	%r14b, %eax
	jmpq	*.LJTI23_0(,%rax,8)
.LBB23_78:                              #   in Loop: Header=BB23_75 Depth=4
	cmpb	$0, 21(%rbp)
	jne	.LBB23_82
	jmp	.LBB23_86
.LBB23_79:                              #   in Loop: Header=BB23_75 Depth=4
	cmpb	$0, 20(%rbp)
	jne	.LBB23_82
	jmp	.LBB23_86
.LBB23_80:                              #   in Loop: Header=BB23_75 Depth=4
	cmpb	$3, 21(%rbp)
	jne	.LBB23_82
	jmp	.LBB23_86
.LBB23_81:                              # %_Z13state_movableP13state_tag_cpua.exit.i
                                        #   in Loop: Header=BB23_75 Depth=4
	cmpb	$3, 20(%rbp)
	je	.LBB23_86
.LBB23_82:                              # %_Z13state_movableP13state_tag_cpua.exit.thread.i
                                        #   in Loop: Header=BB23_75 Depth=4
	movl	$28, %edi
	callq	_Z6pallocm
	movq	%rax, %r15
	movups	(%rbp), %xmm0
	movups	12(%rbp), %xmm1
	movups	%xmm0, (%rax)
	movups	%xmm1, 12(%rax)
	movsbl	%r14b, %esi
	movq	%rax, %rdi
	callq	_Z10state_moveP13state_tag_cpua
	movl	(%r15), %ebx
	leal	1(%rbx), %r12d
	movl	%r12d, (%r15)
	movq	_ZL6closed(%rip), %rdi
	movq	%r15, %rsi
	leaq	16(%rsp), %rdx
	callq	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	movq	16(%rsp), %rcx
	testl	%eax, %eax
	je	.LBB23_84
# %bb.83:                               #   in Loop: Header=BB23_75 Depth=4
	cmpl	%ebx, (%rcx)
	jle	.LBB23_85
.LBB23_84:                              #   in Loop: Header=BB23_75 Depth=4
	incl	%r13d
	movl	%r12d, (%rcx)
	movl	24(%r15), %edx
	addl	%r12d, %edx
	movq	32(%rsp), %rdi                  # 8-byte Reload
	movq	%r15, %rsi
	movl	%r12d, %ecx
	callq	_Z6pq_putP6pq_tagP13state_tag_cpuii
	jmp	.LBB23_86
.LBB23_85:                              # %_Z5pfreePv.exit
                                        #   in Loop: Header=BB23_75 Depth=4
	movq	%r15, %rdi
	callq	free
.LBB23_86:                              #   in Loop: Header=BB23_75 Depth=4
	incl	%r14d
	cmpl	$4, %r14d
	jne	.LBB23_75
# %bb.87:                               #   in Loop: Header=BB23_70 Depth=3
	movq	%rbp, %rdi
	callq	free
	cmpl	80(%rsp), %r13d                 # 4-byte Folded Reload
	jge	.LBB23_91
.LBB23_88:                              # %.backedge.i
                                        #   in Loop: Header=BB23_70 Depth=3
	movq	32(%rsp), %rdi                  # 8-byte Reload
	callq	_Z6pq_popP6pq_tag
	movq	%rax, %rbp
	testq	%rax, %rax
	jne	.LBB23_70
	jmp	.LBB23_91
.LBB23_89:                              #   in Loop: Header=BB23_50 Depth=2
	movl	$1, %r13d
	jmp	.LBB23_92
.LBB23_90:                              #   in Loop: Header=BB23_50 Depth=2
	movl	(%rbp), %ecx
	movq	32(%rsp), %rdi                  # 8-byte Reload
	movq	%rbp, %rsi
	movl	%ecx, %edx
	callq	_Z6pq_putP6pq_tagP13state_tag_cpuii
.LBB23_91:                              # %.loopexit.i
                                        #   in Loop: Header=BB23_50 Depth=2
	testl	%r13d, %r13d
	jle	.LBB23_99
.LBB23_92:                              # %.lr.ph113.i
                                        #   in Loop: Header=BB23_50 Depth=2
	movq	56(%rsp), %rax                  # 8-byte Reload
	leaq	(%rsp,%rax,8), %rax
	addq	$13656, %rax                    # imm = 0x3558
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	movl	%r13d, %eax
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movq	144(%rsp), %rax                 # 8-byte Reload
	movq	200(%rsp), %rcx                 # 8-byte Reload
	leal	(%rcx,%rax), %ebx
	xorl	%r15d, %r15d
.LBB23_93:                              #   Parent Loop BB23_31 Depth=1
                                        #     Parent Loop BB23_50 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB23_97 Depth 4
	movq	80(%rsp), %rax                  # 8-byte Reload
	movq	(%rax), %rax
	cqto
	idivq	56(%rsp)                        # 8-byte Folded Reload
	movq	%rax, %r14
	leal	(%rbx,%r15), %r12d
	testl	%r15d, %r15d
	cmovel	152(%rsp), %r12d                # 4-byte Folded Reload
	movq	32(%rsp), %rdi                  # 8-byte Reload
	callq	_Z6pq_popP6pq_tag
	movq	%rax, %rbp
	movq	_ZL3BL2(%rip), %rdi
	movq	%rax, %rsi
	leaq	16(%rsp), %rdx
	callq	_Z9ht_insertP6ht_tagP13state_tag_cpuPPi
	testl	%eax, %eax
	je	.LBB23_96
# %bb.94:                               #   in Loop: Header=BB23_93 Depth=3
	movq	16(%rsp), %rax
	movl	(%rbp), %ecx
	cmpl	%ecx, (%rax)
	jle	.LBB23_96
# %bb.95:                               #   in Loop: Header=BB23_93 Depth=3
	movl	%ecx, (%rax)
.LBB23_96:                              #   in Loop: Header=BB23_93 Depth=3
	movslq	%r12d, %rax
	leaq	(%rax,%rax,2), %rcx
	leaq	(%rsp,%rcx,8), %rcx
	addq	$603472, %rcx                   # imm = 0x93550
	xorl	%edx, %edx
.LBB23_97:                              #   Parent Loop BB23_31 Depth=1
                                        #     Parent Loop BB23_50 Depth=2
                                        #       Parent Loop BB23_93 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movl	%edx, %esi
	andl	$3, %esi
	movl	%edx, %edi
	shrl	$2, %edi
	leaq	(,%rsi,4), %rsi
	addq	%rbp, %rsi
	movb	4(%rdi,%rsi), %sil
	movb	%sil, (%rcx,%rdx)
	incq	%rdx
	cmpq	$16, %rdx
	jne	.LBB23_97
# %bb.98:                               #   in Loop: Header=BB23_93 Depth=3
	movzbl	20(%rbp), %edx
	movzbl	21(%rbp), %esi
	leaq	(%rdx,%rsi,4), %rdx
	movb	$0, (%rcx,%rdx)
	movl	(%rbp), %ecx
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %rax
	movl	%ecx, 603488(%rsp,%rax)
	movb	22(%rbp), %cl
	movb	%cl, 603492(%rsp,%rax)
	movslq	%r14d, %rcx
	movq	%rcx, 13656(%rsp,%rax)
	incl	%r15d
	cmpl	%r13d, %r15d
	jne	.LBB23_93
.LBB23_99:                              # %_ZL12input_devideP9input_tagP15search_stat_tagiii.exit
                                        #   in Loop: Header=BB23_50 Depth=2
	movq	32(%rsp), %rdi                  # 8-byte Reload
	callq	_Z7pq_finiP6pq_tag
	subl	$1, %r13d
	movl	$0, %eax
	cmovbl	%eax, %r13d
	movslq	%r13d, %rax
	movq	144(%rsp), %r13                 # 8-byte Reload
	addq	%rax, %r13
	movq	232(%rsp), %r14                 # 8-byte Reload
	movq	224(%rsp), %r12                 # 8-byte Reload
	movq	216(%rsp), %r8                  # 8-byte Reload
	movq	256(%rsp), %r15                 # 8-byte Reload
	movq	248(%rsp), %rbp                 # 8-byte Reload
	movq	240(%rsp), %rbx                 # 8-byte Reload
	movl	12(%rsp), %edi                  # 4-byte Reload
	movl	8(%rsp), %r9d                   # 4-byte Reload
	movl	4(%rsp), %r10d                  # 4-byte Reload
	movl	(%rsp), %r11d                   # 4-byte Reload
.LBB23_100:                             #   in Loop: Header=BB23_50 Depth=2
	movq	152(%rsp), %rax                 # 8-byte Reload
	incq	%rax
	cmpq	%r8, %rax
	jne	.LBB23_50
# %bb.101:                              #   in Loop: Header=BB23_31 Depth=1
	movq	128(%rsp), %rcx                 # 8-byte Reload
	movl	%edi, 12(%rsp)                  # 4-byte Spill
	movl	%r9d, 8(%rsp)                   # 4-byte Spill
	movl	%r10d, 4(%rsp)                  # 4-byte Spill
	movl	%r11d, (%rsp)                   # 4-byte Spill
	jmp	.LBB23_104
.LBB23_102:                             #   in Loop: Header=BB23_31 Depth=1
	xorl	%edi, %edi
.LBB23_103:                             # %._crit_edge.thread
                                        #   in Loop: Header=BB23_31 Depth=1
	movq	%rdi, %rax
	movabsq	$3074457345618258603, %rcx      # imm = 0x2AAAAAAAAAAAAAAB
	imulq	%rcx
	movq	%rdi, %rcx
	movq	%rdx, %r12
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$9, %r12
	addq	%rax, %r12
	xorl	%eax, %eax
	movq	%rax, 136(%rsp)                 # 8-byte Spill
	xorl	%r13d, %r13d
	movl	$0, 12(%rsp)                    # 4-byte Folded Spill
	movl	$0, 8(%rsp)                     # 4-byte Folded Spill
	movl	$0, 4(%rsp)                     # 4-byte Folded Spill
	movl	$0, (%rsp)                      # 4-byte Folded Spill
	xorl	%r15d, %r15d
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
.LBB23_104:                             # %._crit_edge342
                                        #   in Loop: Header=BB23_31 Depth=1
	movq	stderr(%rip), %rdi
	movl	$.L.str.20, %esi
	movq	%rcx, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movq	stderr(%rip), %rdi
	movl	$.L.str.21, %esi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movq	stderr(%rip), %rdi
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	$.L.str.22, %esi
	movl	20(%rsp), %edx                  # 4-byte Reload
	movl	16(%rsp), %ecx                  # 4-byte Reload
	movl	12(%rsp), %r8d                  # 4-byte Reload
	movl	8(%rsp), %r9d                   # 4-byte Reload
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_adjust_cfa_offset 8
	pushq	%rbp
	.cfi_adjust_cfa_offset 8
	pushq	%r15
	.cfi_adjust_cfa_offset 8
	callq	fprintf
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movq	stderr(%rip), %rdi
	movl	$.L.str.23, %esi
	movq	136(%rsp), %rdx                 # 8-byte Reload
	xorl	%eax, %eax
	callq	fprintf
	movslq	%r14d, %r14
	addq	%r13, %r14
	cmpq	$24576, %r14                    # imm = 0x6000
	jg	.LBB23_137
# %bb.105:                              #   in Loop: Header=BB23_31 Depth=1
	movq	stderr(%rip), %rdi
	xorl	%ebx, %ebx
	movl	$.L.str.25, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	fprintf
	testl	%r14d, %r14d
	jle	.LBB23_111
# %bb.106:                              # %.lr.ph355.preheader
                                        #   in Loop: Header=BB23_31 Depth=1
	movl	%r14d, %eax
	xorl	%ecx, %ecx
	leaq	13656(%rsp), %rdx
	xorl	%esi, %esi
	xorl	%ebx, %ebx
.LBB23_107:                             # %.lr.ph355
                                        #   Parent Loop BB23_31 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	%esi, %rsi
	addq	(%rdx), %rsi
	movslq	%esi, %rdi
	cmpq	%r12, %rdi
	jl	.LBB23_109
# %bb.108:                              #   in Loop: Header=BB23_107 Depth=2
	movslq	%ebx, %rsi
	incl	%ebx
	movl	%ecx, 1360(%rsp,%rsi,4)
	xorl	%esi, %esi
.LBB23_109:                             #   in Loop: Header=BB23_107 Depth=2
	incq	%rcx
	addq	$24, %rdx
	cmpq	%rcx, %rax
	jne	.LBB23_107
# %bb.110:                              # %.preheader
                                        #   in Loop: Header=BB23_31 Depth=1
	cmpl	$3071, %ebx                     # imm = 0xBFF
	jg	.LBB23_113
.LBB23_111:                             # %.lr.ph358.preheader
                                        #   in Loop: Header=BB23_31 Depth=1
	movslq	%ebx, %rax
	incq	%rax
	movq	%rax, %rcx
.LBB23_112:                             # %.lr.ph358
                                        #   Parent Loop BB23_31 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r14d, 1356(%rsp,%rax,4)
	incq	%rcx
	cmpl	$3072, %eax                     # imm = 0xC00
	movq	%rcx, %rax
	jne	.LBB23_112
.LBB23_113:                             # %._crit_edge359
                                        #   in Loop: Header=BB23_31 Depth=1
	movl	28(%rsp), %edx                  # 4-byte Reload
	addl	$2, %edx
	movq	stderr(%rip), %rdi
	movzbl	%dl, %edx
	movl	$.L.str.13, %esi
	movl	%edx, 28(%rsp)                  # 4-byte Spill
	xorl	%eax, %eax
	callq	fprintf
	movq	40(%rsp), %rdi
	movl	$589824, %edx                   # imm = 0x90000
	leaq	603472(%rsp), %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	je	.LBB23_31
	jmp	.LBB23_131
.LBB23_114:                             #   in Loop: Header=BB23_31 Depth=1
	xorl	%r13d, %r13d
	movl	$0, 12(%rsp)                    # 4-byte Folded Spill
	movl	$0, 8(%rsp)                     # 4-byte Folded Spill
	movl	$0, 4(%rsp)                     # 4-byte Folded Spill
	movl	$0, (%rsp)                      # 4-byte Folded Spill
	xorl	%r15d, %r15d
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	movq	128(%rsp), %rcx                 # 8-byte Reload
	jmp	.LBB23_104
.LBB23_115:
	movq	stderr(%rip), %rdi
	movl	$.L.str.16, %esi
	xorl	%eax, %eax
	callq	fprintf
	movl	603488(%rsp,%rbx), %esi
	movl	$.L.str.17, %edi
	xorl	%eax, %eax
	callq	printf
	movl	13652(%rsp,%rbx), %esi
	movl	$.L.str.18, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 13652(%rsp,%rbx)
	jle	.LBB23_118
# %bb.116:                              # %.lr.ph374
	movl	%ebp, %eax
	leaq	(%rsp,%rax), %r14
	addq	$1979728, %r14                  # imm = 0x1E3550
	xorl	%r15d, %r15d
.LBB23_117:                             # =>This Inner Loop Header: Depth=1
	movsbq	(%r14,%r15), %rax
	movsbl	_ZL8dir_char(%rax), %esi
	movl	$.L.str.19, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r15
	movslq	13652(%rsp,%rbx), %rax
	cmpq	%rax, %r15
	jl	.LBB23_117
.LBB23_118:                             # %._crit_edge375
	movl	$10, %edi
	callq	putchar
	movq	40(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB23_155
# %bb.119:
	movq	112(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB23_156
# %bb.120:
	movq	72(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB23_157
# %bb.121:
	movq	64(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB23_158
# %bb.122:
	movq	96(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB23_159
# %bb.123:
	movq	88(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB23_160
# %bb.124:
	callq	hipDeviceReset
	testl	%eax, %eax
	je	.LBB23_9
# %bb.125:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1561, %edx                     # imm = 0x619
	jmp	.LBB23_154
.LBB23_126:
	movl	$.L.str.30, %edi
	movl	$.L__func__._ZL16pop_int_from_strPKcPPc, %esi
.LBB23_127:
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB23_130
.LBB23_128:
	movl	$.L.str.31, %edi
	movl	$.L__func__._ZL16pop_int_from_strPKcPPc, %esi
	movq	%r12, %rdx
.LBB23_129:
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB23_130
.LBB23_131:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1447, %edx                     # imm = 0x5A7
	jmp	.LBB23_154
.LBB23_132:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1449, %edx                     # imm = 0x5A9
	jmp	.LBB23_154
.LBB23_133:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1453, %edx                     # imm = 0x5AD
	jmp	.LBB23_154
.LBB23_134:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1460, %edx                     # imm = 0x5B4
	jmp	.LBB23_154
.LBB23_135:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1462, %edx                     # imm = 0x5B6
	jmp	.LBB23_154
.LBB23_136:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1463, %edx                     # imm = 0x5B7
	jmp	.LBB23_154
.LBB23_137:
	movq	stderr(%rip), %rcx
	movl	$.L.str.24, %edi
	movl	$20, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	callq	abort
.LBB23_138:
	movl	$.Lstr, %edi
	callq	puts
	jmp	.LBB23_130
.LBB23_139:
	movl	$.L.str.27, %edi
	movl	$.L__func__._ZL20load_state_from_filePKcPh, %esi
	movq	%r14, %rdx
	jmp	.LBB23_129
.LBB23_140:
	movl	$.L.str.28, %edi
	movl	$.L__func__._ZL20load_state_from_filePKcPh, %esi
	jmp	.LBB23_127
.LBB23_141:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1426, %edx                     # imm = 0x592
	jmp	.LBB23_154
.LBB23_142:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1427, %edx                     # imm = 0x593
	jmp	.LBB23_154
.LBB23_143:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1428, %edx                     # imm = 0x594
	jmp	.LBB23_154
.LBB23_144:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1429, %edx                     # imm = 0x595
	jmp	.LBB23_154
.LBB23_145:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1430, %edx                     # imm = 0x596
	jmp	.LBB23_154
.LBB23_146:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1431, %edx                     # imm = 0x597
	jmp	.LBB23_154
.LBB23_147:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1432, %edx                     # imm = 0x598
	jmp	.LBB23_154
.LBB23_148:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1434, %edx                     # imm = 0x59A
	jmp	.LBB23_154
.LBB23_149:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1436, %edx                     # imm = 0x59C
	jmp	.LBB23_154
.LBB23_150:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1438, %edx                     # imm = 0x59E
	jmp	.LBB23_154
.LBB23_151:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1439, %edx                     # imm = 0x59F
	jmp	.LBB23_154
.LBB23_152:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1440, %edx                     # imm = 0x5A0
	jmp	.LBB23_154
.LBB23_153:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1441, %edx                     # imm = 0x5A1
.LBB23_154:                             # %._crit_edge370
	movl	%ebx, %ecx
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	printf
.LBB23_130:
	movl	$1, %edi
	callq	exit
.LBB23_155:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1555, %edx                     # imm = 0x613
	jmp	.LBB23_154
.LBB23_156:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1556, %edx                     # imm = 0x614
	jmp	.LBB23_154
.LBB23_157:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1557, %edx                     # imm = 0x615
	jmp	.LBB23_154
.LBB23_158:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1558, %edx                     # imm = 0x616
	jmp	.LBB23_154
.LBB23_159:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1559, %edx                     # imm = 0x617
	jmp	.LBB23_154
.LBB23_160:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.11, %edi
	movl	$.L.str.12, %esi
	movl	$1560, %edx                     # imm = 0x618
	jmp	.LBB23_154
.Lfunc_end23:
	.size	main, .Lfunc_end23-main
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI23_0:
	.quad	.LBB23_78
	.quad	.LBB23_81
	.quad	.LBB23_79
	.quad	.LBB23_80
                                        # -- End function
	.text
	.type	_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag,@function # -- Begin function _ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag
_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag: # @_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag
	.cfi_startproc
# %bb.0:
	movq	(%rsi), %rdx
	testq	%rdx, %rdx
	je	.LBB24_10
# %bb.1:                                # %.lr.ph35
	xorl	%eax, %eax
.LBB24_2:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB24_3 Depth 2
                                        #       Child Loop BB24_4 Depth 3
                                        #       Child Loop BB24_6 Depth 3
	movq	16(%rsi), %rcx
	movq	(%rcx,%rax,8), %rcx
	testq	%rcx, %rcx
	je	.LBB24_9
.LBB24_3:                               # %.lr.ph
                                        #   Parent Loop BB24_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB24_4 Depth 3
                                        #       Child Loop BB24_6 Depth 3
	movq	8(%rcx), %rdx
	movq	(%rcx), %rcx
	xorl	%r8d, %r8d
.LBB24_4:                               #   Parent Loop BB24_2 Depth=1
                                        #     Parent Loop BB24_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	%r8d, %r9d
	andl	$3, %r9d
	movl	%r8d, %r10d
	shrl	$2, %r10d
	leaq	(%rdx,%r9,4), %r9
	movb	4(%r10,%r9), %r9b
	movb	%r9b, -24(%rsp,%r8)
	incq	%r8
	cmpq	$16, %r8
	jne	.LBB24_4
# %bb.5:                                #   in Loop: Header=BB24_3 Depth=2
	movzbl	-24(%rsp), %r8d
	movl	$1, %r9d
.LBB24_6:                               #   Parent Loop BB24_2 Depth=1
                                        #     Parent Loop BB24_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movzbl	-24(%rsp,%r9), %r10d
	leaq	(%r10,%r8,4), %r8
	incq	%r9
	cmpq	$16, %r9
	jne	.LBB24_6
# %bb.7:                                # %_ZL9korf_hashPh.exit
                                        #   in Loop: Header=BB24_3 Depth=2
	movslq	%r8d, %r9
	andl	$1024, %r8d                     # imm = 0x400
	shll	$5, %r8d
	movq	%r9, 16(%rdi,%r8)
	movaps	-24(%rsp), %xmm0
	movups	%xmm0, (%rdi,%r8)
	movl	(%rdx), %edx
	movl	%edx, 24(%rdi,%r8)
	testq	%rcx, %rcx
	jne	.LBB24_3
# %bb.8:                                # %._crit_edge.loopexit
                                        #   in Loop: Header=BB24_2 Depth=1
	movq	(%rsi), %rdx
.LBB24_9:                               # %._crit_edge
                                        #   in Loop: Header=BB24_2 Depth=1
	incl	%eax
	cmpq	%rax, %rdx
	ja	.LBB24_2
.LBB24_10:                              # %._crit_edge36
	retq
.Lfunc_end24:
	.size	_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag, .Lfunc_end24-_ZL23fill_blacklist_internalP19blacklist_entry_tagP6ht_tag
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB25_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB25_2:
	subq	$32, %rsp
	.cfi_adjust_cfa_offset 32
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movl	$_ZL16assert_direction, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$1, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$_ZL17assert_direction2, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$1, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$__hip_module_dtor, %edi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end25:
	.size	__hip_module_ctor, .Lfunc_end25-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB26_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB26_2:
	retq
.Lfunc_end26:
	.size	__hip_module_dtor, .Lfunc_end26-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb,@object # @_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.section	.rodata,"a",@progbits
	.globl	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.p2align	3, 0x0
_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb:
	.quad	_Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.size	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"malloc failed\n"
	.size	.L.str, 15

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"realloc failed\n"
	.size	.L.str.1, 16

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"empty ptr\n"
	.size	.L.str.2, 11

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"unexpected direction"
	.size	.L.str.3, 21

	.type	_ZL12h_diff_table,@object       # @_ZL12h_diff_table
	.section	.rodata,"a",@progbits
	.p2align	4, 0x0
_ZL12h_diff_table:
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	4294967295                      # 0xffffffff
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.long	1                               # 0x1
	.size	_ZL12h_diff_table, 4096

	.type	.L.str.4,@object                # @.str.4
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.4:
	.asciz	"%s: n_elems=%zu, capa=%zu\n"
	.size	.L.str.4, 27

	.type	.L__func__._Z7pq_dumpP6pq_tag,@object # @__func__._Z7pq_dumpP6pq_tag
.L__func__._Z7pq_dumpP6pq_tag:
	.asciz	"pq_dump"
	.size	.L__func__._Z7pq_dumpP6pq_tag, 8

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"%d,"
	.size	.L.str.6, 4

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"%d "
	.size	.L.str.7, 4

	.type	_ZL6closed,@object              # @_ZL6closed
	.local	_ZL6closed
	.comm	_ZL6closed,8,8
	.type	_ZL3BL1,@object                 # @_ZL3BL1
	.local	_ZL3BL1
	.comm	_ZL3BL1,8,8
	.type	_ZL3BL2,@object                 # @_ZL3BL2
	.local	_ZL3BL2
	.comm	_ZL3BL2,8,8
	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"distr_n=%d, n_worers=%d, cnt=%d\n"
	.size	.L.str.8, 33

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"solution is found by distributor"
	.size	.L.str.10, 33

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Error: %s:%d code:%d, reason: %s\n"
	.size	.L.str.11, 34

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/TakefumiYamamura/sliding-puzzle/master/src_horie/idas_black.hip"
	.size	.L.str.12, 126

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"f=%d\n"
	.size	.L.str.13, 6

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"BL1: %zu, BL2: %zu\n"
	.size	.L.str.14, 20

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"kernel(block=%d, thread=%d)\n"
	.size	.L.str.15, 29

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"core id = %d\n"
	.size	.L.str.16, 14

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"cpu len=%d: \n"
	.size	.L.str.17, 14

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"gpu len=%d: "
	.size	.L.str.18, 13

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"%c "
	.size	.L.str.19, 4

	.type	_ZL8dir_char,@object            # @_ZL8dir_char
	.section	.rodata.cst4,"aM",@progbits,4
_ZL8dir_char:
	.ascii	"URLD"
	.size	_ZL8dir_char, 4

	.type	.L.str.20,@object               # @.str.20
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.20:
	.asciz	"STAT: sum of expanded nodes: %lld\n"
	.size	.L.str.20, 35

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"STAT: avarage expanded nodes: %lld\n"
	.size	.L.str.21, 36

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"STAT: av=%d, 2av=%d, 4av=%d, 8av=%d, 16av=%d, 32av=%d, more=%d\n"
	.size	.L.str.22, 64

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"STAT: sum of pruned nodes: %lld\n"
	.size	.L.str.23, 33

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"cnt_inputs too large"
	.size	.L.str.24, 21

	.type	.L.str.25,@object               # @.str.25
.L.str.25:
	.asciz	"input count: %d\n"
	.size	.L.str.25, 17

	.type	_ZL6from_x,@object              # @_ZL6from_x
	.local	_ZL6from_x
	.comm	_ZL6from_x,16,16
	.type	_ZL6from_y,@object              # @_ZL6from_y
	.local	_ZL6from_y
	.comm	_ZL6from_y,16,16
	.type	.L.str.26,@object               # @.str.26
.L.str.26:
	.asciz	"r"
	.size	.L.str.26, 2

	.type	.L.str.27,@object               # @.str.27
.L.str.27:
	.asciz	"%s: %s cannot be opened\n"
	.size	.L.str.27, 25

	.type	.L__func__._ZL20load_state_from_filePKcPh,@object # @__func__._ZL20load_state_from_filePKcPh
.L__func__._ZL20load_state_from_filePKcPh:
	.asciz	"load_state_from_file"
	.size	.L__func__._ZL20load_state_from_filePKcPh, 21

	.type	.L.str.28,@object               # @.str.28
.L.str.28:
	.asciz	"%s: fgets failed\n"
	.size	.L.str.28, 18

	.type	.L__func__._ZL16pop_int_from_strPKcPPc,@object # @__func__._ZL16pop_int_from_strPKcPPc
.L__func__._ZL16pop_int_from_strPKcPPc:
	.asciz	"pop_int_from_str"
	.size	.L__func__._ZL16pop_int_from_strPKcPPc, 17

	.type	.L.str.30,@object               # @.str.30
.L.str.30:
	.asciz	"%s: reach end of string"
	.size	.L.str.30, 24

	.type	.L.str.31,@object               # @.str.31
.L.str.31:
	.asciz	"%s: too big number, %ld\n"
	.size	.L.str.31, 25

	.type	_ZL16assert_direction,@object   # @_ZL16assert_direction
	.local	_ZL16assert_direction
	.comm	_ZL16assert_direction,1,1
	.type	_ZL17assert_direction2,@object  # @_ZL17assert_direction2
	.local	_ZL17assert_direction2
	.comm	_ZL17assert_direction2,1,1
	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb"
	.size	.L__unnamed_1, 77

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_ZL16assert_direction"
	.size	.L__unnamed_2, 22

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_ZL17assert_direction2"
	.size	.L__unnamed_3, 23

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"usage: bin/cumain <ifname>"
	.size	.Lstr, 27

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z26__device_stub__idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.addrsig_sym _ZL16assert_direction
	.addrsig_sym _ZL17assert_direction2
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb ; -- Begin function _Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.globl	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
	.p2align	8
	.type	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb,@function
_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb: ; @_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
; %bb.0:
	s_load_b128 s[4:7], s[0:1], 0x30
	v_lshlrev_b32_e32 v3, 2, v0
	v_mov_b32_e32 v5, v0
	v_cmp_gt_u32_e32 vcc_lo, 16, v0
	s_mov_b32 s8, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v6, 0xa740, v3
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v1, s2, s6, v3
	v_add_co_ci_u32_e64 v2, null, s7, 0, s2
	s_add_u32 s6, s0, 64
	s_addc_u32 s7, s1, 0
.LBB0_1:                                ; %.preheader45
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	s_and_saveexec_b32 s9, vcc_lo
	s_cbranch_execz .LBB0_4
; %bb.2:                                ; %.lr.ph
                                        ;   in Loop: Header=BB0_1 Depth=1
	s_load_b32 s2, s[6:7], 0xc
	v_dual_mov_b32 v7, v6 :: v_dual_mov_b32 v8, v5
	v_dual_mov_b32 v4, v2 :: v_dual_mov_b32 v3, v1
	s_mov_b32 s12, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s10, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1)
	s_lshl_b32 s11, s10, 2
.LBB0_3:                                ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_u8 v9, v[3:4], off
	v_add_nc_u32_e32 v8, s10, v8
	v_add_co_u32 v3, s2, v3, s11
	v_add_nc_u32_e32 v10, s8, v7
	v_add_co_ci_u32_e64 v4, s2, 0, v4, s2
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_lt_u32_e64 s3, 15, v8
	v_add_nc_u32_e32 v7, s11, v7
	s_or_b32 s12, s3, s12
	s_waitcnt vmcnt(0)
	ds_store_b8 v10, v9
	s_and_not1_b32 exec_lo, exec_lo, s12
	s_cbranch_execnz .LBB0_3
.LBB0_4:                                ; %Flow218
                                        ;   in Loop: Header=BB0_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s9
	v_add_co_u32 v1, s2, v1, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_add_co_ci_u32_e64 v2, s2, 0, v2, s2
	s_add_i32 s8, s8, 1
	s_cmp_lg_u32 s8, 4
	s_cbranch_scc1 .LBB0_1
; %bb.5:                                ; %.preheader43.preheader
	v_dual_mov_b32 v6, 0 :: v_dual_lshlrev_b32 v1, 6, v0
	v_lshl_add_u32 v7, v0, 6, 0xa100
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v1, s2, s4, v1
	v_add_co_ci_u32_e64 v2, null, s5, 0, s2
	s_mov_b32 s4, 0
.LBB0_6:                                ; %.preheader43
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	s_and_saveexec_b32 s5, vcc_lo
	s_cbranch_execz .LBB0_9
; %bb.7:                                ; %.lr.ph54
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_load_b32 s2, s[6:7], 0xc
	v_dual_mov_b32 v8, v5 :: v_dual_and_b32 v3, 3, v6
	s_and_b32 s3, s4, -4
	s_mov_b32 s10, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_or_b32_e32 v9, s3, v3
	v_dual_mov_b32 v4, v2 :: v_dual_mov_b32 v3, v1
	v_add_nc_u32_e32 v9, v7, v9
	s_waitcnt lgkmcnt(0)
	s_and_b32 s8, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1)
	s_lshl_b32 s9, s8, 6
.LBB0_8:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_u8 v10, v[3:4], off
	v_add_nc_u32_e32 v8, s8, v8
	v_add_co_u32 v3, s2, v3, s9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v4, s2, 0, v4, s2
	v_cmp_lt_u32_e64 s3, 15, v8
	s_delay_alu instid0(VALU_DEP_1)
	s_or_b32 s10, s3, s10
	s_waitcnt vmcnt(0)
	ds_store_b8 v9, v10
	v_add_nc_u32_e32 v9, s9, v9
	s_and_not1_b32 exec_lo, exec_lo, s10
	s_cbranch_execnz .LBB0_8
.LBB0_9:                                ; %Flow215
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	v_add_co_u32 v1, s2, v1, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_add_co_ci_u32_e64 v2, s2, 0, v2, s2
	v_add_nc_u16 v6, v6, 1
	s_add_i32 s4, s4, 1
	s_cmp_eq_u32 s4, 64
	s_cbranch_scc0 .LBB0_6
; %bb.10:                               ; %.preheader
	s_load_b128 s[16:19], s[0:1], 0x18
	s_load_b32 s2, s[6:7], 0xc
	v_lshlrev_b32_e32 v1, 5, v0
	v_lshlrev_b32_e32 v3, 5, v0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v1, s3, s16, v1
	v_add_co_ci_u32_e64 v2, null, s17, 0, s3
	s_and_b32 s2, s2, 0xffff
	s_mov_b32 s3, 0
	s_lshl_b32 s4, s2, 5
.LBB0_11:                               ; =>This Inner Loop Header: Depth=1
	s_clause 0x1
	global_load_b128 v[6:9], v[1:2], off offset:16
	global_load_b128 v[10:13], v[1:2], off
	v_add_nc_u32_e32 v5, s2, v5
	v_add_co_u32 v1, vcc_lo, v1, s4
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_cmp_lt_u32_e32 vcc_lo, 0x3ff, v5
	s_waitcnt vmcnt(1)
	ds_store_2addr_b64 v3, v[6:7], v[8:9] offset0:2 offset1:3
	s_waitcnt vmcnt(0)
	ds_store_2addr_b64 v3, v[10:11], v[12:13] offset1:1
	v_add_nc_u32_e32 v3, s4, v3
	s_or_b32 s3, vcc_lo, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB0_11
; %bb.12:
	s_or_b32 exec_lo, exec_lo, s3
	s_load_b128 s[20:23], s[0:1], 0x0
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_mov_b32_e32 v8, 0
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_ashrrev_i32_e32 v2, 31, v1
	v_cmp_ne_u32_e32 vcc_lo, 0, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB0_14
; %bb.13:
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v3, vcc_lo, s22, v1
	v_add_co_ci_u32_e32 v4, vcc_lo, s23, v2, vcc_lo
	global_load_b32 v8, v[3:4], off offset:-4
.LBB0_14:                               ; %._crit_edge98.i
	s_or_b32 exec_lo, exec_lo, s2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, s22, v1
	v_add_co_ci_u32_e32 v5, vcc_lo, s23, v2, vcc_lo
	s_mov_b32 s2, exec_lo
	global_load_b32 v1, v[4:5], off
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i32_e64 v8, v1
	s_cbranch_execz .LBB0_59
; %bb.15:                               ; %.lr.ph91.i
	s_load_b32 s15, s[0:1], 0x28
	s_movk_i32 s0, 0x108
	s_mov_b32 s1, 0x8004
	v_mad_u32_u24 v9, v0, s0, 0x8000
	v_mad_u32_u24 v10, 0x108, v0, s1
	v_mad_u32_u24 v11, v0, 18, 0xa500
	v_mad_u32_u24 v12, v0, 18, 0xa510
	v_mad_u32_u24 v13, v0, 18, 0xa511
	v_mad_u32_u24 v14, v0, 18, 0xa501
	v_mov_b32_e32 v15, 0
	s_mov_b32 s16, 0
	s_mov_b32 s17, 0
.LBB0_16:                               ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
                                        ;     Child Loop BB0_21 Depth 2
                                        ;     Child Loop BB0_23 Depth 2
                                        ;     Child Loop BB0_25 Depth 2
                                        ;       Child Loop BB0_33 Depth 3
                                        ;       Child Loop BB0_36 Depth 3
                                        ;       Child Loop BB0_50 Depth 3
	v_mad_i64_i32 v[1:2], null, v8, 24, s[20:21]
	s_mov_b32 s0, 0
	s_clause 0x2
	global_load_u8 v16, v[1:2], off offset:20
	global_load_b32 v3, v[1:2], off offset:16
	global_load_b128 v[17:20], v[1:2], off
	ds_store_b16 v9, v15
	s_waitcnt vmcnt(1)
	ds_store_b32 v10, v3
	s_waitcnt vmcnt(0)
	s_clause 0x2
	scratch_store_b128 off, v[17:20], off offset:40
	scratch_store_b32 off, v3, off offset:56
	scratch_store_b8 off, v16, off offset:60
.LBB0_17:                               ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_add_i32 s1, s0, 40
	scratch_load_u8 v1, off, s1
	s_mov_b32 s1, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u16_e32 0, v1
	s_cbranch_execz .LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=2
	v_mov_b32_e32 v2, s0
	ds_store_b8 v12, v2
.LBB0_19:                               ;   in Loop: Header=BB0_17 Depth=2
	s_or_b32 exec_lo, exec_lo, s1
	v_add_nc_u32_e32 v2, s0, v11
	s_add_i32 s0, s0, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s0, 16
	ds_store_b8 v2, v1
	s_cbranch_scc1 .LBB0_17
; %bb.20:                               ; %_ZL15state_tile_fill9input_tag.exit.i
                                        ;   in Loop: Header=BB0_16 Depth=1
	s_mov_b32 s22, 0
	ds_store_b8 v13, v15
                                        ; implicit-def: $vgpr18
                                        ; implicit-def: $vgpr26
                                        ; implicit-def: $vgpr25
                                        ; implicit-def: $vgpr27
                                        ; implicit-def: $vgpr19
                                        ; implicit-def: $vgpr7
                                        ; implicit-def: $vgpr22
                                        ; implicit-def: $vgpr23
                                        ; implicit-def: $vgpr2
                                        ; implicit-def: $vgpr21
                                        ; implicit-def: $vgpr20
                                        ; implicit-def: $vgpr24
                                        ; implicit-def: $vgpr3
                                        ; implicit-def: $vgpr1
                                        ; implicit-def: $vgpr6
                                        ; implicit-def: $vgpr17
                                        ; implicit-def: $vgpr37
                                        ; implicit-def: $vgpr42
                                        ; implicit-def: $vgpr43
                                        ; implicit-def: $vgpr40
                                        ; implicit-def: $vgpr38
                                        ; implicit-def: $vgpr34
                                        ; implicit-def: $vgpr39
                                        ; implicit-def: $vgpr41
                                        ; implicit-def: $vgpr29
                                        ; implicit-def: $vgpr35
                                        ; implicit-def: $vgpr36
                                        ; implicit-def: $vgpr32
                                        ; implicit-def: $vgpr30
                                        ; implicit-def: $vgpr28
                                        ; implicit-def: $vgpr31
                                        ; implicit-def: $vgpr33
.LBB0_21:                               ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_add_nc_u32_e32 v45, s22, v11
	v_and_b32_e32 v22, 0xff, v22
	v_lshlrev_b16 v23, 8, v23
	v_and_b32_e32 v20, 0xff, v20
	v_lshlrev_b16 v24, 8, v24
	v_and_b32_e32 v3, 0xff, v3
	v_lshlrev_b16 v1, 8, v1
	v_and_b32_e32 v6, 0xff, v6
	v_lshlrev_b16 v17, 8, v17
	ds_load_u8 v45, v45
	v_and_b32_e32 v43, 0xff, v43
	v_lshlrev_b16 v40, 8, v40
	v_lshlrev_b16 v42, 8, v42
	v_and_b32_e32 v37, 0xff, v37
	v_and_b32_e32 v39, 0xff, v39
	v_lshlrev_b16 v41, 8, v41
	v_and_b32_e32 v36, 0xff, v36
	v_lshlrev_b16 v32, 8, v32
	v_lshlrev_b16 v35, 8, v35
	v_and_b32_e32 v29, 0xff, v29
	v_and_b32_e32 v30, 0xff, v30
	v_lshlrev_b16 v28, 8, v28
	v_and_b32_e32 v19, 0xff, v19
	v_lshlrev_b16 v7, 8, v7
	v_lshlrev_b16 v21, 8, v21
	v_or_b32_e32 v22, v22, v23
	v_or_b32_e32 v23, v20, v24
	v_or_b32_e32 v3, v3, v1
	v_or_b32_e32 v46, v6, v17
	v_or_b32_e32 v43, v43, v40
	v_and_b32_e32 v40, 0xffff, v42
	v_or_b32_e32 v37, v37, v42
	v_or_b32_e32 v39, v39, v41
	v_or_b32_e32 v36, v36, v32
	v_and_b32_e32 v32, 0xffff, v35
	v_or_b32_e32 v35, v29, v35
	v_or_b32_e32 v41, v30, v28
	v_or_b32_e32 v42, v19, v7
	v_and_b32_e32 v20, 0xffff, v21
	v_lshlrev_b32_e32 v19, 16, v23
	v_and_b32_e32 v29, 0xffff, v3
	v_lshlrev_b32_e32 v30, 16, v46
	v_and_b32_e32 v31, 0xff, v31
	v_lshlrev_b16 v33, 8, v33
	v_or_b32_e32 v47, v20, v19
	v_lshlrev_b16 v34, 8, v34
	v_or_b32_e32 v20, v29, v30
	v_and_b32_e32 v25, 0xff, v25
	v_lshlrev_b16 v27, 8, v27
	s_waitcnt lgkmcnt(0)
	v_and_b32_e64 v44, s22, 3
	s_waitcnt lgkmcnt(0)
	v_cmp_eq_u16_e32 vcc_lo, 13, v45
	v_lshrrev_b32_e32 v55, 8, v20
	v_and_b32_e32 v38, 0xff, v38
	v_lshlrev_b16 v26, 8, v26
	v_and_b32_e32 v18, 0xff, v18
	v_or_b32_e32 v33, v31, v33
	v_and_b32_e32 v2, 0xff, v2
	v_or_b32_e32 v38, v38, v34
	v_or_b32_e32 v34, v25, v27
	v_and_b32_e32 v25, 0xffff, v26
	v_or_b32_e32 v26, v18, v26
	v_and_b32_e32 v7, 0xffff, v41
	v_lshlrev_b32_e32 v27, 16, v33
	v_and_b32_e32 v18, 0xffff, v42
	v_lshlrev_b32_e32 v28, 16, v22
	v_or_b32_e32 v21, v2, v21
	v_and_b32_e32 v2, 0xffff, v38
	v_lshlrev_b32_e32 v24, 16, v39
	v_lshlrev_b32_e32 v17, 16, v34
	v_lshlrev_b32_e32 v1, 16, v43
	v_lshlrev_b32_e32 v6, 16, v36
	v_or_b32_e32 v7, v7, v27
	v_or_b32_e32 v18, v18, v28
	v_or_b32_e32 v2, v2, v24
	v_or_b32_e32 v31, v25, v17
	v_or_b32_e32 v40, v40, v1
	v_or_b32_e32 v32, v32, v6
	v_lshrrev_b32_e32 v48, 24, v30
	v_lshrrev_b32_e32 v49, 24, v28
	v_lshrrev_b32_e32 v50, 24, v27
	v_lshrrev_b64 v[27:28], 24, v[17:18]
	v_lshrrev_b64 v[29:30], 24, v[6:7]
	v_lshrrev_b32_e32 v51, 24, v24
	v_lshrrev_b64 v[24:25], 24, v[19:20]
	v_lshrrev_b32_e32 v28, 8, v47
	v_lshrrev_b32_e32 v47, 8, v31
	v_lshrrev_b64 v[30:31], 24, v[1:2]
	v_cndmask_b32_e32 v1, v55, v44, vcc_lo
	v_lshrrev_b32_e32 v52, 8, v2
	v_lshrrev_b32_e32 v53, 8, v7
	v_lshrrev_b32_e32 v54, 8, v18
	v_lshrrev_b32_e32 v56, 8, v32
	v_lshrrev_b32_e32 v57, 8, v40
	v_cmp_eq_u16_e64 s0, 5, v45
	v_cmp_eq_u16_e64 s1, 3, v45
	v_cmp_eq_u16_e64 s2, 12, v45
	v_cmp_eq_u16_e64 s3, 8, v45
	v_cmp_eq_u16_e64 s4, 4, v45
	v_cmp_eq_u16_e64 s5, 0, v45
	v_cmp_eq_u16_e64 s6, 14, v45
	v_cmp_eq_u16_e64 s7, 10, v45
	v_cmp_eq_u16_e64 s8, 6, v45
	v_cmp_eq_u16_e64 s9, 2, v45
	v_cmp_eq_u16_e64 s10, 15, v45
	v_cmp_eq_u16_e64 s11, 7, v45
	v_cmp_eq_u16_e64 s12, 9, v45
	v_cmp_eq_u16_e64 s13, 1, v45
	v_cmp_eq_u16_e64 s14, 11, v45
	s_lshr_b32 s23, s22, 2
	v_cndmask_b32_e64 v7, v54, v44, s0
	v_cndmask_b32_e64 v3, v3, v44, s2
	v_cndmask_b32_e64 v2, v21, v44, s3
	v_cndmask_b32_e64 v19, v42, v44, s4
	v_cndmask_b32_e64 v18, v26, v44, s5
	v_cndmask_b32_e64 v6, v46, v44, s6
	v_cndmask_b32_e64 v20, v23, v44, s7
	v_cndmask_b32_e64 v22, v22, v44, s8
	v_cndmask_b32_e64 v25, v34, v44, s9
	v_cndmask_b32_e64 v17, v48, v44, s10
	v_cndmask_b32_e64 v23, v49, v44, s11
	v_cndmask_b32_e64 v21, v28, v44, s12
	v_cndmask_b32_e64 v26, v47, v44, s13
	v_cndmask_b32_e64 v24, v24, v44, s14
	v_cndmask_b32_e64 v27, v27, v44, s1
	v_cndmask_b32_e64 v28, v53, s23, vcc_lo
	v_cndmask_b32_e64 v34, v52, s23, s0
	v_cndmask_b32_e64 v32, v29, s23, s14
	v_cndmask_b32_e64 v40, v30, s23, s1
	v_cndmask_b32_e64 v30, v41, s23, s2
	v_cndmask_b32_e64 v29, v35, s23, s3
	v_cndmask_b32_e64 v38, v38, s23, s4
	v_cndmask_b32_e64 v37, v37, s23, s5
	v_cndmask_b32_e64 v31, v33, s23, s6
	v_cndmask_b32_e64 v36, v36, s23, s7
	v_cndmask_b32_e64 v39, v39, s23, s8
	v_cndmask_b32_e64 v43, v43, s23, s9
	v_cndmask_b32_e64 v33, v50, s23, s10
	v_cndmask_b32_e64 v41, v51, s23, s11
	v_cndmask_b32_e64 v35, v56, s23, s12
	v_cndmask_b32_e64 v42, v57, s23, s13
	s_add_i32 s22, s22, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s22, 16
	s_cbranch_scc1 .LBB0_21
; %bb.22:                               ; %.preheader.i.i.preheader
                                        ;   in Loop: Header=BB0_16 Depth=1
	v_mov_b32_e32 v44, 0
	s_mov_b64 s[2:3], 0
.LBB0_23:                               ; %.preheader.i.i
                                        ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s2, s2, 1
	s_addc_u32 s3, s3, 0
	s_cmp_eq_u32 s2, 1
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_eq_u32 s2, 2
	v_cndmask_b32_e32 v45, v18, v26, vcc_lo
	v_cndmask_b32_e32 v46, v37, v42, vcc_lo
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_eq_u32 s2, 3
	s_cselect_b32 s0, -1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_dual_cndmask_b32 v45, v45, v25 :: v_dual_cndmask_b32 v46, v46, v43
	s_cmp_eq_u32 s2, 4
	s_cselect_b32 vcc_lo, -1, 0
	v_cndmask_b32_e64 v45, v45, v27, s0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v46, v46, v40, s0
	s_cmp_eq_u32 s2, 5
	s_cselect_b32 s0, -1, 0
	v_dual_cndmask_b32 v45, v45, v19 :: v_dual_cndmask_b32 v46, v46, v38
	s_cmp_eq_u32 s2, 6
	s_cselect_b32 vcc_lo, -1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v45, v45, v7, s0
	v_cndmask_b32_e64 v46, v46, v34, s0
	s_cmp_eq_u32 s2, 7
	s_cselect_b32 s0, -1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_dual_cndmask_b32 v45, v45, v22 :: v_dual_cndmask_b32 v46, v46, v39
	s_cmp_eq_u32 s2, 8
	s_cselect_b32 vcc_lo, -1, 0
	v_cndmask_b32_e64 v45, v45, v23, s0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v46, v46, v41, s0
	s_cmp_eq_u32 s2, 9
	s_cselect_b32 s0, -1, 0
	v_dual_cndmask_b32 v45, v45, v2 :: v_dual_cndmask_b32 v46, v46, v29
	s_cmp_eq_u32 s2, 10
	s_cselect_b32 vcc_lo, -1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v45, v45, v21, s0
	v_cndmask_b32_e64 v46, v46, v35, s0
	s_cmp_eq_u32 s2, 11
	s_cselect_b32 s0, -1, 0
	s_cmp_eq_u32 s2, 12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v46, v46, v36, vcc_lo
	v_cndmask_b32_e64 v46, v46, v32, s0
	v_cndmask_b32_e32 v45, v45, v20, vcc_lo
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_eq_u32 s2, 13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v46, v46, v30, vcc_lo
	v_cndmask_b32_e64 v45, v45, v24, s0
	s_cselect_b32 s0, -1, 0
	s_cmp_eq_u32 s2, 14
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v46, v46, v28, s0
	v_cndmask_b32_e32 v45, v45, v3, vcc_lo
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_eq_u32 s2, 15
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v46, v46, v31, vcc_lo
	v_cndmask_b32_e64 v45, v45, v1, s0
	s_cselect_b32 s0, -1, 0
	s_lshr_b32 s1, s2, 2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v46, v46, v33, s0
	v_cndmask_b32_e32 v45, v45, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v45, v45, v17, s0
	s_and_b32 s0, s2, 3
	s_cmp_lg_u32 s2, 15
	v_and_b32_e32 v45, 0xff, v45
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v47, s0, v45
	v_sub_nc_u32_e32 v48, s0, v45
	v_cmp_lt_u32_e32 vcc_lo, s0, v45
	v_dual_cndmask_b32 v47, v48, v47 :: v_dual_and_b32 v46, 0xff, v46
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_subrev_nc_u32_e32 v45, s1, v46
	v_sub_nc_u32_e32 v49, s1, v46
	v_cmp_lt_u32_e32 vcc_lo, s1, v46
	v_add_nc_u16 v44, v44, v47
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v45, v49, v45, vcc_lo
	v_add_nc_u16 v44, v44, v45
	s_cbranch_scc1 .LBB0_23
; %bb.24:                               ; %_ZL17state_init_hvaluev.exit.i
                                        ;   in Loop: Header=BB0_16 Depth=1
	v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v18, 0
	v_dual_mov_b32 v17, 0 :: v_dual_mov_b32 v2, 0
	v_dual_mov_b32 v21, 0 :: v_dual_mov_b32 v20, 0
	s_mov_b32 s1, 0
	ds_store_b8 v13, v44
.LBB0_25:                               ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_33 Depth 3
                                        ;       Child Loop BB0_36 Depth 3
                                        ;       Child Loop BB0_50 Depth 3
	s_waitcnt lgkmcnt(0)
	v_and_b32_e32 v3, 0xff, v44
	s_mov_b32 s0, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u16_e32 0, v3
	s_cbranch_execz .LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=2
	;;#ASMSTART
	trap;
	;;#ASMEND
	ds_load_u16 v18, v9
	s_waitcnt lgkmcnt(0)
	v_lshrrev_b16 v17, 8, v18
.LBB0_27:                               ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s0
	v_sub_nc_u16 v3, 3, v21
	s_delay_alu instid0(VALU_DEP_2)
	v_and_b32_e32 v19, 0xff, v17
	v_and_b32_e32 v22, 0xff, v18
	v_and_b32_e32 v6, 0xff, v16
	s_mov_b32 s2, 0
	v_and_b32_e32 v3, 0xff, v3
	s_mov_b32 s4, 0
	v_cmp_ne_u16_e32 vcc_lo, v22, v19
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_eq_u16_e64 s0, v3, v6
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s6, s0, -1
	s_and_saveexec_b32 s3, s0
	s_cbranch_execz .LBB0_29
; %bb.28:                               ;   in Loop: Header=BB0_25 Depth=2
	v_mad_u32_u24 v6, 0x108, v0, v22
	s_and_not1_b32 s5, s6, exec_lo
	ds_load_u8 v6, v6 offset:32775
	s_waitcnt lgkmcnt(0)
	v_cmp_ne_u16_e32 vcc_lo, v6, v3
	v_cmp_eq_u16_e64 s0, v6, v3
	s_and_b32 s6, vcc_lo, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 s4, s0, exec_lo
	s_or_b32 s6, s5, s6
.LBB0_29:                               ; %Flow198
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s3
	v_mov_b32_e32 v3, v20
                                        ; implicit-def: $sgpr3
                                        ; implicit-def: $vgpr7
	s_and_saveexec_b32 s5, s6
	s_cbranch_execz .LBB0_47
; %bb.30:                               ;   in Loop: Header=BB0_25 Depth=2
	ds_load_u8 v3, v12
	v_bfe_i32 v6, v21, 0, 8
                                        ; implicit-def: $vgpr23
                                        ; implicit-def: $sgpr3
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_lshl_add_u32 v7, v3, 2, v6
	ds_load_u8 v7, v7 offset:42816
	s_waitcnt lgkmcnt(0)
	v_cmp_eq_u16_e32 vcc_lo, 0, v7
	v_cmp_ne_u16_e64 s0, 0, v7
                                        ; implicit-def: $vgpr7
	s_and_saveexec_b32 s6, s0
	s_cbranch_execz .LBB0_46
; %bb.31:                               ;   in Loop: Header=BB0_25 Depth=2
	v_ashrrev_i32_e32 v7, 31, v6
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, _ZL14pos_diff_table@rel32@lo+4
	s_addc_u32 s3, s3, _ZL14pos_diff_table@rel32@hi+12
	s_mov_b32 s8, -1
	v_lshlrev_b64 v[23:24], 2, v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v23, s0, v23, s2
	v_add_co_ci_u32_e64 v24, s0, s3, v24, s0
	v_add_co_u32 v1, s0, v1, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v2, s0, 0, v2, s0
	global_load_b32 v7, v[23:24], off
	s_mov_b32 s2, 0
                                        ; implicit-def: $sgpr3
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v24, v7, v3
	v_add_nc_u32_e32 v7, v11, v24
	v_lshlrev_b32_e32 v23, 2, v24
	ds_load_u8 v25, v7
	s_waitcnt lgkmcnt(0)
	v_and_b32_e32 v7, 0xff, v25
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b32_e32 v7, 6, v7
	v_add3_u32 v6, v7, v23, v6
	ds_load_i8 v6, v6 offset:41216
	ds_load_u8 v7, v13
	ds_load_b32 v23, v10
	s_waitcnt lgkmcnt(1)
	v_add_nc_u32_e32 v6, v6, v7
	s_waitcnt lgkmcnt(0)
	v_add_nc_u32_e32 v7, v22, v23
                                        ; implicit-def: $vgpr23
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v7, v7, v6, 1
	v_cmp_ge_u32_e64 s0, s15, v7
                                        ; implicit-def: $vgpr7
	s_delay_alu instid0(VALU_DEP_1)
	s_and_saveexec_b32 s7, s0
	s_cbranch_execz .LBB0_45
; %bb.32:                               ; %_ZL21state_move_with_limitaj.exit.i
                                        ;   in Loop: Header=BB0_25 Depth=2
	v_add_nc_u32_e32 v3, v11, v3
	s_mov_b64 s[2:3], 15
	ds_store_b8 v13, v6
	ds_store_b8 v3, v25
	ds_load_u8 v3, v11
	v_mov_b32_e32 v7, s16
	ds_store_b8 v12, v24
	s_waitcnt lgkmcnt(1)
	v_dual_mov_b32 v3, v14 :: v_dual_and_b32 v6, 0xffff, v3
.LBB0_33:                               ;   Parent Loop BB0_16 Depth=1
                                        ;     Parent Loop BB0_25 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ds_load_u8 v23, v3
	v_lshlrev_b64 v[6:7], 2, v[6:7]
	s_add_u32 s2, s2, -1
	v_add_nc_u32_e32 v3, 1, v3
	s_addc_u32 s3, s3, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	s_cmp_lg_u64 s[2:3], 0
	s_waitcnt lgkmcnt(0)
	v_and_b32_e32 v23, 0xffff, v23
	v_add_co_u32 v6, s0, v6, v23
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v7, s0, 0, v7, s0
	s_cbranch_scc1 .LBB0_33
; %bb.34:                               ; %_ZL13korf_hash_devPh.exit.i.i
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_delay_alu instid0(VALU_DEP_2)
	v_and_b32_e32 v3, 0x3ff, v6
	s_mov_b32 s9, -1
	s_mov_b32 s2, 0
	s_mov_b32 s8, 0
	s_mov_b32 s3, exec_lo
	v_lshlrev_b32_e32 v3, 5, v3
	ds_load_2addr_b64 v[23:26], v3 offset0:2 offset1:3
	ds_load_2addr_b64 v[27:30], v3 offset1:1
                                        ; implicit-def: $vgpr3
	s_waitcnt lgkmcnt(1)
	scratch_store_b128 off, v[23:26], off offset:24
	s_waitcnt lgkmcnt(0)
	scratch_store_b128 off, v[27:30], off offset:8
	scratch_load_b64 v[23:24], off, off offset:24
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u64_e64 v[23:24], v[6:7]
	s_cbranch_execz .LBB0_42
; %bb.35:                               ; %.preheader.i81.i.preheader
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_mov_b32 s10, 0
                                        ; implicit-def: $sgpr9
                                        ; implicit-def: $sgpr12
                                        ; implicit-def: $sgpr11
.LBB0_36:                               ; %.preheader.i81.i
                                        ;   Parent Loop BB0_16 Depth=1
                                        ;     Parent Loop BB0_25 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_i32 s0, s10, 8
	v_add_nc_u32_e32 v6, s10, v11
	scratch_load_u8 v3, off, s0
	s_or_b32 s11, s11, exec_lo
	s_or_b32 s12, s12, exec_lo
	s_mov_b32 s13, exec_lo
	ds_load_u8 v6, v6
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_cmpx_eq_u16_e64 v3, v6
; %bb.37:                               ;   in Loop: Header=BB0_36 Depth=3
	s_add_i32 s10, s10, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s10, 16
	s_cselect_b32 s0, -1, 0
	s_and_not1_b32 s12, s12, exec_lo
	s_and_b32 s0, s0, exec_lo
	s_and_not1_b32 s11, s11, exec_lo
	s_or_b32 s12, s12, s0
; %bb.38:                               ; %Flow
                                        ;   in Loop: Header=BB0_36 Depth=3
	s_or_b32 exec_lo, exec_lo, s13
	s_xor_b32 s0, s11, -1
	s_and_b32 s13, exec_lo, s12
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s8, s13, s8
	s_and_not1_b32 s9, s9, exec_lo
	s_and_b32 s0, s0, exec_lo
	s_or_b32 s9, s9, s0
	s_and_not1_b32 exec_lo, exec_lo, s8
	s_cbranch_execnz .LBB0_36
; %bb.39:                               ; %loop.exit.guard
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s8
	s_mov_b32 s0, -1
	s_mov_b32 s8, 0
                                        ; implicit-def: $vgpr3
	s_and_saveexec_b32 s10, s9
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s9, exec_lo, s10
; %bb.40:                               ; %_ZL15blacklist_queryPi.exit.i
                                        ;   in Loop: Header=BB0_25 Depth=2
	v_add_nc_u32_e32 v3, 1, v20
	s_mov_b32 s8, exec_lo
	s_xor_b32 s0, exec_lo, -1
; %bb.41:                               ; %Flow203
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s9
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s8, s8, exec_lo
	s_or_not1_b32 s9, s0, exec_lo
.LBB0_42:                               ; %Flow202
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s3
                                        ; implicit-def: $sgpr3
                                        ; implicit-def: $vgpr7
	s_and_saveexec_b32 s0, s9
	s_cbranch_execz .LBB0_44
; %bb.43:                               ; %.critedge82.i
                                        ;   in Loop: Header=BB0_25 Depth=2
	v_mad_u32_u24 v3, 0x108, v0, v22
	v_add_nc_u16 v7, v18, 1
	s_mov_b32 s2, exec_lo
	s_mov_b32 s3, 0
	ds_store_b8 v3, v21 offset:32776
	ds_store_b8 v9, v7
                                        ; implicit-def: $vgpr3
.LBB0_44:                               ; %Flow204
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s0
	v_dual_mov_b32 v23, v20 :: v_dual_mov_b32 v20, v3
	s_and_b32 s2, s2, exec_lo
	s_or_not1_b32 s8, s8, exec_lo
.LBB0_45:                               ; %Flow201
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s7
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s0, vcc_lo, exec_lo
	s_and_b32 s7, s8, exec_lo
	s_and_b32 s2, s2, exec_lo
	s_or_b32 vcc_lo, s0, s7
.LBB0_46:                               ; %Flow200
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s6
	v_dual_mov_b32 v3, v20 :: v_dual_mov_b32 v20, v23
	s_and_not1_b32 s0, s4, exec_lo
	s_and_b32 s4, vcc_lo, exec_lo
	s_and_b32 s2, s2, exec_lo
	s_or_b32 s4, s0, s4
.LBB0_47:                               ; %Flow199
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s5
	v_mov_b32_e32 v6, s3
	s_and_saveexec_b32 s0, s4
	s_cbranch_execz .LBB0_55
; %bb.48:                               ; %.critedge.i
                                        ;   in Loop: Header=BB0_25 Depth=2
	v_add_nc_u16 v6, v21, 1
	s_mov_b32 s4, -1
	s_mov_b32 s3, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v7, 0xff, v6
	v_cmpx_eq_u16_e32 4, v7
	s_cbranch_execz .LBB0_54
; %bb.49:                               ; %.lr.ph.i.preheader
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_mov_b32 s4, 0
                                        ; implicit-def: $sgpr5
                                        ; implicit-def: $sgpr7
                                        ; implicit-def: $sgpr6
.LBB0_50:                               ; %.lr.ph.i
                                        ;   Parent Loop BB0_16 Depth=1
                                        ;     Parent Loop BB0_25 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	v_and_b32_e32 v6, 0xff, v18
	s_or_b32 s6, s6, exec_lo
	s_or_b32 s7, s7, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ne_u16_e32 vcc_lo, v6, v19
                                        ; implicit-def: $vgpr6
	s_and_saveexec_b32 s8, vcc_lo
	s_cbranch_execz .LBB0_52
; %bb.51:                               ;   in Loop: Header=BB0_50 Depth=3
	v_add_nc_u16 v18, v18, -1
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, _ZL14pos_diff_table@rel32@lo+4
	s_addc_u32 s11, s11, _ZL14pos_diff_table@rel32@hi+12
	s_and_not1_b32 s7, s7, exec_lo
	s_and_not1_b32 s6, s6, exec_lo
	v_and_b32_e32 v6, 0xff, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_mad_u32_u24 v6, 0x108, v0, v6
	ds_load_u8 v22, v6 offset:32776
	ds_load_u16 v23, v12
	s_waitcnt lgkmcnt(1)
	v_sub_nc_u16 v6, 3, v22
	v_bfe_i32 v6, v6, 0, 8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v7, 31, v6
	v_lshlrev_b64 v[20:21], 2, v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v20, vcc_lo, v20, s10
	v_add_co_ci_u32_e32 v21, vcc_lo, s11, v21, vcc_lo
	global_load_b32 v7, v[20:21], off
	s_waitcnt lgkmcnt(0)
	v_and_b32_e32 v20, 0xff, v23
	v_lshrrev_b16 v23, 8, v23
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v7, v7, v20
	v_add_nc_u32_e32 v20, v11, v20
	v_add_nc_u32_e32 v21, v11, v7
	v_lshlrev_b32_e32 v25, 2, v7
	ds_load_u8 v21, v21
	s_waitcnt lgkmcnt(0)
	v_and_b32_e32 v24, 0xff, v21
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b32_e32 v24, 6, v24
	v_add3_u32 v6, v24, v25, v6
	ds_load_u8 v24, v6 offset:41216
	v_add_nc_u16 v6, v22, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v22, 0xff, v6
	v_cmp_ne_u16_e32 vcc_lo, 4, v22
	s_and_b32 s9, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s7, s7, s9
	s_waitcnt lgkmcnt(0)
	v_add_nc_u16 v22, v23, v24
	ds_store_b8 v13, v22
	ds_store_b8 v20, v21
	ds_store_b8 v9, v18
	ds_store_b8 v12, v7
.LBB0_52:                               ; %Flow196
                                        ;   in Loop: Header=BB0_50 Depth=3
	s_or_b32 exec_lo, exec_lo, s8
	s_xor_b32 s8, s6, -1
	s_and_b32 s9, exec_lo, s7
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s4, s9, s4
	s_and_not1_b32 s5, s5, exec_lo
	s_and_b32 s8, s8, exec_lo
	s_or_b32 s5, s5, s8
	s_and_not1_b32 exec_lo, exec_lo, s4
	s_cbranch_execnz .LBB0_50
; %bb.53:                               ; %loop.exit.guard194
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_not1_b32 s4, s5, exec_lo
.LBB0_54:                               ; %Flow206
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s3
	v_dual_mov_b32 v20, v3 :: v_dual_mov_b32 v7, v18
	s_and_not1_b32 s2, s2, exec_lo
	s_and_b32 s3, s4, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s2, s2, s3
.LBB0_55:                               ; %Flow205
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s0
	s_mov_b32 s0, -1
                                        ; implicit-def: $vgpr44
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_57
; %bb.56:                               ; %.backedge.i
                                        ;   in Loop: Header=BB0_25 Depth=2
	ds_load_u8 v44, v13
	s_xor_b32 s0, exec_lo, -1
.LBB0_57:                               ; %Flow207
                                        ;   in Loop: Header=BB0_25 Depth=2
	s_or_b32 exec_lo, exec_lo, s3
	v_dual_mov_b32 v18, v7 :: v_dual_mov_b32 v21, v6
	s_and_b32 s0, exec_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s1, s0, s1
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB0_25
; %bb.58:                               ;   in Loop: Header=BB0_16 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	v_mad_i64_i32 v[6:7], null, v8, 24, s[18:19]
	v_add_nc_u32_e32 v8, 1, v8
	global_store_b96 v[6:7], v[1:3], off offset:8
	global_load_b32 v1, v[4:5], off
	s_waitcnt vmcnt(0)
	v_cmp_ge_i32_e32 vcc_lo, v8, v1
	s_or_b32 s17, vcc_lo, s17
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s17
	s_cbranch_execnz .LBB0_16
.LBB0_59:                               ; %_ZL13idas_internaliP9input_tagPiP15search_stat_tag.exit
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
		.amdhsa_group_segment_fixed_size 42880
		.amdhsa_private_segment_fixed_size 64
		.amdhsa_kernarg_size 320
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 1
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 58
		.amdhsa_next_free_sgpr 24
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb, .Lfunc_end0-_Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4116
; NumSgprs: 26
; NumVgprs: 58
; ScratchSize: 64
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 42880 bytes/workgroup (compile time only)
; SGPRBlocks: 3
; VGPRBlocks: 7
; NumSGPRsForWavesPerEU: 26
; NumVGPRsForWavesPerEU: 58
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 1
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	_ZL17assert_direction2,@object  ; @_ZL17assert_direction2
	.section	.bss,"aw",@nobits
	.globl	_ZL17assert_direction2
_ZL17assert_direction2:
	.zero	1
	.size	_ZL17assert_direction2, 1

	.type	_ZL16assert_direction,@object   ; @_ZL16assert_direction
	.globl	_ZL16assert_direction
_ZL16assert_direction:
	.zero	1
	.size	_ZL16assert_direction, 1

	.type	_ZL14pos_diff_table,@object     ; @_ZL14pos_diff_table
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
_ZL14pos_diff_table:
	.long	4294967292                      ; 0xfffffffc
	.long	1                               ; 0x1
	.long	4294967295                      ; 0xffffffff
	.long	4                               ; 0x4
	.size	_ZL14pos_diff_table, 16

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _ZL17assert_direction2
	.addrsig_sym _ZL16assert_direction
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         48
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         56
        .size:           8
        .value_kind:     global_buffer
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         68
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         72
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         76
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         78
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         80
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         82
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         84
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         86
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         120
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         128
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 42880
    .kernarg_segment_align: 8
    .kernarg_segment_size: 320
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb
    .private_segment_fixed_size: 64
    .sgpr_count:     26
    .sgpr_spill_count: 0
    .symbol:         _Z11idas_kernelP9input_tagPiPaP19blacklist_entry_tagP15search_stat_tagiS2_Pb.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     58
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
