﻿/**
 * Nearest neighbor search
 * マップ内に、店、工場などのゾーンがある確率で配備されている時、
 * 住宅ゾーンから直近の店、工場までのマンハッタン距離を計算する。
 *
 * 各店、工場から周辺に再帰的に距離を更新していくので、O(N)で済む。
 * しかも、GPUで並列化することで、さらに計算時間を短縮できる。
 *
 * shared memoryを使用して高速化できるか？
 */

#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <list>
#include <time.h>

#define CELL_LENGTH 100
#define CITY_SIZE 20 //200
#define GPU_BLOCK_SIZE 20 //40
#define GPU_NUM_THREADS 1 //96
#define GPU_BLOCK_SCALE (1.0)
#define NUM_FEATURES 5
#define QUEUE_MAX 1999
#define MAX_DIST 99

#define CUDA_CALL(x) {if((x) != cudaSuccess){ \
  printf("CUDA error at %s:%d\n",__FILE__,__LINE__); \
  printf("  %s\n", cudaGetErrorString(cudaGetLastError())); \
  exit(EXIT_FAILURE);}} 


struct ZoneType {
	int type;
	int level;
};

struct ZoningPlan {
	ZoneType zones[CITY_SIZE][CITY_SIZE];
};

struct DistanceMap {
	int distances[CITY_SIZE][CITY_SIZE][NUM_FEATURES];
};

struct Point2D {
	int x;
	int y;

	__host__ __device__
	Point2D() : x(0), y(0) {}

	__host__ __device__
	Point2D(int x, int y) : x(x), y(y) {}
};

__host__ __device__
unsigned int rand(unsigned int* randx) {
    *randx = *randx * 1103515245 + 12345;
    return (*randx)&2147483647;
}

__host__ __device__
float randf(unsigned int* randx) {
	return rand(randx) / (float(2147483647) + 1);
}

__host__ __device__
float randf(unsigned int* randx, float a, float b) {
	return randf(randx) * (b - a) + a;
}

__host__ __device__
int sampleFromCdf(unsigned int* randx, float* cdf, int num) {
	float rnd = randf(randx, 0, cdf[num-1]);

	for (int i = 0; i < num; ++i) {
		if (rnd <= cdf[i]) return i;
	}

	return num - 1;
}

__host__ __device__
int sampleFromPdf(unsigned int* randx, float* pdf, int num) {
	if (num == 0) return 0;

	float cdf[40];
	cdf[0] = pdf[0];
	for (int i = 1; i < num; ++i) {
		if (pdf[i] >= 0) {
			cdf[i] = cdf[i - 1] + pdf[i];
		} else {
			cdf[i] = cdf[i - 1];
		}
	}

	return sampleFromCdf(randx, cdf, num);
}

/**
 * ゾーンプランを生成する。
 */
__host__
void generateZoningPlan(ZoningPlan& zoningPlan, std::vector<float> zoneTypeDistribution) {
	std::vector<float> numRemainings(NUM_FEATURES + 1);
	for (int i = 0; i < NUM_FEATURES + 1; ++i) {
		numRemainings[i] = CITY_SIZE * CITY_SIZE * zoneTypeDistribution[i];
	}

	unsigned int randx = 0;

	for (int r = 0; r < CITY_SIZE; ++r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			int type = sampleFromPdf(&randx, numRemainings.data(), numRemainings.size());
			zoningPlan.zones[r][c].type = type;
			numRemainings[type] -= 1;
		}
	}
}

__global__
void generateProposal(ZoningPlan* zoningPlan, unsigned int* randx, int2* cell1, int2* cell2) {
	while (true) {
		int x1 = randf(randx, 0, CITY_SIZE);
		int y1 = randf(randx, 0, CITY_SIZE);
		int x2 = randf(randx, 0, CITY_SIZE);
		int y2 = randf(randx, 0, CITY_SIZE);

		//if (zoningPlan->zones[y1][x1].type != 0 || zoningPlan->zones[y2][x2].type != 0) {
		if (zoningPlan->zones[y1][x1].type == 2 || zoningPlan->zones[y2][x2].type == 2) {
			// swap zone
			int tmp_type = zoningPlan->zones[y1][x1].type;
			zoningPlan->zones[y1][x1].type = zoningPlan->zones[y2][x2].type;
			zoningPlan->zones[y2][x2].type = tmp_type;

			*cell1 = make_int2(x1, y1);
			*cell2 = make_int2(x2, y2);

			break;
		}
	}
}

/**
 * 直近の店までの距離を計算する（マルチスレッド版、shared memory使用）
 */
__global__
void computeDistanceToStore(ZoningPlan* zoningPlan, DistanceMap* distanceMap) {
	__shared__ int sDist[(int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE)][(int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE)][NUM_FEATURES];
	__shared__ uint3 sQueue[QUEUE_MAX + 1];
	__shared__ unsigned int queue_begin;
	__shared__ unsigned int queue_end;

	queue_begin = 0;
	queue_end = 0;
	__syncthreads();

	// global memoryからshared memoryへコピー
	int num_strides = (GPU_BLOCK_SIZE * GPU_BLOCK_SIZE * GPU_BLOCK_SCALE * GPU_BLOCK_SCALE + GPU_NUM_THREADS - 1) / GPU_NUM_THREADS;
	int r0 = blockIdx.y * GPU_BLOCK_SIZE - GPU_BLOCK_SIZE * (GPU_BLOCK_SCALE - 1) * 0.5;
	int c0 = blockIdx.x * GPU_BLOCK_SIZE - GPU_BLOCK_SIZE * (GPU_BLOCK_SCALE - 1) * 0.5;
	for (int i = 0; i < num_strides; ++i) {
		int r1 = (i * GPU_NUM_THREADS + threadIdx.x) / (int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE);
		int c1 = (i * GPU_NUM_THREADS + threadIdx.x) % (int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE);

		// これ、忘れてた！！
		if (r1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE || c1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE) continue;

		int type = 0;
		if (r0 + r1 >= 0 && r0 + r1 < CITY_SIZE && c0 + c1 >= 0 && c0 + c1 < CITY_SIZE) {
			type = zoningPlan->zones[r0 + r1][c0 + c1].type;
		}
		for (int feature_id = 0; feature_id < NUM_FEATURES; ++feature_id) {
			distanceMap->distances[r0 + r1][c0 + c1][feature_id] = MAX_DIST;
			if (type - 1 == feature_id) {
				sDist[r1][c1][feature_id] = 0;
				unsigned int q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(c1, r1, feature_id);
			} else {
				sDist[r1][c1][feature_id] = MAX_DIST;
			}
		}
	}
	__syncthreads();

	// 距離マップを生成
	unsigned int q_index;
	while ((q_index = atomicInc(&queue_begin, QUEUE_MAX)) < queue_end) {
	//while (queue_begin < queue_end) {
		uint3 pt = sQueue[q_index];
		if (pt.x < 0 || pt.x >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE || pt.y < 0 || pt.y >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE) continue;

		int d = sDist[pt.y][pt.x][pt.z];

		if (pt.y > 0) {
			unsigned int old = atomicMin(&sDist[pt.y-1][pt.x][pt.z], d + 1);
			if (old > d + 1) {
				q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(pt.x, pt.y-1, pt.z);
			}
		}
		if (pt.y < CITY_SIZE - 1) {
			unsigned int old = atomicMin(&sDist[pt.y+1][pt.x][pt.z], d + 1);
			if (old > d + 1) {
				q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(pt.x, pt.y+1, pt.z);
			}
		}
		if (pt.x > 0) {
			unsigned int old = atomicMin(&sDist[pt.y][pt.x-1][pt.z], d + 1);
			if (old > d + 1) {
				q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(pt.x-1, pt.y, pt.z);
			}
		}
		if (pt.x < CITY_SIZE - 1) {
			unsigned int old = atomicMin(&sDist[pt.y][pt.x+1][pt.z], d + 1);
			if (old > d + 1) {
				q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(pt.x+1, pt.y, pt.z);
			}
		}
	}

	__syncthreads();

	// global memoryの距離マップへ、コピーする
	for (int i = 0; i < num_strides; ++i) {
		int r1 = (i * GPU_NUM_THREADS + threadIdx.x) / (int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE);
		int c1 = (i * GPU_NUM_THREADS + threadIdx.x) % (int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE);

		// これ、忘れてた！！
		if (r1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE || c1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE) continue;

		if (r0 + r1 >= 0 && r0 + r1 < CITY_SIZE && c0 + c1 >= 0 && c0 + c1 < CITY_SIZE) {
			for (int feature_id = 0; feature_id < NUM_FEATURES; ++feature_id) {
				atomicMin(&distanceMap->distances[r0 + r1][c0 + c1][feature_id], sDist[r1][c1][feature_id]);
			}
		}
	}
}

__device__
float min3(int distToStore, int distToAmusement, int distToFactory) {
	return min(min(distToStore, distToAmusement), distToFactory);
}

__global__
void computeScore(ZoningPlan* zoningPlan, DistanceMap* distanceMap, float* devScore, float* devScores) {
	int num_strides = (GPU_BLOCK_SIZE * GPU_BLOCK_SIZE + GPU_NUM_THREADS - 1) / GPU_NUM_THREADS;

	__shared__ float sScore;
	sScore = 0.0f;
	__syncthreads();

	__shared__ float preference[10][9];
	preference[0][0] = 0; preference[0][1] = 0; preference[0][2] = 0; preference[0][3] = 0; preference[0][4] = 0; preference[0][5] = 0; preference[0][6] = 0; preference[0][7] = 1.0; preference[0][8] = 0;
	/*
	preference[0][0] = 0; preference[0][1] = 0; preference[0][2] = 0.15; preference[0][3] = 0.15; preference[0][4] = 0.3; preference[0][5] = 0; preference[0][6] = 0.1; preference[0][7] = 0.1; preference[0][8] = 0.2;
	preference[1][0] = 0; preference[1][1] = 0; preference[1][2] = 0.15; preference[1][3] = 0; preference[1][4] = 0.55; preference[1][5] = 0; preference[1][6] = 0.2; preference[1][7] = 0.1; preference[1][8] = 0;
	preference[2][0] = 0; preference[2][1] = 0; preference[2][2] = 0.05; preference[2][3] = 0; preference[2][4] = 0; preference[2][5] = 0; preference[2][6] = 0.25; preference[2][7] = 0.1; preference[2][8] = 0.6;
	preference[3][0] = 0.18; preference[3][1] = 0.17; preference[3][2] = 0; preference[3][3] = 0.17; preference[3][4] = 0; preference[3][5] = 0.08; preference[3][6] = 0.2; preference[3][7] = 0.2; preference[3][8] = 0;
	preference[4][0] = 0.3; preference[4][1] = 0; preference[4][2] = 0.3; preference[4][3] = 0.1; preference[4][4] = 0; preference[4][5] = 0; preference[4][6] = 0.1; preference[4][7] = 0.2; preference[4][8] = 0;
	preference[5][0] = 0.05; preference[5][1] = 0; preference[5][2] = 0.1; preference[5][3] = 0.2; preference[5][4] = 0.1; preference[5][5] = 0; preference[5][6] = 0.1; preference[5][7] = 0.15; preference[5][8] = 0.3;
	preference[6][0] = 0.15; preference[6][1] = 0.1; preference[6][2] = 0; preference[6][3] = 0.15; preference[6][4] = 0; preference[6][5] = 0.1; preference[6][6] = 0.1; preference[6][7] = 0.2; preference[6][8] = 0.2;
	preference[7][0] = 0.2; preference[7][1] = 0; preference[7][2] = 0.25; preference[7][3] = 0; preference[7][4] = 0.15; preference[7][5] = 0; preference[7][6] = 0.1; preference[7][7] = 0.1; preference[7][8] = 0.2;
	preference[8][0] = 0.3; preference[8][1] = 0; preference[8][2] = 0.15; preference[8][3] = 0.05; preference[8][4] = 0; preference[8][5] = 0; preference[8][6] = 0.25; preference[8][7] = 0.25; preference[8][8] = 0;
	preference[9][0] = 0.4; preference[9][1] = 0; preference[9][2] = 0.2; preference[9][3] = 0; preference[9][4] = 0; preference[9][5] = 0; preference[9][6] = 0.2; preference[9][7] = 0.2; preference[9][8] = 0;
	*/

	//const float ratioPeople[10] = {0.06667, 0.06667, 0.06667, 0.21, 0.09, 0.09, 0.09, 0.12, 0.1, 0.1};
	const float ratioPeople[10] = {1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};

	float K[] = {0.002, 0.002, 0.001, 0.002, 0.001, 0.001, 0.001, 0.001, 0.001};

	float lScore = 0.0f;

	int r0 = blockIdx.y * GPU_BLOCK_SIZE;
	int c0 = blockIdx.x * GPU_BLOCK_SIZE;
	for (int i = 0; i < num_strides; ++i) {
		float tmpScore = 0.0f;
		int r1 = (i * GPU_NUM_THREADS + threadIdx.x) / GPU_BLOCK_SIZE;
		int c1 = (i * GPU_NUM_THREADS + threadIdx.x) % GPU_BLOCK_SIZE;

		// 対象ブロックの外ならスキップ
		if (r1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE || c1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE) continue;

		// city範囲の外ならスキップ
		if (r0 + r1 < 0 || r0 + r1 >= CITY_SIZE || c0 + c1 < 0 && c0 + c1 >= CITY_SIZE) continue;

		// 住宅ゾーン以外なら、スキップ
		if (zoningPlan->zones[r0 + r1][c0 + c1].type > 0) continue;

		//for (int peopleType = 0; peopleType < 10; ++peopleType) {
		for (int peopleType = 0; peopleType < 1; ++peopleType) {
			tmpScore += exp(-K[0] * distanceMap->distances[r0 + r1][c0 + c1][0] * CELL_LENGTH) * preference[peopleType][0] * ratioPeople[peopleType]; // 店
			tmpScore += exp(-K[1] * distanceMap->distances[r0 + r1][c0 + c1][4] * CELL_LENGTH) * preference[peopleType][1] * ratioPeople[peopleType]; // 学校
			tmpScore += exp(-K[2] * distanceMap->distances[r0 + r1][c0 + c1][0] * CELL_LENGTH) * preference[peopleType][2] * ratioPeople[peopleType]; // レストラン
			tmpScore += exp(-K[3] * distanceMap->distances[r0 + r1][c0 + c1][2] * CELL_LENGTH) * preference[peopleType][3] * ratioPeople[peopleType]; // 公園
			tmpScore += exp(-K[4] * distanceMap->distances[r0 + r1][c0 + c1][3] * CELL_LENGTH) * preference[peopleType][4] * ratioPeople[peopleType]; // アミューズメント
			tmpScore += exp(-K[5] * distanceMap->distances[r0 + r1][c0 + c1][4] * CELL_LENGTH) * preference[peopleType][5] * ratioPeople[peopleType]; // 図書館
			tmpScore += (1.0f - exp(-K[6] * min3(distanceMap->distances[r0 + r1][c0 + c1][0] * CELL_LENGTH, distanceMap->distances[r0 + r1][c0 + c1][3] * CELL_LENGTH, distanceMap->distances[r0 + r1][c0 + c1][1] * CELL_LENGTH))) * preference[peopleType][6] * ratioPeople[peopleType]; // 騒音
			tmpScore += (1.0f - exp(-K[7] * distanceMap->distances[r0 + r1][c0 + c1][1] * CELL_LENGTH)) * preference[peopleType][7] * ratioPeople[peopleType]; // 汚染
		}
		lScore += tmpScore;

		devScores[(r0 + r1) * CITY_SIZE + c0 + c1] = tmpScore;
	}

	atomicAdd(&sScore, lScore);

	__syncthreads();

	atomicAdd(devScore, sScore);
}

__global__
void acceptProposal(ZoningPlan* zoningPlan, float* score, float* proposalScore, int2* cell1, int2* cell2, int* result) {
	if (*proposalScore > *score) {
		*score = *proposalScore;
		*result = 1;
	} else {
		// プランを元に戻す
		int tmp_type = zoningPlan->zones[cell1->y][cell1->x].type;
		zoningPlan->zones[cell1->y][cell1->x].type = zoningPlan->zones[cell2->y][cell2->x].type;
		zoningPlan->zones[cell2->y][cell2->x].type = tmp_type;
		*result = 0;
	}
}

/**
 * 直近の店までの距離を計算する（CPU版）
 */
__host__
void computeDistanceToStoreCPU(ZoningPlan* zoningPLan, DistanceMap* distanceMap) {
	std::list<int3> queue;

	for (int feature_id = 0; feature_id < NUM_FEATURES; ++feature_id) {
		for (int cell_id = 0; cell_id < CITY_SIZE * CITY_SIZE; ++cell_id) {
			int r = cell_id / CITY_SIZE;
			int c = cell_id % CITY_SIZE;

			if (zoningPLan->zones[r][c].type - 1 == feature_id) {
				queue.push_back(make_int3(c, r, feature_id));
				distanceMap->distances[r][c][feature_id] = 0;
			} else {
				distanceMap->distances[r][c][feature_id] = MAX_DIST;
			}
		}
	}

	while (!queue.empty()) {
		int3 pt = queue.front();
		queue.pop_front();

		int d = distanceMap->distances[pt.y][pt.x][pt.z];

		if (pt.y > 0) {
			if (distanceMap->distances[pt.y-1][pt.x][pt.z] > d + 1) {
				distanceMap->distances[pt.y-1][pt.x][pt.z] = d + 1;
				queue.push_back(make_int3(pt.x, pt.y-1, pt.z));
			}
		}
		if (pt.y < CITY_SIZE - 1) {
			if (distanceMap->distances[pt.y+1][pt.x][pt.z] > d + 1) {
				distanceMap->distances[pt.y+1][pt.x][pt.z] = d + 1;
				queue.push_back(make_int3(pt.x, pt.y+1, pt.z));
			}
		}
		if (pt.x > 0) {
			if (distanceMap->distances[pt.y][pt.x-1][pt.z] > d + 1) {
				distanceMap->distances[pt.y][pt.x-1][pt.z] = d + 1;
				queue.push_back(make_int3(pt.x-1, pt.y, pt.z));
			}
		}
		if (pt.x < CITY_SIZE - 1) {
			if (distanceMap->distances[pt.y][pt.x+1][pt.z] > d + 1) {
				distanceMap->distances[pt.y][pt.x+1][pt.z] = d + 1;
				queue.push_back(make_int3(pt.x+1, pt.y, pt.z));
			}
		}
	}
}

int main()
{
	time_t start, end;


	ZoningPlan* hostZoningPlan = (ZoningPlan*)malloc(sizeof(ZoningPlan));
	DistanceMap* hostDistanceMap = (DistanceMap*)malloc(sizeof(DistanceMap));
	DistanceMap* hostDistanceMap2 = (DistanceMap*)malloc(sizeof(DistanceMap));

	// 距離を初期化
	//memset(hostDistanceMap, MAX_DIST, sizeof(DistanceMap));
	//memset(hostDistanceMap2, MAX_DIST, sizeof(DistanceMap));

	std::vector<float> zoneTypeDistribution(6);
	zoneTypeDistribution[0] = 0.5f; // 住宅
	zoneTypeDistribution[1] = 0.2f; // 商業
	zoneTypeDistribution[2] = 0.1f; // 工場
	zoneTypeDistribution[3] = 0.1f; // 公園
	zoneTypeDistribution[4] = 0.05f; // アミューズメント
	zoneTypeDistribution[5] = 0.05f; // 学校・図書館
	
	// 初期プランを生成
	start = clock();
	generateZoningPlan(*hostZoningPlan, zoneTypeDistribution);
	end = clock();
	printf("generateZoningPlan: %lf\n", (double)(end-start)/CLOCKS_PER_SEC);
	
	// デバッグ用
	if (CITY_SIZE <= 100) {
		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				printf("%d, ", hostZoningPlan->zones[r][c].type);
			}
			printf("\n");
		}
		printf("\n");
	}

	// 初期プランをデバイスバッファへコピー
	ZoningPlan* devZoningPlan;
	CUDA_CALL(cudaMalloc((void**)&devZoningPlan, sizeof(ZoningPlan)));
	CUDA_CALL(cudaMemcpy(devZoningPlan, hostZoningPlan, sizeof(ZoningPlan), cudaMemcpyHostToDevice));

	// 距離マップ用に、デバイスバッファを確保
	DistanceMap* devDistanceMap;
	CUDA_CALL(cudaMalloc((void**)&devDistanceMap, sizeof(DistanceMap)));


	///////////////////////////////////////////////////////////////////////
	// CPU版で、直近の店までの距離を計算
	/*
	start = clock();
	for (int iter = 0; iter < 1000; ++iter) {
		computeDistanceToStoreCPU(hostZoningPlan, hostDistanceMap2);
	}
	end = clock();
	printf("computeDistanceToStore CPU: %lf\n", (double)(end-start)/CLOCKS_PER_SEC);
	*/

	int* devQueueStart;
	CUDA_CALL(cudaMalloc((void**)&devQueueStart, sizeof(int)));
	int* devQueueEnd;
	CUDA_CALL(cudaMalloc((void**)&devQueueEnd, sizeof(int)));

	unsigned int* devRand;
	CUDA_CALL(cudaMalloc((void**)&devRand, sizeof(unsigned int)));
	CUDA_CALL(cudaMemset(devRand, 0, sizeof(unsigned int)));

	// 現在プランのスコア
	float* devScore;
	CUDA_CALL(cudaMalloc((void**)&devScore, sizeof(float)));
	CUDA_CALL(cudaMemset(devScore, 0, sizeof(float)));

	// 提案プランのスコア
	float* devProposalScore;
	CUDA_CALL(cudaMalloc((void**)&devProposalScore, sizeof(float)));

	// 交換セル
	int2* devCell1;
	CUDA_CALL(cudaMalloc((void**)&devCell1, sizeof(int2)));
	int2* devCell2;
	CUDA_CALL(cudaMalloc((void**)&devCell2, sizeof(int2)));

	//
	int* devResult;
	CUDA_CALL(cudaMalloc((void**)&devResult, sizeof(int)));



	float* devScores;
	CUDA_CALL(cudaMalloc((void**)&devScores, sizeof(float) * CITY_SIZE * CITY_SIZE));









	printf("start...\n");

	///////////////////////////////////////////////////////////////////////
	// warmp up
	//computeDistanceToStore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap);

	// マルチスレッドで、直近の店までの距離を計算
	start = clock();
	for (int iter = 0; iter < 1000; ++iter) {
		generateProposal<<<1, 1>>>(devZoningPlan, devRand, devCell1, devCell2);

		// 交換したセルを表示
		/*
		int2 cell1, cell2;
		cudaMemcpy(&cell1, devCell1, sizeof(int2), cudaMemcpyDeviceToHost);
		cudaMemcpy(&cell2, devCell2, sizeof(int2), cudaMemcpyDeviceToHost);
		printf("%d,%d <-> %d,%d\n", cell1.x, cell1.y, cell2.x, cell2.y);
		*/

		// 現在のゾーンプランを表示
		/*
		CUDA_CALL(cudaMemcpy(hostZoningPlan, devZoningPlan, sizeof(ZoningPlan), cudaMemcpyDeviceToHost));
		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				printf("%d, ", hostZoningPlan->zones[r][c].type);
			}
			printf("\n");
		}
		*/

		computeDistanceToStore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap);
		cudaDeviceSynchronize();

		CUDA_CALL(cudaMemset(devProposalScore, 0, sizeof(float)));
		computeScore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap, devProposalScore, devScores);
		cudaDeviceSynchronize();

		// 提案プランのスコアを表示
		/*
		float proposalScore;
		CUDA_CALL(cudaMemcpy(&proposalScore, devProposalScore, sizeof(float), cudaMemcpyDeviceToHost));
		printf("Score: %lf\n", proposalScore);
		*/

		acceptProposal<<<1, 1>>>(devZoningPlan, devScore, devProposalScore, devCell1, devCell2, devResult);

		// Accept/reject結果を表示
		/*
		int result;
		CUDA_CALL(cudaMemcpy(&result, devResult, sizeof(int), cudaMemcpyDeviceToHost));
		printf("Accept? %d\n", result);
		*/

	}
	end = clock();
	printf("computeDistanceToStore GPU: %lf\n", (double)(end-start)/CLOCKS_PER_SEC);

	// 距離をCPUバッファへコピー
	computeDistanceToStore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap);
cudaDeviceSynchronize();
	CUDA_CALL(cudaMemcpy(hostDistanceMap, devDistanceMap, sizeof(DistanceMap), cudaMemcpyDeviceToHost));

	for (int r = CITY_SIZE - 1; r >= 0; --r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			printf("%d, ", hostDistanceMap->distances[r][c][1]);
		}
		printf("\n");
	}
	printf("\n");

	// ゾーンプランをCPUバッファへコピー
	CUDA_CALL(cudaMemcpy(hostZoningPlan, devZoningPlan, sizeof(ZoningPlan), cudaMemcpyDeviceToHost));
	for (int r = CITY_SIZE - 1; r >= 0; --r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			printf("%d, ", hostZoningPlan->zones[r][c].type);
		}
		printf("\n");
	}

	FILE* fp = fopen("zone.txt", "w");
	for (int r = 0; r < CITY_SIZE; ++r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			fprintf(fp, "%d,", hostZoningPlan->zones[r][c].type);
		}
		fprintf(fp, "\n");
	}
	fclose(fp);



	// ゾーンプランをスコアを表示
	CUDA_CALL(cudaMemset(devProposalScore, 0, sizeof(float)));
	CUDA_CALL(cudaMemset(devScores, 0, sizeof(float) * CITY_SIZE * CITY_SIZE));
	computeScore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap, devProposalScore, devScores);
	cudaDeviceSynchronize();
	float scores[CITY_SIZE * CITY_SIZE];
	float score;
	CUDA_CALL(cudaMemcpy(scores, devScores, sizeof(float) * CITY_SIZE * CITY_SIZE, cudaMemcpyDeviceToHost));
	CUDA_CALL(cudaMemcpy(&score, devProposalScore, sizeof(float), cudaMemcpyDeviceToHost));
	printf("Score: %lf\n", score);
	for (int r = CITY_SIZE - 1; r >= 0; --r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			printf("%lf, ", scores[r * CITY_SIZE + c]);
		}
		printf("\n");
	}




	/*
	// compare the results with the CPU version of the exact algrotihm
	int bad_k = 0;
	int bad_count = 0;
	{	
		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				for (int k = 0; k < NUM_FEATURES; ++k) {
					if (hostDistanceMap->distances[r][c][k] != hostDistanceMap2->distances[r][c][k]) {
						if (bad_count == 0) {
							printf("ERROR! %d,%d k=%d, %d != %d\n", r, c, k, hostDistanceMap->distances[r][c][k], hostDistanceMap2->distances[r][c][k]);
							bad_k = k;
						}
						bad_count++;
					}
				}
			}

		}
	}

	// for debug
	if (CITY_SIZE <= 200 && bad_count > 0) {
		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				printf("%d, ", hostDistanceMap->distances[r][c][bad_k]);
			}
			printf("\n");
		}
		printf("\n");

		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				printf("%d, ", hostDistanceMap2->distances[r][c][bad_k]);
			}
			printf("\n");
		}
		printf("\n");
	}

	printf("Total error: %d\n", bad_count);
	*/

	// release device buffer
	cudaFree(devZoningPlan);
	cudaFree(devDistanceMap);

	// release host buffer
	free(hostZoningPlan);
	free(hostDistanceMap);
	free(hostDistanceMap2);

	//cudaDeviceReset();
}

	.file	"tmpxft_00246d02_00000000-6_my_mcmc.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3113:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3113:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z4randPj
	.type	_Z4randPj, @function
_Z4randPj:
.LFB3088:
	.cfi_startproc
	endbr64
	imull	$1103515245, (%rdi), %eax
	addl	$12345, %eax
	movl	%eax, (%rdi)
	andl	$2147483647, %eax
	ret
	.cfi_endproc
.LFE3088:
	.size	_Z4randPj, .-_Z4randPj
	.globl	_Z5randfPj
	.type	_Z5randfPj, @function
_Z5randfPj:
.LFB3089:
	.cfi_startproc
	endbr64
	call	_Z4randPj
	movl	%eax, %eax
	cvtsi2ssq	%rax, %xmm0
	mulss	.LC0(%rip), %xmm0
	ret
	.cfi_endproc
.LFE3089:
	.size	_Z5randfPj, .-_Z5randfPj
	.globl	_Z5randfPjff
	.type	_Z5randfPjff, @function
_Z5randfPjff:
.LFB3090:
	.cfi_startproc
	endbr64
	movaps	%xmm0, %xmm2
	call	_Z5randfPj
	subss	%xmm2, %xmm1
	mulss	%xmm0, %xmm1
	addss	%xmm2, %xmm1
	movaps	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE3090:
	.size	_Z5randfPjff, .-_Z5randfPjff
	.globl	_Z13sampleFromCdfPjPfi
	.type	_Z13sampleFromCdfPjPfi, @function
_Z13sampleFromCdfPjPfi:
.LFB3091:
	.cfi_startproc
	endbr64
	movslq	%edx, %rax
	xorps	%xmm0, %xmm0
	movss	-4(%rsi,%rax,4), %xmm1
	call	_Z5randfPjff
	xorl	%eax, %eax
.L8:
	cmpl	%eax, %edx
	jle	.L16
	leaq	1(%rax), %rcx
	movss	-4(%rsi,%rcx,4), %xmm1
	comiss	%xmm0, %xmm1
	jnb	.L7
	movq	%rcx, %rax
	jmp	.L8
.L16:
	leal	-1(%rdx), %eax
.L7:
	ret
	.cfi_endproc
.LFE3091:
	.size	_Z13sampleFromCdfPjPfi, .-_Z13sampleFromCdfPjPfi
	.globl	_Z13sampleFromPdfPjPfi
	.type	_Z13sampleFromPdfPjPfi, @function
_Z13sampleFromPdfPjPfi:
.LFB3092:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movl	%edx, %eax
	movq	%fs:40, %rdx
	movq	%rdx, 168(%rsp)
	xorl	%edx, %edx
	testl	%eax, %eax
	je	.L18
	movss	(%rsi), %xmm0
	movl	$1, %edx
	xorps	%xmm2, %xmm2
	movss	%xmm0, 8(%rsp)
.L19:
	cmpl	%edx, %eax
	leaq	8(%rsp), %rcx
	jle	.L29
	movss	(%rsi,%rdx,4), %xmm1
	movss	4(%rsp,%rdx,4), %xmm0
	comiss	%xmm2, %xmm1
	jb	.L20
	addss	%xmm1, %xmm0
.L20:
	movss	%xmm0, (%rcx,%rdx,4)
	incq	%rdx
	jmp	.L19
.L29:
	movl	%eax, %edx
	movq	%rcx, %rsi
	call	_Z13sampleFromCdfPjPfi
.L18:
	movq	168(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3092:
	.size	_Z13sampleFromPdfPjPfi, .-_Z13sampleFromPdfPjPfi
	.globl	_Z4min3iii
	.type	_Z4min3iii, @function
_Z4min3iii:
.LFB3094:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3094:
	.size	_Z4min3iii, .-_Z4min3iii
	.globl	_Z58__device_stub__Z16generateProposalP10ZoningPlanPjP4int2S3_P10ZoningPlanPjP4int2S3_
	.type	_Z58__device_stub__Z16generateProposalP10ZoningPlanPjP4int2S3_P10ZoningPlanPjP4int2S3_, @function
_Z58__device_stub__Z16generateProposalP10ZoningPlanPjP4int2S3_P10ZoningPlanPjP4int2S3_:
.LFB3135:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L32
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16generateProposalP10ZoningPlanPjP4int2S3_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L32:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3135:
	.size	_Z58__device_stub__Z16generateProposalP10ZoningPlanPjP4int2S3_P10ZoningPlanPjP4int2S3_, .-_Z58__device_stub__Z16generateProposalP10ZoningPlanPjP4int2S3_P10ZoningPlanPjP4int2S3_
	.globl	_Z16generateProposalP10ZoningPlanPjP4int2S3_
	.type	_Z16generateProposalP10ZoningPlanPjP4int2S3_, @function
_Z16generateProposalP10ZoningPlanPjP4int2S3_:
.LFB3136:
	.cfi_startproc
	endbr64
	jmp	_Z58__device_stub__Z16generateProposalP10ZoningPlanPjP4int2S3_P10ZoningPlanPjP4int2S3_
	.cfi_endproc
.LFE3136:
	.size	_Z16generateProposalP10ZoningPlanPjP4int2S3_, .-_Z16generateProposalP10ZoningPlanPjP4int2S3_
	.globl	_Z67__device_stub__Z22computeDistanceToStoreP10ZoningPlanP11DistanceMapP10ZoningPlanP11DistanceMap
	.type	_Z67__device_stub__Z22computeDistanceToStoreP10ZoningPlanP11DistanceMapP10ZoningPlanP11DistanceMap, @function
_Z67__device_stub__Z22computeDistanceToStoreP10ZoningPlanP11DistanceMapP10ZoningPlanP11DistanceMap:
.LFB3137:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L37
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L37:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3137:
	.size	_Z67__device_stub__Z22computeDistanceToStoreP10ZoningPlanP11DistanceMapP10ZoningPlanP11DistanceMap, .-_Z67__device_stub__Z22computeDistanceToStoreP10ZoningPlanP11DistanceMapP10ZoningPlanP11DistanceMap
	.globl	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.type	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap, @function
_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap:
.LFB3138:
	.cfi_startproc
	endbr64
	jmp	_Z67__device_stub__Z22computeDistanceToStoreP10ZoningPlanP11DistanceMapP10ZoningPlanP11DistanceMap
	.cfi_endproc
.LFE3138:
	.size	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap, .-_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.globl	_Z62__device_stub__Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_P10ZoningPlanP11DistanceMapPfS3_
	.type	_Z62__device_stub__Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_P10ZoningPlanP11DistanceMapPfS3_, @function
_Z62__device_stub__Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_P10ZoningPlanP11DistanceMapPfS3_:
.LFB3139:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L42
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L42:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3139:
	.size	_Z62__device_stub__Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_P10ZoningPlanP11DistanceMapPfS3_, .-_Z62__device_stub__Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_P10ZoningPlanP11DistanceMapPfS3_
	.globl	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.type	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_, @function
_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_:
.LFB3140:
	.cfi_startproc
	endbr64
	jmp	_Z62__device_stub__Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_P10ZoningPlanP11DistanceMapPfS3_
	.cfi_endproc
.LFE3140:
	.size	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_, .-_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.globl	_Z61__device_stub__Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_PiP10ZoningPlanPfS1_P4int2S3_Pi
	.type	_Z61__device_stub__Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_PiP10ZoningPlanPfS1_P4int2S3_Pi, @function
_Z61__device_stub__Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_PiP10ZoningPlanPfS1_P4int2S3_Pi:
.LFB3141:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%rsp, %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L47
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_Pi(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L47:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3141:
	.size	_Z61__device_stub__Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_PiP10ZoningPlanPfS1_P4int2S3_Pi, .-_Z61__device_stub__Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_PiP10ZoningPlanPfS1_P4int2S3_Pi
	.globl	_Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_Pi
	.type	_Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_Pi, @function
_Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_Pi:
.LFB3142:
	.cfi_startproc
	endbr64
	jmp	_Z61__device_stub__Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_PiP10ZoningPlanPfS1_P4int2S3_Pi
	.cfi_endproc
.LFE3142:
	.size	_Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_Pi, .-_Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_Pi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"_Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_Pi"
.LC3:
	.string	"_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_"
.LC4:
	.string	"_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap"
.LC5:
	.string	"_Z16generateProposalP10ZoningPlanPjP4int2S3_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3144:
	.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	.LC2(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_Pi(%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	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC3(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC4(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC5(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16generateProposalP10ZoningPlanPjP4int2S3_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.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
.LFE3144:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIfSaIfEED2Ev,"axG",@progbits,_ZNSt6vectorIfSaIfEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEED2Ev
	.type	_ZNSt6vectorIfSaIfEED2Ev, @function
_ZNSt6vectorIfSaIfEED2Ev:
.LFB3202:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L54
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L54:
	ret
	.cfi_endproc
.LFE3202:
	.size	_ZNSt6vectorIfSaIfEED2Ev, .-_ZNSt6vectorIfSaIfEED2Ev
	.weak	_ZNSt6vectorIfSaIfEED1Ev
	.set	_ZNSt6vectorIfSaIfEED1Ev,_ZNSt6vectorIfSaIfEED2Ev
	.section	.text._ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_,"axG",@progbits,_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_,comdat
	.align 2
	.weak	_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_
	.type	_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_, @function
_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_:
.LFB3216:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	movl	$32, %edi
	pushq	%rax
	.cfi_def_cfa_offset 32
	call	_Znwm@PLT
	movq	%rbx, %rsi
	movq	%rax, %rdi
	movq	0(%rbp), %rax
	movq	%rax, 16(%rdi)
	movl	8(%rbp), %eax
	movl	%eax, 24(%rdi)
	call	_ZNSt8__detail15_List_node_base7_M_hookEPS0_@PLT
	incq	16(%rbx)
	popq	%rdx
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3216:
	.size	_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_, .-_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_
	.section	.text._ZNSt7__cxx1110_List_baseI4int3SaIS1_EE8_M_clearEv,"axG",@progbits,_ZNSt7__cxx1110_List_baseI4int3SaIS1_EE8_M_clearEv,comdat
	.align 2
	.weak	_ZNSt7__cxx1110_List_baseI4int3SaIS1_EE8_M_clearEv
	.type	_ZNSt7__cxx1110_List_baseI4int3SaIS1_EE8_M_clearEv, @function
_ZNSt7__cxx1110_List_baseI4int3SaIS1_EE8_M_clearEv:
.LFB3288:
	.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
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 32
	movq	(%rdi), %rdi
.L59:
	cmpq	%rdi, %rbx
	je	.L62
	movq	(%rdi), %rbp
	movl	$32, %esi
	call	_ZdlPvm@PLT
	movq	%rbp, %rdi
	jmp	.L59
.L62:
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3288:
	.size	_ZNSt7__cxx1110_List_baseI4int3SaIS1_EE8_M_clearEv, .-_ZNSt7__cxx1110_List_baseI4int3SaIS1_EE8_M_clearEv
	.text
	.globl	_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap
	.type	_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap, @function
_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap:
.LFB3095:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3095
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	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
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rax
	movq	%rax, 8(%rsp)
	movq	%rax, 72(%rsp)
	movq	%rax, 64(%rsp)
	xorl	%eax, %eax
	movq	%rax, 80(%rsp)
.L64:
	movslq	%r12d, %rax
	xorl	%r13d, %r13d
	movq	%rax, 16(%rsp)
.L66:
	movl	%r13d, %eax
	movl	$20, %edi
	movl	$99, %esi
	cltd
	idivl	%edi
	movslq	%eax, %rbp
	movslq	%edx, %r14
	imulq	$20, %rbp, %rcx
	addq	%r14, %rcx
	movl	(%r15,%rcx,8), %ecx
	decl	%ecx
	cmpl	%r12d, %ecx
	jne	.L65
	movq	8(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movl	%edx, 52(%rsp)
	movl	%eax, 56(%rsp)
	movl	%r12d, 60(%rsp)
.LEHB0:
	call	_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_
	xorl	%esi, %esi
.L65:
	imulq	$100, %rbp, %rbp
	movq	16(%rsp), %rax
	leaq	(%r14,%r14,4), %r14
	incl	%r13d
	addq	%r14, %rbp
	addq	%rax, %rbp
	movl	%esi, (%rbx,%rbp,4)
	cmpl	$400, %r13d
	jne	.L66
	incl	%r12d
	cmpl	$5, %r12d
	jne	.L64
	leaq	52(%rsp), %rax
	movq	%rax, 16(%rsp)
.L67:
	movq	64(%rsp), %r13
	movq	8(%rsp), %rax
	cmpq	%rax, %r13
	je	.L90
	movl	20(%r13), %r12d
	movq	%r13, %rdi
	movl	16(%r13), %ebp
	movslq	24(%r13), %r15
	decq	80(%rsp)
	call	_ZNSt8__detail15_List_node_base9_M_unhookEv@PLT
	movq	%r13, %rdi
	movl	$32, %esi
	call	_ZdlPvm@PLT
	movslq	%r12d, %rax
	movq	%r15, %r14
	movq	%rax, 24(%rsp)
	movslq	%ebp, %rax
	movq	%rax, 40(%rsp)
	imulq	$100, 24(%rsp), %rax
	imulq	$5, 40(%rsp), %rcx
	addq	%rcx, %rax
	addq	%r15, %rax
	testl	%r12d, %r12d
	movl	(%rbx,%rax,4), %eax
	movl	%eax, 36(%rsp)
	leal	1(%rax), %r13d
	jg	.L68
.L72:
	imulq	$5, 40(%rsp), %rcx
	leal	1(%r12), %edx
	movslq	%edx, %rax
	imulq	$100, %rax, %rax
	addq	%rcx, %rax
	addq	%r15, %rax
	cmpl	%r13d, (%rbx,%rax,4)
	jle	.L73
	jmp	.L91
.L68:
	leal	-1(%r12), %edx
	movslq	%edx, %rax
	imulq	$100, %rax, %rax
	addq	%rcx, %rax
	addq	%r15, %rax
	cmpl	%r13d, (%rbx,%rax,4)
	jle	.L71
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	movl	%r13d, (%rbx,%rax,4)
	movl	%ebp, 52(%rsp)
	movl	%edx, 56(%rsp)
	movl	%r15d, 60(%rsp)
	call	_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_
.L71:
	cmpl	$18, %r12d
	jg	.L73
	jmp	.L72
.L91:
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	movl	%r13d, (%rbx,%rax,4)
	movl	%ebp, 52(%rsp)
	movl	%edx, 56(%rsp)
	movl	%r14d, 60(%rsp)
	call	_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_
.L73:
	movl	36(%rsp), %r13d
	incl	%r13d
	testl	%ebp, %ebp
	jg	.L74
.L78:
	imulq	$100, 24(%rsp), %rax
	incl	%ebp
	movslq	%ebp, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	addq	%rdx, %rax
	addq	%r15, %rax
	cmpl	%r13d, (%rbx,%rax,4)
	jle	.L67
	jmp	.L92
.L74:
	imulq	$100, 24(%rsp), %rax
	leal	-1(%rbp), %ecx
	movslq	%ecx, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	addq	%rdx, %rax
	addq	%r15, %rax
	cmpl	%r13d, (%rbx,%rax,4)
	jle	.L77
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	movl	%r13d, (%rbx,%rax,4)
	movl	%ecx, 52(%rsp)
	movl	%r12d, 56(%rsp)
	movl	%r14d, 60(%rsp)
	call	_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_
.L77:
	cmpl	$18, %ebp
	jg	.L67
	jmp	.L78
.L92:
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	movl	%r13d, (%rbx,%rax,4)
	movl	%ebp, 52(%rsp)
	movl	%r12d, 56(%rsp)
	movl	%r14d, 60(%rsp)
	call	_ZNSt7__cxx114listI4int3SaIS1_EE9push_backEOS1_
.LEHE0:
	jmp	.L67
.L90:
	movq	%rax, %rdi
	call	_ZNSt7__cxx1110_List_baseI4int3SaIS1_EE8_M_clearEv
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L83
	jmp	.L88
.L85:
	endbr64
	movq	%rax, %rbx
.L81:
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1110_List_baseI4int3SaIS1_EE8_M_clearEv
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L88
	movq	%rbx, %rdi
.LEHB1:
	call	_Unwind_Resume@PLT
.LEHE1:
.L88:
	call	__stack_chk_fail@PLT
.L83:
	addq	$104, %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
.LFE3095:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3095:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3095-.LLSDACSB3095
.LLSDACSB3095:
	.uleb128 .LEHB0-.LFB3095
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L85-.LFB3095
	.uleb128 0
	.uleb128 .LEHB1-.LFB3095
	.uleb128 .LEHE1-.LEHB1
	.uleb128 0
	.uleb128 0
.LLSDACSE3095:
	.text
	.size	_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap, .-_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap
	.section	.text._ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm,"axG",@progbits,_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm,comdat
	.align 2
	.weak	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm
	.type	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm, @function
_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm:
.LFB3330:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	0(,%rsi,4), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 32
	je	.L97
	movabsq	$2305843009213693951, %rax
	cmpq	%rsi, %rax
	jnb	.L95
	movabsq	$4611686018427387903, %rax
	cmpq	%rsi, %rax
	jnb	.L96
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L96:
	call	_ZSt17__throw_bad_allocv@PLT
.L95:
	movq	%rbp, %rdi
	call	_Znwm@PLT
	jmp	.L94
.L97:
	xorl	%eax, %eax
.L94:
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3330:
	.size	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm, .-_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm
	.section	.rodata._ZNSt6vectorIfSaIfEEC2EmRKS0_.str1.1,"aMS",@progbits,1
.LC6:
	.string	"cannot create std::vector larger than max_size()"
	.section	.text._ZNSt6vectorIfSaIfEEC2EmRKS0_,"axG",@progbits,_ZNSt6vectorIfSaIfEEC5EmRKS0_,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEEC2EmRKS0_
	.type	_ZNSt6vectorIfSaIfEEC2EmRKS0_, @function
_ZNSt6vectorIfSaIfEEC2EmRKS0_:
.LFB3199:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%rcx
	.cfi_def_cfa_offset 32
	cmpq	%rsi, %rax
	jnb	.L100
	leaq	.LC6(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L100:
	xorl	%edx, %edx
	movq	%rdi, %rbp
	movq	%rsi, %rbx
	movq	%rdx, (%rdi)
	movq	%rdx, 8(%rdi)
	movq	%rdx, 16(%rdi)
	call	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm
	movq	0(%rbp), %rax
	testq	%rbx, %rbx
	je	.L101
	movl	$0x00000000, (%rax)
	leaq	4(%rax), %rdx
	decq	%rbx
	je	.L104
	leaq	(%rdx,%rbx,4), %rcx
	movq	%rdx, %rsi
.L102:
	cmpq	%rsi, %rcx
	je	.L109
	movl	$0x00000000, (%rsi)
	addq	$4, %rsi
	jmp	.L102
.L109:
	subq	%rax, %rcx
	leaq	-4(%rdx,%rcx), %rax
	jmp	.L101
.L104:
	movq	%rdx, %rax
.L101:
	movq	%rax, 8(%rbp)
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3199:
	.size	_ZNSt6vectorIfSaIfEEC2EmRKS0_, .-_ZNSt6vectorIfSaIfEEC2EmRKS0_
	.weak	_ZNSt6vectorIfSaIfEEC1EmRKS0_
	.set	_ZNSt6vectorIfSaIfEEC1EmRKS0_,_ZNSt6vectorIfSaIfEEC2EmRKS0_
	.text
	.globl	_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE
	.type	_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE, @function
_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE:
.LFB3093:
	.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	%rsi, %r13
	movl	$6, %esi
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	16(%rsp), %rbp
	movq	%r12, %rdx
	movq	%rbp, %rdi
	call	_ZNSt6vectorIfSaIfEEC1EmRKS0_
	movq	0(%r13), %rdx
	movq	16(%rsp), %r15
	xorl	%eax, %eax
	movss	.LC7(%rip), %xmm1
.L111:
	movss	(%rdx,%rax), %xmm0
	mulss	%xmm1, %xmm0
	movss	%xmm0, (%r15,%rax)
	addq	$4, %rax
	cmpq	$24, %rax
	jne	.L111
	xorl	%eax, %eax
	leaq	3200(%rbx), %r14
	movl	%eax, 12(%rsp)
.L112:
	xorl	%r13d, %r13d
.L113:
	movq	24(%rsp), %rdx
	movq	%r15, %rsi
	movq	%r12, %rdi
	subq	%r15, %rdx
	sarq	$2, %rdx
	call	_Z13sampleFromPdfPjPfi
	movl	%eax, (%rbx,%r13,8)
	cltq
	incq	%r13
	leaq	(%r15,%rax,4), %rax
	movss	(%rax), %xmm0
	subss	.LC8(%rip), %xmm0
	movss	%xmm0, (%rax)
	cmpq	$20, %r13
	jne	.L113
	addq	$160, %rbx
	cmpq	%r14, %rbx
	jne	.L112
	movq	%rbp, %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L115
	call	__stack_chk_fail@PLT
.L115:
	addq	$56, %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
.LFE3093:
	.size	_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE, .-_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE
	.section	.rodata.str1.1
.LC10:
	.string	"generateZoningPlan: %lf\n"
.LC11:
	.string	"%d, "
.LC12:
	.string	"\n"
.LC13:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/gnishida/CUDATest/master/my_mcmc.cu"
.LC14:
	.string	"CUDA error at %s:%d\n"
.LC15:
	.string	"  %s\n"
.LC16:
	.string	"start...\n"
.LC17:
	.string	"computeDistanceToStore GPU: %lf\n"
.LC18:
	.string	"w"
.LC19:
	.string	"zone.txt"
.LC20:
	.string	"%d,"
.LC21:
	.string	"Score: %lf\n"
.LC22:
	.string	"%lf, "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3110:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3110
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$3200, %edi
	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
	subq	$1800, %rsp
	.cfi_def_cfa_offset 1856
	movq	%fs:40, %rax
	movq	%rax, 1784(%rsp)
	xorl	%eax, %eax
	leaq	160(%rsp), %r13
	call	malloc@PLT
	movl	$8000, %edi
	movq	%rax, %rbx
	call	malloc@PLT
	movl	$6, %esi
	movq	%r13, %rdx
	movq	%rax, 8(%rsp)
	leaq	136(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
.LEHB2:
	call	_ZNSt6vectorIfSaIfEEC1EmRKS0_
.LEHE2:
	movq	136(%rsp), %r12
	movabsq	$4489188110478868480, %rax
	movq	%rax, (%r12)
	movabsq	$4453159313439771853, %rax
	movq	%rax, 8(%r12)
	movabsq	$4417130516412419277, %rax
	movq	%rax, 16(%r12)
	call	clock@PLT
	movq	144(%rsp), %rbp
	movq	%r13, %rdi
	movq	%rax, %r14
	xorl	%eax, %eax
	subq	%r12, %rbp
	movq	%rax, 160(%rsp)
	movq	%rbp, %rsi
	movq	%rax, 168(%rsp)
	sarq	$2, %rsi
	movq	%rax, 176(%rsp)
.LEHB3:
	call	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm
.LEHE3:
	movq	160(%rsp), %rcx
	cmpq	$4, %rbp
	jle	.L120
	movq	%rcx, %rdi
	movq	%rbp, %rdx
	movq	%r12, %rsi
	call	memmove@PLT
	movq	%rax, %rcx
	jmp	.L121
.L120:
	jne	.L121
	movss	(%r12), %xmm0
	movss	%xmm0, (%rcx)
.L121:
	addq	%rbp, %rcx
	movq	%r13, %rsi
	movq	%rbx, %rdi
	movq	%rcx, 168(%rsp)
.LEHB4:
	call	_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE
.LEHE4:
	movq	%r13, %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	call	clock@PLT
	leaq	.LC10(%rip), %rsi
	movl	$2, %edi
	subq	%r14, %rax
	cvtsi2sdq	%rax, %xmm0
	movb	$1, %al
	divsd	.LC9(%rip), %xmm0
.LEHB5:
	call	__printf_chk@PLT
	leaq	3040(%rbx), %rbp
	movq	%rbx, %r12
	leaq	.LC11(%rip), %r15
	movq	%rbp, %r14
.L122:
	xorl	%r13d, %r13d
.L123:
	movl	(%r14,%r13,8), %edx
	movq	%r15, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	incq	%r13
	cmpq	$20, %r13
	jne	.L123
	leaq	.LC12(%rip), %r13
	movl	$2, %edi
	xorl	%eax, %eax
	movq	%r13, %rsi
	call	__printf_chk@PLT
	leaq	-160(%r14), %rax
	cmpq	%rbx, %r14
	je	.L124
	movq	%rax, %r14
	jmp	.L122
.L124:
	movq	%r13, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	32(%rsp), %rdi
	movl	$3200, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L125
	movl	$426, %ecx
.L246:
	leaq	.LC13(%rip), %rdx
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movq	%rax, %rdx
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L125:
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movl	$3200, %edx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movl	$427, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	40(%rsp), %rdi
	movl	$8000, %esi
	call	cudaMalloc@PLT
	movl	$431, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	48(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movl	$446, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	56(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movl	$448, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	64(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movl	$451, %ecx
	testl	%eax, %eax
	jne	.L246
	movq	64(%rsp), %rdi
	movl	$4, %edx
	xorl	%esi, %esi
	call	cudaMemset@PLT
	movl	$452, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	72(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movl	$456, %ecx
	testl	%eax, %eax
	jne	.L246
	movq	72(%rsp), %rdi
	movl	$4, %edx
	xorl	%esi, %esi
	call	cudaMemset@PLT
	movl	$457, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	80(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movl	$461, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	88(%rsp), %rdi
	movl	$8, %esi
	call	cudaMalloc@PLT
	movl	$465, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	96(%rsp), %rdi
	movl	$8, %esi
	call	cudaMalloc@PLT
	movl	$467, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	104(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movl	$471, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	112(%rsp), %rdi
	movl	$1600, %esi
	call	cudaMalloc@PLT
	movl	$476, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	call	clock@PLT
	movl	$1000, %r14d
	movabsq	$4294967297, %r13
	movq	%rax, %r15
.L145:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r13, %rdx
	movl	$1, %ecx
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r13, 160(%rsp)
	movl	$1, 168(%rsp)
	movq	%r13, 124(%rsp)
	movl	$1, 132(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L140
	movq	96(%rsp), %rcx
	movq	88(%rsp), %rdx
	movq	64(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z58__device_stub__Z16generateProposalP10ZoningPlanPjP4int2S3_P10ZoningPlanPjP4int2S3_
.L140:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r13, %rdx
	movl	$1, %ecx
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r13, 160(%rsp)
	movl	$1, 168(%rsp)
	movq	%r13, 124(%rsp)
	movl	$1, 132(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L141
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z67__device_stub__Z22computeDistanceToStoreP10ZoningPlanP11DistanceMapP10ZoningPlanP11DistanceMap
.L141:
	call	cudaDeviceSynchronize@PLT
	movq	80(%rsp), %rdi
	movl	$4, %edx
	xorl	%esi, %esi
	call	cudaMemset@PLT
	testl	%eax, %eax
	je	.L142
	movl	$519, %ecx
	jmp	.L246
.L142:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r13, %rdx
	movl	$1, %ecx
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r13, 160(%rsp)
	movl	$1, 168(%rsp)
	movq	%r13, 124(%rsp)
	movl	$1, 132(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L143
	movq	112(%rsp), %rcx
	movq	80(%rsp), %rdx
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z62__device_stub__Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_P10ZoningPlanP11DistanceMapPfS3_
.L143:
	call	cudaDeviceSynchronize@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r13, %rdx
	movl	$1, %ecx
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r13, 160(%rsp)
	movl	$1, 168(%rsp)
	movq	%r13, 124(%rsp)
	movl	$1, 132(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L144
	movq	104(%rsp), %r9
	movq	96(%rsp), %r8
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	movq	72(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z61__device_stub__Z14acceptProposalP10ZoningPlanPfS1_P4int2S3_PiP10ZoningPlanPfS1_P4int2S3_Pi
.L144:
	decl	%r14d
	jne	.L145
	call	clock@PLT
	leaq	.LC17(%rip), %rsi
	movl	$2, %edi
	subq	%r15, %rax
	cvtsi2sdq	%rax, %xmm0
	movb	$1, %al
	divsd	.LC9(%rip), %xmm0
	call	__printf_chk@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 168(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 124(%rsp)
	movq	%rdi, 160(%rsp)
	movl	$1, 132(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L146
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z67__device_stub__Z22computeDistanceToStoreP10ZoningPlanP11DistanceMapP10ZoningPlanP11DistanceMap
.L146:
	call	cudaDeviceSynchronize@PLT
	movq	40(%rsp), %rsi
	movq	8(%rsp), %rdi
	movl	$2, %ecx
	movl	$8000, %edx
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	jne	.L147
	movq	8(%rsp), %rax
	leaq	7600(%rax), %r13
	jmp	.L148
.L147:
	movl	$546, %ecx
	jmp	.L246
.L149:
	movl	4(%r15), %edx
	leaq	.LC11(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$20, %r15
	decl	%r14d
	jne	.L149
	leaq	.LC12(%rip), %r14
	movl	$2, %edi
	xorl	%eax, %eax
	movq	%r14, %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rcx
	leaq	-400(%r13), %rax
	cmpq	%rcx, %r13
	je	.L150
	movq	%rax, %r13
.L148:
	movq	%r13, %r15
	movl	$20, %r14d
	jmp	.L149
.L150:
	movq	%r14, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	32(%rsp), %rsi
	movl	$2, %ecx
	movl	$3200, %edx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	movl	$557, %ecx
	testl	%eax, %eax
	jne	.L246
.L151:
	xorl	%r13d, %r13d
.L152:
	movl	0(%rbp,%r13,8), %edx
	leaq	.LC11(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	incq	%r13
	cmpq	$20, %r13
	jne	.L152
	movq	%r14, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	-160(%rbp), %rax
	cmpq	%rbx, %rbp
	je	.L153
	movq	%rax, %rbp
	jmp	.L151
.L153:
	leaq	.LC18(%rip), %rsi
	leaq	.LC19(%rip), %rdi
	call	fopen@PLT
	movq	%rax, 16(%rsp)
	leaq	3200(%rbx), %r13
	leaq	.LC20(%rip), %r15
.L154:
	xorl	%ebp, %ebp
.L155:
	movl	(%r12,%rbp,8), %ecx
	movq	16(%rsp), %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
	incq	%rbp
	cmpq	$20, %rbp
	jne	.L155
	movq	16(%rsp), %rdi
	movq	%r14, %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	addq	$160, %r12
	cmpq	%r13, %r12
	jne	.L154
	movq	16(%rsp), %rdi
	call	fclose@PLT
	movq	80(%rsp), %rdi
	movl	$4, %edx
	xorl	%esi, %esi
	call	cudaMemset@PLT
	movl	$577, %ecx
	testl	%eax, %eax
	jne	.L246
	movq	112(%rsp), %rdi
	movl	$1600, %edx
	xorl	%esi, %esi
	call	cudaMemset@PLT
	movl	$578, %ecx
	testl	%eax, %eax
	jne	.L246
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 168(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 124(%rsp)
	movq	%rdi, 160(%rsp)
	movl	$1, 132(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L159
	movq	112(%rsp), %rcx
	movq	80(%rsp), %rdx
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z62__device_stub__Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_P10ZoningPlanP11DistanceMapPfS3_
.L159:
	call	cudaDeviceSynchronize@PLT
	movq	112(%rsp), %rsi
	movl	$2, %ecx
	movl	$1600, %edx
	leaq	184(%rsp), %rdi
	call	cudaMemcpy@PLT
	movl	$583, %ecx
	testl	%eax, %eax
	jne	.L246
	movq	80(%rsp), %rsi
	movl	$2, %ecx
	movl	$4, %edx
	leaq	160(%rsp), %rdi
	call	cudaMemcpy@PLT
	movl	$584, %ecx
	testl	%eax, %eax
	jne	.L246
	leaq	.LC21(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	160(%rsp), %xmm0
	call	__printf_chk@PLT
	leaq	1704(%rsp), %r13
	movl	$380, %r12d
	leaq	.LC22(%rip), %r14
.L162:
	xorl	%ebp, %ebp
.L163:
	movq	%r14, %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	0(%r13,%rbp,4), %xmm0
	call	__printf_chk@PLT
	incq	%rbp
	cmpq	$20, %rbp
	jne	.L163
	leaq	.LC12(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	subl	$20, %r12d
	subq	$80, %r13
	cmpl	$-20, %r12d
	jne	.L162
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
.LEHE5:
	movq	%rbx, %rdi
	call	free@PLT
	movq	8(%rsp), %rdi
	call	free@PLT
	leaq	136(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	1784(%rsp), %rax
	subq	%fs:40, %rax
	je	.L168
	jmp	.L180
.L169:
	endbr64
	movq	%rax, %rbx
.L165:
	movq	%r13, %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L166
.L170:
	endbr64
	movq	%rax, %rbx
.L166:
	movq	24(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	1784(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L180
	movq	%rbx, %rdi
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
.L180:
	call	__stack_chk_fail@PLT
.L168:
	addq	$1800, %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
.LFE3110:
	.section	.gcc_except_table
.LLSDA3110:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3110-.LLSDACSB3110
.LLSDACSB3110:
	.uleb128 .LEHB2-.LFB3110
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB3-.LFB3110
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L170-.LFB3110
	.uleb128 0
	.uleb128 .LEHB4-.LFB3110
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L169-.LFB3110
	.uleb128 0
	.uleb128 .LEHB5-.LFB3110
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L170-.LFB3110
	.uleb128 0
	.uleb128 .LEHB6-.LFB3110
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE3110:
	.section	.text.startup
	.size	main, .-main
	.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.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	805306368
	.align 4
.LC7:
	.long	1137180672
	.align 4
.LC8:
	.long	1065353216
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC9:
	.long	0
	.long	1093567616
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.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:

﻿/**
 * Nearest neighbor search
 * マップ内に、店、工場などのゾーンがある確率で配備されている時、
 * 住宅ゾーンから直近の店、工場までのマンハッタン距離を計算する。
 *
 * 各店、工場から周辺に再帰的に距離を更新していくので、O(N)で済む。
 * しかも、GPUで並列化することで、さらに計算時間を短縮できる。
 *
 * shared memoryを使用して高速化できるか？
 */


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <list>
#include <time.h>

#define CELL_LENGTH 100
#define CITY_SIZE 20 //200
#define GPU_BLOCK_SIZE 20 //40
#define GPU_NUM_THREADS 1 //96
#define GPU_BLOCK_SCALE (1.0)
#define NUM_FEATURES 5
#define QUEUE_MAX 1999
#define MAX_DIST 99

#define CUDA_CALL(x) {if((x) != hipSuccess){ \
  printf("CUDA error at %s:%d\n",__FILE__,__LINE__); \
  printf("  %s\n", hipGetErrorString(hipGetLastError())); \
  exit(EXIT_FAILURE);}} 


struct ZoneType {
	int type;
	int level;
};

struct ZoningPlan {
	ZoneType zones[CITY_SIZE][CITY_SIZE];
};

struct DistanceMap {
	int distances[CITY_SIZE][CITY_SIZE][NUM_FEATURES];
};

struct Point2D {
	int x;
	int y;

	__host__ __device__
	Point2D() : x(0), y(0) {}

	__host__ __device__
	Point2D(int x, int y) : x(x), y(y) {}
};

__host__ __device__
unsigned int rand(unsigned int* randx) {
    *randx = *randx * 1103515245 + 12345;
    return (*randx)&2147483647;
}

__host__ __device__
float randf(unsigned int* randx) {
	return rand(randx) / (float(2147483647) + 1);
}

__host__ __device__
float randf(unsigned int* randx, float a, float b) {
	return randf(randx) * (b - a) + a;
}

__host__ __device__
int sampleFromCdf(unsigned int* randx, float* cdf, int num) {
	float rnd = randf(randx, 0, cdf[num-1]);

	for (int i = 0; i < num; ++i) {
		if (rnd <= cdf[i]) return i;
	}

	return num - 1;
}

__host__ __device__
int sampleFromPdf(unsigned int* randx, float* pdf, int num) {
	if (num == 0) return 0;

	float cdf[40];
	cdf[0] = pdf[0];
	for (int i = 1; i < num; ++i) {
		if (pdf[i] >= 0) {
			cdf[i] = cdf[i - 1] + pdf[i];
		} else {
			cdf[i] = cdf[i - 1];
		}
	}

	return sampleFromCdf(randx, cdf, num);
}

/**
 * ゾーンプランを生成する。
 */
__host__
void generateZoningPlan(ZoningPlan& zoningPlan, std::vector<float> zoneTypeDistribution) {
	std::vector<float> numRemainings(NUM_FEATURES + 1);
	for (int i = 0; i < NUM_FEATURES + 1; ++i) {
		numRemainings[i] = CITY_SIZE * CITY_SIZE * zoneTypeDistribution[i];
	}

	unsigned int randx = 0;

	for (int r = 0; r < CITY_SIZE; ++r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			int type = sampleFromPdf(&randx, numRemainings.data(), numRemainings.size());
			zoningPlan.zones[r][c].type = type;
			numRemainings[type] -= 1;
		}
	}
}

__global__
void generateProposal(ZoningPlan* zoningPlan, unsigned int* randx, int2* cell1, int2* cell2) {
	while (true) {
		int x1 = randf(randx, 0, CITY_SIZE);
		int y1 = randf(randx, 0, CITY_SIZE);
		int x2 = randf(randx, 0, CITY_SIZE);
		int y2 = randf(randx, 0, CITY_SIZE);

		//if (zoningPlan->zones[y1][x1].type != 0 || zoningPlan->zones[y2][x2].type != 0) {
		if (zoningPlan->zones[y1][x1].type == 2 || zoningPlan->zones[y2][x2].type == 2) {
			// swap zone
			int tmp_type = zoningPlan->zones[y1][x1].type;
			zoningPlan->zones[y1][x1].type = zoningPlan->zones[y2][x2].type;
			zoningPlan->zones[y2][x2].type = tmp_type;

			*cell1 = make_int2(x1, y1);
			*cell2 = make_int2(x2, y2);

			break;
		}
	}
}

/**
 * 直近の店までの距離を計算する（マルチスレッド版、shared memory使用）
 */
__global__
void computeDistanceToStore(ZoningPlan* zoningPlan, DistanceMap* distanceMap) {
	__shared__ int sDist[(int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE)][(int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE)][NUM_FEATURES];
	__shared__ uint3 sQueue[QUEUE_MAX + 1];
	__shared__ unsigned int queue_begin;
	__shared__ unsigned int queue_end;

	queue_begin = 0;
	queue_end = 0;
	__syncthreads();

	// global memoryからshared memoryへコピー
	int num_strides = (GPU_BLOCK_SIZE * GPU_BLOCK_SIZE * GPU_BLOCK_SCALE * GPU_BLOCK_SCALE + GPU_NUM_THREADS - 1) / GPU_NUM_THREADS;
	int r0 = blockIdx.y * GPU_BLOCK_SIZE - GPU_BLOCK_SIZE * (GPU_BLOCK_SCALE - 1) * 0.5;
	int c0 = blockIdx.x * GPU_BLOCK_SIZE - GPU_BLOCK_SIZE * (GPU_BLOCK_SCALE - 1) * 0.5;
	for (int i = 0; i < num_strides; ++i) {
		int r1 = (i * GPU_NUM_THREADS + threadIdx.x) / (int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE);
		int c1 = (i * GPU_NUM_THREADS + threadIdx.x) % (int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE);

		// これ、忘れてた！！
		if (r1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE || c1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE) continue;

		int type = 0;
		if (r0 + r1 >= 0 && r0 + r1 < CITY_SIZE && c0 + c1 >= 0 && c0 + c1 < CITY_SIZE) {
			type = zoningPlan->zones[r0 + r1][c0 + c1].type;
		}
		for (int feature_id = 0; feature_id < NUM_FEATURES; ++feature_id) {
			distanceMap->distances[r0 + r1][c0 + c1][feature_id] = MAX_DIST;
			if (type - 1 == feature_id) {
				sDist[r1][c1][feature_id] = 0;
				unsigned int q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(c1, r1, feature_id);
			} else {
				sDist[r1][c1][feature_id] = MAX_DIST;
			}
		}
	}
	__syncthreads();

	// 距離マップを生成
	unsigned int q_index;
	while ((q_index = atomicInc(&queue_begin, QUEUE_MAX)) < queue_end) {
	//while (queue_begin < queue_end) {
		uint3 pt = sQueue[q_index];
		if (pt.x < 0 || pt.x >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE || pt.y < 0 || pt.y >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE) continue;

		int d = sDist[pt.y][pt.x][pt.z];

		if (pt.y > 0) {
			unsigned int old = atomicMin(&sDist[pt.y-1][pt.x][pt.z], d + 1);
			if (old > d + 1) {
				q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(pt.x, pt.y-1, pt.z);
			}
		}
		if (pt.y < CITY_SIZE - 1) {
			unsigned int old = atomicMin(&sDist[pt.y+1][pt.x][pt.z], d + 1);
			if (old > d + 1) {
				q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(pt.x, pt.y+1, pt.z);
			}
		}
		if (pt.x > 0) {
			unsigned int old = atomicMin(&sDist[pt.y][pt.x-1][pt.z], d + 1);
			if (old > d + 1) {
				q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(pt.x-1, pt.y, pt.z);
			}
		}
		if (pt.x < CITY_SIZE - 1) {
			unsigned int old = atomicMin(&sDist[pt.y][pt.x+1][pt.z], d + 1);
			if (old > d + 1) {
				q_index = atomicInc(&queue_end, QUEUE_MAX);
				sQueue[q_index] = make_uint3(pt.x+1, pt.y, pt.z);
			}
		}
	}

	__syncthreads();

	// global memoryの距離マップへ、コピーする
	for (int i = 0; i < num_strides; ++i) {
		int r1 = (i * GPU_NUM_THREADS + threadIdx.x) / (int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE);
		int c1 = (i * GPU_NUM_THREADS + threadIdx.x) % (int)(GPU_BLOCK_SIZE * GPU_BLOCK_SCALE);

		// これ、忘れてた！！
		if (r1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE || c1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE) continue;

		if (r0 + r1 >= 0 && r0 + r1 < CITY_SIZE && c0 + c1 >= 0 && c0 + c1 < CITY_SIZE) {
			for (int feature_id = 0; feature_id < NUM_FEATURES; ++feature_id) {
				atomicMin(&distanceMap->distances[r0 + r1][c0 + c1][feature_id], sDist[r1][c1][feature_id]);
			}
		}
	}
}

__device__
float min3(int distToStore, int distToAmusement, int distToFactory) {
	return min(min(distToStore, distToAmusement), distToFactory);
}

__global__
void computeScore(ZoningPlan* zoningPlan, DistanceMap* distanceMap, float* devScore, float* devScores) {
	int num_strides = (GPU_BLOCK_SIZE * GPU_BLOCK_SIZE + GPU_NUM_THREADS - 1) / GPU_NUM_THREADS;

	__shared__ float sScore;
	sScore = 0.0f;
	__syncthreads();

	__shared__ float preference[10][9];
	preference[0][0] = 0; preference[0][1] = 0; preference[0][2] = 0; preference[0][3] = 0; preference[0][4] = 0; preference[0][5] = 0; preference[0][6] = 0; preference[0][7] = 1.0; preference[0][8] = 0;
	/*
	preference[0][0] = 0; preference[0][1] = 0; preference[0][2] = 0.15; preference[0][3] = 0.15; preference[0][4] = 0.3; preference[0][5] = 0; preference[0][6] = 0.1; preference[0][7] = 0.1; preference[0][8] = 0.2;
	preference[1][0] = 0; preference[1][1] = 0; preference[1][2] = 0.15; preference[1][3] = 0; preference[1][4] = 0.55; preference[1][5] = 0; preference[1][6] = 0.2; preference[1][7] = 0.1; preference[1][8] = 0;
	preference[2][0] = 0; preference[2][1] = 0; preference[2][2] = 0.05; preference[2][3] = 0; preference[2][4] = 0; preference[2][5] = 0; preference[2][6] = 0.25; preference[2][7] = 0.1; preference[2][8] = 0.6;
	preference[3][0] = 0.18; preference[3][1] = 0.17; preference[3][2] = 0; preference[3][3] = 0.17; preference[3][4] = 0; preference[3][5] = 0.08; preference[3][6] = 0.2; preference[3][7] = 0.2; preference[3][8] = 0;
	preference[4][0] = 0.3; preference[4][1] = 0; preference[4][2] = 0.3; preference[4][3] = 0.1; preference[4][4] = 0; preference[4][5] = 0; preference[4][6] = 0.1; preference[4][7] = 0.2; preference[4][8] = 0;
	preference[5][0] = 0.05; preference[5][1] = 0; preference[5][2] = 0.1; preference[5][3] = 0.2; preference[5][4] = 0.1; preference[5][5] = 0; preference[5][6] = 0.1; preference[5][7] = 0.15; preference[5][8] = 0.3;
	preference[6][0] = 0.15; preference[6][1] = 0.1; preference[6][2] = 0; preference[6][3] = 0.15; preference[6][4] = 0; preference[6][5] = 0.1; preference[6][6] = 0.1; preference[6][7] = 0.2; preference[6][8] = 0.2;
	preference[7][0] = 0.2; preference[7][1] = 0; preference[7][2] = 0.25; preference[7][3] = 0; preference[7][4] = 0.15; preference[7][5] = 0; preference[7][6] = 0.1; preference[7][7] = 0.1; preference[7][8] = 0.2;
	preference[8][0] = 0.3; preference[8][1] = 0; preference[8][2] = 0.15; preference[8][3] = 0.05; preference[8][4] = 0; preference[8][5] = 0; preference[8][6] = 0.25; preference[8][7] = 0.25; preference[8][8] = 0;
	preference[9][0] = 0.4; preference[9][1] = 0; preference[9][2] = 0.2; preference[9][3] = 0; preference[9][4] = 0; preference[9][5] = 0; preference[9][6] = 0.2; preference[9][7] = 0.2; preference[9][8] = 0;
	*/

	//const float ratioPeople[10] = {0.06667, 0.06667, 0.06667, 0.21, 0.09, 0.09, 0.09, 0.12, 0.1, 0.1};
	const float ratioPeople[10] = {1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};

	float K[] = {0.002, 0.002, 0.001, 0.002, 0.001, 0.001, 0.001, 0.001, 0.001};

	float lScore = 0.0f;

	int r0 = blockIdx.y * GPU_BLOCK_SIZE;
	int c0 = blockIdx.x * GPU_BLOCK_SIZE;
	for (int i = 0; i < num_strides; ++i) {
		float tmpScore = 0.0f;
		int r1 = (i * GPU_NUM_THREADS + threadIdx.x) / GPU_BLOCK_SIZE;
		int c1 = (i * GPU_NUM_THREADS + threadIdx.x) % GPU_BLOCK_SIZE;

		// 対象ブロックの外ならスキップ
		if (r1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE || c1 >= GPU_BLOCK_SIZE * GPU_BLOCK_SCALE) continue;

		// city範囲の外ならスキップ
		if (r0 + r1 < 0 || r0 + r1 >= CITY_SIZE || c0 + c1 < 0 && c0 + c1 >= CITY_SIZE) continue;

		// 住宅ゾーン以外なら、スキップ
		if (zoningPlan->zones[r0 + r1][c0 + c1].type > 0) continue;

		//for (int peopleType = 0; peopleType < 10; ++peopleType) {
		for (int peopleType = 0; peopleType < 1; ++peopleType) {
			tmpScore += exp(-K[0] * distanceMap->distances[r0 + r1][c0 + c1][0] * CELL_LENGTH) * preference[peopleType][0] * ratioPeople[peopleType]; // 店
			tmpScore += exp(-K[1] * distanceMap->distances[r0 + r1][c0 + c1][4] * CELL_LENGTH) * preference[peopleType][1] * ratioPeople[peopleType]; // 学校
			tmpScore += exp(-K[2] * distanceMap->distances[r0 + r1][c0 + c1][0] * CELL_LENGTH) * preference[peopleType][2] * ratioPeople[peopleType]; // レストラン
			tmpScore += exp(-K[3] * distanceMap->distances[r0 + r1][c0 + c1][2] * CELL_LENGTH) * preference[peopleType][3] * ratioPeople[peopleType]; // 公園
			tmpScore += exp(-K[4] * distanceMap->distances[r0 + r1][c0 + c1][3] * CELL_LENGTH) * preference[peopleType][4] * ratioPeople[peopleType]; // アミューズメント
			tmpScore += exp(-K[5] * distanceMap->distances[r0 + r1][c0 + c1][4] * CELL_LENGTH) * preference[peopleType][5] * ratioPeople[peopleType]; // 図書館
			tmpScore += (1.0f - exp(-K[6] * min3(distanceMap->distances[r0 + r1][c0 + c1][0] * CELL_LENGTH, distanceMap->distances[r0 + r1][c0 + c1][3] * CELL_LENGTH, distanceMap->distances[r0 + r1][c0 + c1][1] * CELL_LENGTH))) * preference[peopleType][6] * ratioPeople[peopleType]; // 騒音
			tmpScore += (1.0f - exp(-K[7] * distanceMap->distances[r0 + r1][c0 + c1][1] * CELL_LENGTH)) * preference[peopleType][7] * ratioPeople[peopleType]; // 汚染
		}
		lScore += tmpScore;

		devScores[(r0 + r1) * CITY_SIZE + c0 + c1] = tmpScore;
	}

	atomicAdd(&sScore, lScore);

	__syncthreads();

	atomicAdd(devScore, sScore);
}

__global__
void acceptProposal(ZoningPlan* zoningPlan, float* score, float* proposalScore, int2* cell1, int2* cell2, int* result) {
	if (*proposalScore > *score) {
		*score = *proposalScore;
		*result = 1;
	} else {
		// プランを元に戻す
		int tmp_type = zoningPlan->zones[cell1->y][cell1->x].type;
		zoningPlan->zones[cell1->y][cell1->x].type = zoningPlan->zones[cell2->y][cell2->x].type;
		zoningPlan->zones[cell2->y][cell2->x].type = tmp_type;
		*result = 0;
	}
}

/**
 * 直近の店までの距離を計算する（CPU版）
 */
__host__
void computeDistanceToStoreCPU(ZoningPlan* zoningPLan, DistanceMap* distanceMap) {
	std::list<int3> queue;

	for (int feature_id = 0; feature_id < NUM_FEATURES; ++feature_id) {
		for (int cell_id = 0; cell_id < CITY_SIZE * CITY_SIZE; ++cell_id) {
			int r = cell_id / CITY_SIZE;
			int c = cell_id % CITY_SIZE;

			if (zoningPLan->zones[r][c].type - 1 == feature_id) {
				queue.push_back(make_int3(c, r, feature_id));
				distanceMap->distances[r][c][feature_id] = 0;
			} else {
				distanceMap->distances[r][c][feature_id] = MAX_DIST;
			}
		}
	}

	while (!queue.empty()) {
		int3 pt = queue.front();
		queue.pop_front();

		int d = distanceMap->distances[pt.y][pt.x][pt.z];

		if (pt.y > 0) {
			if (distanceMap->distances[pt.y-1][pt.x][pt.z] > d + 1) {
				distanceMap->distances[pt.y-1][pt.x][pt.z] = d + 1;
				queue.push_back(make_int3(pt.x, pt.y-1, pt.z));
			}
		}
		if (pt.y < CITY_SIZE - 1) {
			if (distanceMap->distances[pt.y+1][pt.x][pt.z] > d + 1) {
				distanceMap->distances[pt.y+1][pt.x][pt.z] = d + 1;
				queue.push_back(make_int3(pt.x, pt.y+1, pt.z));
			}
		}
		if (pt.x > 0) {
			if (distanceMap->distances[pt.y][pt.x-1][pt.z] > d + 1) {
				distanceMap->distances[pt.y][pt.x-1][pt.z] = d + 1;
				queue.push_back(make_int3(pt.x-1, pt.y, pt.z));
			}
		}
		if (pt.x < CITY_SIZE - 1) {
			if (distanceMap->distances[pt.y][pt.x+1][pt.z] > d + 1) {
				distanceMap->distances[pt.y][pt.x+1][pt.z] = d + 1;
				queue.push_back(make_int3(pt.x+1, pt.y, pt.z));
			}
		}
	}
}

int main()
{
	time_t start, end;


	ZoningPlan* hostZoningPlan = (ZoningPlan*)malloc(sizeof(ZoningPlan));
	DistanceMap* hostDistanceMap = (DistanceMap*)malloc(sizeof(DistanceMap));
	DistanceMap* hostDistanceMap2 = (DistanceMap*)malloc(sizeof(DistanceMap));

	// 距離を初期化
	//memset(hostDistanceMap, MAX_DIST, sizeof(DistanceMap));
	//memset(hostDistanceMap2, MAX_DIST, sizeof(DistanceMap));

	std::vector<float> zoneTypeDistribution(6);
	zoneTypeDistribution[0] = 0.5f; // 住宅
	zoneTypeDistribution[1] = 0.2f; // 商業
	zoneTypeDistribution[2] = 0.1f; // 工場
	zoneTypeDistribution[3] = 0.1f; // 公園
	zoneTypeDistribution[4] = 0.05f; // アミューズメント
	zoneTypeDistribution[5] = 0.05f; // 学校・図書館
	
	// 初期プランを生成
	start = clock();
	generateZoningPlan(*hostZoningPlan, zoneTypeDistribution);
	end = clock();
	printf("generateZoningPlan: %lf\n", (double)(end-start)/CLOCKS_PER_SEC);
	
	// デバッグ用
	if (CITY_SIZE <= 100) {
		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				printf("%d, ", hostZoningPlan->zones[r][c].type);
			}
			printf("\n");
		}
		printf("\n");
	}

	// 初期プランをデバイスバッファへコピー
	ZoningPlan* devZoningPlan;
	CUDA_CALL(hipMalloc((void**)&devZoningPlan, sizeof(ZoningPlan)));
	CUDA_CALL(hipMemcpy(devZoningPlan, hostZoningPlan, sizeof(ZoningPlan), hipMemcpyHostToDevice));

	// 距離マップ用に、デバイスバッファを確保
	DistanceMap* devDistanceMap;
	CUDA_CALL(hipMalloc((void**)&devDistanceMap, sizeof(DistanceMap)));


	///////////////////////////////////////////////////////////////////////
	// CPU版で、直近の店までの距離を計算
	/*
	start = clock();
	for (int iter = 0; iter < 1000; ++iter) {
		computeDistanceToStoreCPU(hostZoningPlan, hostDistanceMap2);
	}
	end = clock();
	printf("computeDistanceToStore CPU: %lf\n", (double)(end-start)/CLOCKS_PER_SEC);
	*/

	int* devQueueStart;
	CUDA_CALL(hipMalloc((void**)&devQueueStart, sizeof(int)));
	int* devQueueEnd;
	CUDA_CALL(hipMalloc((void**)&devQueueEnd, sizeof(int)));

	unsigned int* devRand;
	CUDA_CALL(hipMalloc((void**)&devRand, sizeof(unsigned int)));
	CUDA_CALL(hipMemset(devRand, 0, sizeof(unsigned int)));

	// 現在プランのスコア
	float* devScore;
	CUDA_CALL(hipMalloc((void**)&devScore, sizeof(float)));
	CUDA_CALL(hipMemset(devScore, 0, sizeof(float)));

	// 提案プランのスコア
	float* devProposalScore;
	CUDA_CALL(hipMalloc((void**)&devProposalScore, sizeof(float)));

	// 交換セル
	int2* devCell1;
	CUDA_CALL(hipMalloc((void**)&devCell1, sizeof(int2)));
	int2* devCell2;
	CUDA_CALL(hipMalloc((void**)&devCell2, sizeof(int2)));

	//
	int* devResult;
	CUDA_CALL(hipMalloc((void**)&devResult, sizeof(int)));



	float* devScores;
	CUDA_CALL(hipMalloc((void**)&devScores, sizeof(float) * CITY_SIZE * CITY_SIZE));









	printf("start...\n");

	///////////////////////////////////////////////////////////////////////
	// warmp up
	//computeDistanceToStore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap);

	// マルチスレッドで、直近の店までの距離を計算
	start = clock();
	for (int iter = 0; iter < 1000; ++iter) {
		generateProposal<<<1, 1>>>(devZoningPlan, devRand, devCell1, devCell2);

		// 交換したセルを表示
		/*
		int2 cell1, cell2;
		cudaMemcpy(&cell1, devCell1, sizeof(int2), cudaMemcpyDeviceToHost);
		cudaMemcpy(&cell2, devCell2, sizeof(int2), cudaMemcpyDeviceToHost);
		printf("%d,%d <-> %d,%d\n", cell1.x, cell1.y, cell2.x, cell2.y);
		*/

		// 現在のゾーンプランを表示
		/*
		CUDA_CALL(cudaMemcpy(hostZoningPlan, devZoningPlan, sizeof(ZoningPlan), cudaMemcpyDeviceToHost));
		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				printf("%d, ", hostZoningPlan->zones[r][c].type);
			}
			printf("\n");
		}
		*/

		computeDistanceToStore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap);
		hipDeviceSynchronize();

		CUDA_CALL(hipMemset(devProposalScore, 0, sizeof(float)));
		computeScore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap, devProposalScore, devScores);
		hipDeviceSynchronize();

		// 提案プランのスコアを表示
		/*
		float proposalScore;
		CUDA_CALL(cudaMemcpy(&proposalScore, devProposalScore, sizeof(float), cudaMemcpyDeviceToHost));
		printf("Score: %lf\n", proposalScore);
		*/

		acceptProposal<<<1, 1>>>(devZoningPlan, devScore, devProposalScore, devCell1, devCell2, devResult);

		// Accept/reject結果を表示
		/*
		int result;
		CUDA_CALL(cudaMemcpy(&result, devResult, sizeof(int), cudaMemcpyDeviceToHost));
		printf("Accept? %d\n", result);
		*/

	}
	end = clock();
	printf("computeDistanceToStore GPU: %lf\n", (double)(end-start)/CLOCKS_PER_SEC);

	// 距離をCPUバッファへコピー
	computeDistanceToStore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap);
hipDeviceSynchronize();
	CUDA_CALL(hipMemcpy(hostDistanceMap, devDistanceMap, sizeof(DistanceMap), hipMemcpyDeviceToHost));

	for (int r = CITY_SIZE - 1; r >= 0; --r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			printf("%d, ", hostDistanceMap->distances[r][c][1]);
		}
		printf("\n");
	}
	printf("\n");

	// ゾーンプランをCPUバッファへコピー
	CUDA_CALL(hipMemcpy(hostZoningPlan, devZoningPlan, sizeof(ZoningPlan), hipMemcpyDeviceToHost));
	for (int r = CITY_SIZE - 1; r >= 0; --r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			printf("%d, ", hostZoningPlan->zones[r][c].type);
		}
		printf("\n");
	}

	FILE* fp = fopen("zone.txt", "w");
	for (int r = 0; r < CITY_SIZE; ++r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			fprintf(fp, "%d,", hostZoningPlan->zones[r][c].type);
		}
		fprintf(fp, "\n");
	}
	fclose(fp);



	// ゾーンプランをスコアを表示
	CUDA_CALL(hipMemset(devProposalScore, 0, sizeof(float)));
	CUDA_CALL(hipMemset(devScores, 0, sizeof(float) * CITY_SIZE * CITY_SIZE));
	computeScore<<<dim3(CITY_SIZE / GPU_BLOCK_SIZE, CITY_SIZE / GPU_BLOCK_SIZE), GPU_NUM_THREADS>>>(devZoningPlan, devDistanceMap, devProposalScore, devScores);
	hipDeviceSynchronize();
	float scores[CITY_SIZE * CITY_SIZE];
	float score;
	CUDA_CALL(hipMemcpy(scores, devScores, sizeof(float) * CITY_SIZE * CITY_SIZE, hipMemcpyDeviceToHost));
	CUDA_CALL(hipMemcpy(&score, devProposalScore, sizeof(float), hipMemcpyDeviceToHost));
	printf("Score: %lf\n", score);
	for (int r = CITY_SIZE - 1; r >= 0; --r) {
		for (int c = 0; c < CITY_SIZE; ++c) {
			printf("%lf, ", scores[r * CITY_SIZE + c]);
		}
		printf("\n");
	}




	/*
	// compare the results with the CPU version of the exact algrotihm
	int bad_k = 0;
	int bad_count = 0;
	{	
		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				for (int k = 0; k < NUM_FEATURES; ++k) {
					if (hostDistanceMap->distances[r][c][k] != hostDistanceMap2->distances[r][c][k]) {
						if (bad_count == 0) {
							printf("ERROR! %d,%d k=%d, %d != %d\n", r, c, k, hostDistanceMap->distances[r][c][k], hostDistanceMap2->distances[r][c][k]);
							bad_k = k;
						}
						bad_count++;
					}
				}
			}

		}
	}

	// for debug
	if (CITY_SIZE <= 200 && bad_count > 0) {
		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				printf("%d, ", hostDistanceMap->distances[r][c][bad_k]);
			}
			printf("\n");
		}
		printf("\n");

		for (int r = CITY_SIZE - 1; r >= 0; --r) {
			for (int c = 0; c < CITY_SIZE; ++c) {
				printf("%d, ", hostDistanceMap2->distances[r][c][bad_k]);
			}
			printf("\n");
		}
		printf("\n");
	}

	printf("Total error: %d\n", bad_count);
	*/

	// release device buffer
	hipFree(devZoningPlan);
	hipFree(devDistanceMap);

	// release host buffer
	free(hostZoningPlan);
	free(hostDistanceMap);
	free(hostDistanceMap2);

	//cudaDeviceReset();
}

	.text
	.file	"my_mcmc.hip"
	.globl	_Z4randPj                       # -- Begin function _Z4randPj
	.type	_Z4randPj,@function
_Z4randPj:                              # @_Z4randPj
	.cfi_startproc
# %bb.0:
	imull	$1103515245, (%rdi), %eax       # imm = 0x41C64E6D
	addl	$12345, %eax                    # imm = 0x3039
	movl	%eax, (%rdi)
	andl	$2147483647, %eax               # imm = 0x7FFFFFFF
	retq
.Lfunc_end0:
	.size	_Z4randPj, .Lfunc_end0-_Z4randPj
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z5randfPj
.LCPI1_0:
	.long	0x30000000                      # float 4.65661287E-10
	.text
	.globl	_Z5randfPj
	.type	_Z5randfPj,@function
_Z5randfPj:                             # @_Z5randfPj
	.cfi_startproc
# %bb.0:
	imull	$1103515245, (%rdi), %eax       # imm = 0x41C64E6D
	addl	$12345, %eax                    # imm = 0x3039
	movl	%eax, (%rdi)
	andl	$2147483647, %eax               # imm = 0x7FFFFFFF
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI1_0(%rip), %xmm0
	retq
.Lfunc_end1:
	.size	_Z5randfPj, .Lfunc_end1-_Z5randfPj
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z5randfPjff
.LCPI2_0:
	.long	0x30000000                      # float 4.65661287E-10
	.text
	.globl	_Z5randfPjff
	.type	_Z5randfPjff,@function
_Z5randfPjff:                           # @_Z5randfPjff
	.cfi_startproc
# %bb.0:
	imull	$1103515245, (%rdi), %eax       # imm = 0x41C64E6D
	addl	$12345, %eax                    # imm = 0x3039
	movl	%eax, (%rdi)
	andl	$2147483647, %eax               # imm = 0x7FFFFFFF
	cvtsi2ss	%eax, %xmm2
	mulss	.LCPI2_0(%rip), %xmm2
	subss	%xmm0, %xmm1
	mulss	%xmm1, %xmm2
	addss	%xmm2, %xmm0
	retq
.Lfunc_end2:
	.size	_Z5randfPjff, .Lfunc_end2-_Z5randfPjff
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z13sampleFromCdfPjPfi
.LCPI3_0:
	.long	0x30000000                      # float 4.65661287E-10
	.text
	.globl	_Z13sampleFromCdfPjPfi
	.type	_Z13sampleFromCdfPjPfi,@function
_Z13sampleFromCdfPjPfi:                 # @_Z13sampleFromCdfPjPfi
	.cfi_startproc
# %bb.0:
                                        # kill: def $edx killed $edx def $rdx
	imull	$1103515245, (%rdi), %ecx       # imm = 0x41C64E6D
	addl	$12345, %ecx                    # imm = 0x3039
	movl	%ecx, %eax
	andl	$2147483647, %eax               # imm = 0x7FFFFFFF
	cvtsi2ss	%eax, %xmm0
	leal	-1(%rdx), %eax
	movslq	%edx, %r8
	mulss	.LCPI3_0(%rip), %xmm0
	mulss	-4(%rsi,%r8,4), %xmm0
	movl	%ecx, (%rdi)
	testl	%r8d, %r8d
	jle	.LBB3_5
# %bb.1:                                # %.lr.ph.preheader
	xorps	%xmm1, %xmm1
	addss	%xmm1, %xmm0
	movl	%edx, %edx
	xorl	%ecx, %ecx
.LBB3_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rsi,%rcx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	jae	.LBB3_4
# %bb.3:                                #   in Loop: Header=BB3_2 Depth=1
	incq	%rcx
	cmpq	%rcx, %rdx
	jne	.LBB3_2
.LBB3_5:                                # %._crit_edge
	retq
.LBB3_4:                                # %._crit_edge.loopexit.split.loop.exit
	movl	%ecx, %eax
	retq
.Lfunc_end3:
	.size	_Z13sampleFromCdfPjPfi, .Lfunc_end3-_Z13sampleFromCdfPjPfi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z13sampleFromPdfPjPfi
.LCPI4_0:
	.long	0x80000000                      # float -0
	.text
	.globl	_Z13sampleFromPdfPjPfi
	.type	_Z13sampleFromPdfPjPfi,@function
_Z13sampleFromPdfPjPfi:                 # @_Z13sampleFromPdfPjPfi
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	je	.LBB4_1
# %bb.2:
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movss	(%rsi), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsp)
	cmpl	$2, %edx
	jl	.LBB4_5
# %bb.3:                                # %.lr.ph.preheader
	movl	%edx, %eax
	movl	$1, %ecx
	movss	.LCPI4_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
.LBB4_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rsi,%rcx,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	xorps	%xmm3, %xmm3
	cmpnless	%xmm2, %xmm3
	movaps	%xmm3, %xmm4
	andnps	%xmm2, %xmm4
	andps	%xmm1, %xmm3
	orps	%xmm4, %xmm3
	addss	%xmm3, %xmm0
	movss	%xmm0, (%rsp,%rcx,4)
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB4_4
.LBB4_5:                                # %._crit_edge
	movq	%rsp, %rsi
	callq	_Z13sampleFromCdfPjPfi
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	retq
.LBB4_1:
	xorl	%eax, %eax
	retq
.Lfunc_end4:
	.size	_Z13sampleFromPdfPjPfi, .Lfunc_end4-_Z13sampleFromPdfPjPfi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE
.LCPI5_0:
	.long	0x43c80000                      # float 400
.LCPI5_1:
	.long	0xbf800000                      # float -1
	.text
	.globl	_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE
	.type	_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE,@function
_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE: # @_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE
	.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	$16, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	$24, %edi
	callq	_Znwm
	movq	%rax, %r14
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movq	$0, 16(%rax)
	movq	(%r15), %rax
	xorl	%ecx, %ecx
	movss	.LCPI5_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
.LBB5_1:                                # =>This Inner Loop Header: Depth=1
	movss	(%rax,%rcx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	movss	%xmm1, (%r14,%rcx,4)
	incq	%rcx
	cmpq	$6, %rcx
	jne	.LBB5_1
# %bb.2:
	leaq	12(%rsp), %r15
	movl	$0, (%r15)
	xorl	%r12d, %r12d
.LBB5_3:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_4 Depth 2
	xorl	%r13d, %r13d
.LBB5_4:                                #   Parent Loop BB5_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$6, %edx
	callq	_Z13sampleFromPdfPjPfi
	movss	.LCPI5_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movl	%eax, (%rbx,%r13,8)
	cltq
	movss	(%r14,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm0
	movss	%xmm0, (%r14,%rax,4)
	incq	%r13
	cmpq	$20, %r13
	jne	.LBB5_4
# %bb.5:                                #   in Loop: Header=BB5_3 Depth=1
	incq	%r12
	addq	$160, %rbx
	cmpq	$20, %r12
	jne	.LBB5_3
# %bb.6:                                # %_ZNSt6vectorIfSaIfEED2Ev.exit
	movq	%r14, %rdi
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	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
	jmp	_ZdlPv                          # TAILCALL
.Lfunc_end5:
	.size	_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE, .Lfunc_end5-_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE
	.cfi_endproc
                                        # -- End function
	.globl	_Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_ # -- Begin function _Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.type	_Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_,@function
_Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_: # @_Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.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	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	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_end6:
	.size	_Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_, .Lfunc_end6-_Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.cfi_endproc
                                        # -- End function
	.globl	_Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap # -- Begin function _Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.type	_Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap,@function
_Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap: # @_Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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_end7:
	.size	_Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap, .Lfunc_end7-_Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_ # -- Begin function _Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.type	_Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_,@function
_Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_: # @_Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.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	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	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_end8:
	.size	_Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_, .Lfunc_end8-_Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi # -- Begin function _Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.type	_Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi,@function
_Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi: # @_Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.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	$144, %rsp
	.cfi_def_cfa_offset 192
	.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	16(%rsp), %r8
	movq	%r9, (%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	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	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_end9:
	.size	_Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi, .Lfunc_end9-_Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.cfi_endproc
                                        # -- End function
	.globl	_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap # -- Begin function _Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap
	.type	_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap,@function
_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap: # @_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %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	$72, %rsp
	.cfi_def_cfa_offset 128
	.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	%rsi, %rbx
	movq	%rdi, %r15
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rax)
	movq	%rax, (%rax)
	movq	$0, 16(%rax)
	xorl	%r14d, %r14d
	movabsq	$-3689348814741910323, %rbp     # imm = 0xCCCCCCCCCCCCCCCD
	movq	%rsi, 56(%rsp)                  # 8-byte Spill
.LBB10_1:                               # %.preheader151
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_2 Depth 2
	movq	%rbx, 16(%rsp)                  # 8-byte Spill
	xorl	%r12d, %r12d
.LBB10_2:                               #   Parent Loop BB10_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%r12, %rax
	mulq	%rbp
	movl	(%r15,%r12,8), %ecx
	decl	%ecx
	movl	$99, %eax
	cmpq	%rcx, %r14
	jne	.LBB10_5
# %bb.3:                                #   in Loop: Header=BB10_2 Depth=2
.Ltmp0:
	movq	%rdx, %r13
	movl	$32, %edi
	callq	_Znwm
.Ltmp1:
# %bb.4:                                #   in Loop: Header=BB10_2 Depth=2
	shrq	$4, %r13
	movl	$4294967276, %ecx               # imm = 0xFFFFFFEC
	imulq	%rcx, %r13
	addq	%r12, %r13
	movq	%r13, 16(%rax)
	movl	%r14d, 24(%rax)
	movq	%rax, %rdi
	leaq	24(%rsp), %rsi
	callq	_ZNSt8__detail15_List_node_base7_M_hookEPS0_
	incq	40(%rsp)
	xorl	%eax, %eax
.LBB10_5:                               #   in Loop: Header=BB10_2 Depth=2
	movl	%eax, (%rbx)
	incq	%r12
	addq	$20, %rbx
	cmpl	$400, %r12d                     # imm = 0x190
	jne	.LBB10_2
# %bb.6:                                #   in Loop: Header=BB10_1 Depth=1
	incq	%r14
	movq	16(%rsp), %rbx                  # 8-byte Reload
	addq	$4, %rbx
	cmpq	$5, %r14
	jne	.LBB10_1
# %bb.7:                                # %.preheader
	movq	24(%rsp), %r15
	leaq	24(%rsp), %rax
	cmpq	%rax, %r15
	je	.LBB10_27
.LBB10_8:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	16(%r15), %eax
	movl	24(%r15), %ebx
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movslq	%eax, %r14
	movslq	20(%r15), %r12
	decq	40(%rsp)
	movq	%r15, %rdi
	callq	_ZNSt8__detail15_List_node_base9_M_unhookEv
	movq	%r15, %rdi
	callq	_ZdlPv
	imulq	$400, %r12, %rdx                # imm = 0x190
	movq	56(%rsp), %rcx                  # 8-byte Reload
	addq	%rcx, %rdx
	movl	%ebx, 12(%rsp)                  # 4-byte Spill
	movslq	%ebx, %r15
	movq	%r14, 16(%rsp)                  # 8-byte Spill
	leaq	(%r14,%r14,4), %rbx
	leaq	(%rdx,%rbx,4), %rax
	movl	(%rax,%r15,4), %r13d
	testq	%r12, %r12
	jle	.LBB10_9
# %bb.10:                               #   in Loop: Header=BB10_8 Depth=1
	leal	-1(%r12), %ebp
	imulq	$400, %rbp, %rax                # imm = 0x190
	addq	%rcx, %rax
	leaq	(%rax,%rbx,4), %rax
	leal	1(%r13), %r14d
	cmpl	%r14d, (%rax,%r15,4)
	jle	.LBB10_13
# %bb.11:                               #   in Loop: Header=BB10_8 Depth=1
	movq	%rdx, 48(%rsp)                  # 8-byte Spill
	leaq	(%rax,%r15,4), %rax
	movl	%r14d, (%rax)
.Ltmp3:
	movl	$32, %edi
	callq	_Znwm
.Ltmp4:
# %bb.12:                               #   in Loop: Header=BB10_8 Depth=1
	shlq	$32, %rbp
	addq	64(%rsp), %rbp                  # 8-byte Folded Reload
	movq	%rbp, 16(%rax)
	movl	12(%rsp), %ecx                  # 4-byte Reload
	movl	%ecx, 24(%rax)
	movq	%rax, %rdi
	leaq	24(%rsp), %rsi
	callq	_ZNSt8__detail15_List_node_base7_M_hookEPS0_
	incq	40(%rsp)
	movq	56(%rsp), %rcx                  # 8-byte Reload
	movq	48(%rsp), %rdx                  # 8-byte Reload
.LBB10_13:                              #   in Loop: Header=BB10_8 Depth=1
	cmpl	$18, %r12d
	jbe	.LBB10_14
	jmp	.LBB10_17
.LBB10_9:                               # %.lr.ph..thread_crit_edge
                                        #   in Loop: Header=BB10_8 Depth=1
	leal	1(%r13), %r14d
.LBB10_14:                              # %.thread
                                        #   in Loop: Header=BB10_8 Depth=1
	leaq	1(%r12), %rbp
	imulq	$400, %rbp, %rax                # imm = 0x190
	addq	%rcx, %rax
	leaq	(%rax,%rbx,4), %rax
	cmpl	%r14d, (%rax,%r15,4)
	jle	.LBB10_17
# %bb.15:                               #   in Loop: Header=BB10_8 Depth=1
	movq	%rdx, %rbx
	leaq	(%rax,%r15,4), %rax
	movl	%r14d, (%rax)
.Ltmp6:
	movl	$32, %edi
	callq	_Znwm
.Ltmp7:
# %bb.16:                               #   in Loop: Header=BB10_8 Depth=1
	shlq	$32, %rbp
	movl	16(%rsp), %ecx                  # 4-byte Reload
	orq	%rbp, %rcx
	movq	%rcx, 16(%rax)
	movl	12(%rsp), %ecx                  # 4-byte Reload
	movl	%ecx, 24(%rax)
	movq	%rax, %rdi
	leaq	24(%rsp), %rsi
	callq	_ZNSt8__detail15_List_node_base7_M_hookEPS0_
	incq	40(%rsp)
	movq	%rbx, %rdx
.LBB10_17:                              #   in Loop: Header=BB10_8 Depth=1
	movq	64(%rsp), %rbp                  # 8-byte Reload
	testl	%ebp, %ebp
	jle	.LBB10_18
# %bb.19:                               #   in Loop: Header=BB10_8 Depth=1
	movl	%ebp, %ebx
	decl	%ebx
	leaq	(%rbx,%rbx,4), %rax
	leaq	(%rdx,%rax,4), %rax
	incl	%r13d
	cmpl	%r13d, (%rax,%r15,4)
	leaq	24(%rsp), %r14
	jle	.LBB10_22
# %bb.20:                               #   in Loop: Header=BB10_8 Depth=1
	movq	%rdx, 48(%rsp)                  # 8-byte Spill
	leaq	(%rax,%r15,4), %rax
	movl	%r13d, (%rax)
.Ltmp9:
	movl	$32, %edi
	callq	_Znwm
.Ltmp10:
# %bb.21:                               #   in Loop: Header=BB10_8 Depth=1
	movq	%r12, %rcx
	shlq	$32, %rcx
	orq	%rbx, %rcx
	movq	%rcx, 16(%rax)
	movl	12(%rsp), %ecx                  # 4-byte Reload
	movl	%ecx, 24(%rax)
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_ZNSt8__detail15_List_node_base7_M_hookEPS0_
	incq	40(%rsp)
	movq	48(%rsp), %rdx                  # 8-byte Reload
.LBB10_22:                              #   in Loop: Header=BB10_8 Depth=1
	cmpl	$18, %ebp
	movq	16(%rsp), %rbx                  # 8-byte Reload
	jbe	.LBB10_23
	jmp	.LBB10_26
.LBB10_18:                              # %..thread148_crit_edge
                                        #   in Loop: Header=BB10_8 Depth=1
	incl	%r13d
	leaq	24(%rsp), %r14
	movq	16(%rsp), %rbx                  # 8-byte Reload
.LBB10_23:                              # %.thread148
                                        #   in Loop: Header=BB10_8 Depth=1
	incq	%rbx
	leaq	(%rbx,%rbx,4), %rax
	leaq	(%rdx,%rax,4), %rax
	cmpl	%r13d, (%rax,%r15,4)
	jle	.LBB10_26
# %bb.24:                               #   in Loop: Header=BB10_8 Depth=1
	leaq	(%rax,%r15,4), %rax
	movl	%r13d, (%rax)
.Ltmp12:
	movl	$32, %edi
	callq	_Znwm
.Ltmp13:
# %bb.25:                               #   in Loop: Header=BB10_8 Depth=1
	shlq	$32, %r12
	movl	%ebx, %ecx
	orq	%r12, %rcx
	movq	%rcx, 16(%rax)
	movl	12(%rsp), %ecx                  # 4-byte Reload
	movl	%ecx, 24(%rax)
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_ZNSt8__detail15_List_node_base7_M_hookEPS0_
	incq	40(%rsp)
.LBB10_26:                              #   in Loop: Header=BB10_8 Depth=1
	movq	24(%rsp), %r15
	cmpq	%r14, %r15
	jne	.LBB10_8
.LBB10_27:                              # %_ZNSt7__cxx1110_List_baseI15HIP_vector_typeIiLj3EESaIS2_EED2Ev.exit
	addq	$72, %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
.LBB10_32:
	.cfi_def_cfa_offset 128
.Ltmp5:
	jmp	.LBB10_29
.LBB10_34:
.Ltmp11:
	jmp	.LBB10_29
.LBB10_33:
.Ltmp8:
	jmp	.LBB10_29
.LBB10_35:
.Ltmp14:
	jmp	.LBB10_29
.LBB10_28:
.Ltmp2:
.LBB10_29:
	movq	%rax, %r14
	movq	24(%rsp), %rdi
	leaq	24(%rsp), %r15
	cmpq	%r15, %rdi
	je	.LBB10_31
.LBB10_30:                              # %.lr.ph.i.i136
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rdi), %rbx
	callq	_ZdlPv
	movq	%rbx, %rdi
	cmpq	%r15, %rbx
	jne	.LBB10_30
.LBB10_31:                              # %_ZNSt7__cxx1110_List_baseI15HIP_vector_typeIiLj3EESaIS2_EED2Ev.exit139
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end10:
	.size	_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap, .Lfunc_end10-_Z25computeDistanceToStoreCPUP10ZoningPlanP11DistanceMap
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table10:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 1 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Lfunc_end10-.Ltmp13           #   Call between .Ltmp13 and .Lfunc_end10
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI11_0:
	.long	0x3f000000                      # float 0.5
	.long	0x3e4ccccd                      # float 0.200000003
	.long	0x3dcccccd                      # float 0.100000001
	.long	0x3dcccccd                      # float 0.100000001
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI11_1:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %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	$1752, %rsp                     # imm = 0x6D8
	.cfi_def_cfa_offset 1808
	.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	$3200, %edi                     # imm = 0xC80
	callq	malloc
	movq	%rax, %rbx
	movl	$8000, %edi                     # imm = 0x1F40
	callq	malloc
	movq	%rax, %r14
	movl	$24, %edi
	callq	_Znwm
	leaq	120(%rsp), %r12
	movq	%rax, (%r12)
	leaq	24(%rax), %rcx
	movq	%rcx, 16(%r12)
	movq	%rcx, 8(%r12)
	movapd	.LCPI11_0(%rip), %xmm0          # xmm0 = [5.0E-1,2.00000003E-1,1.00000001E-1,1.00000001E-1]
	movupd	%xmm0, (%rax)
	movabsq	$4417130516412419277, %rcx      # imm = 0x3D4CCCCD3D4CCCCD
	movq	%rcx, 16(%rax)
	callq	clock
	movq	%rax, %r15
.Ltmp15:
	leaq	80(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSt6vectorIfSaIfEEC2ERKS1_
.Ltmp16:
# %bb.1:
.Ltmp18:
	leaq	80(%rsp), %rsi
	movq	%rbx, %rdi
	callq	_Z18generateZoningPlanR10ZoningPlanSt6vectorIfSaIfEE
.Ltmp19:
# %bb.2:
	movq	80(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB11_4
# %bb.3:
	callq	_ZdlPv
.LBB11_4:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit
	callq	clock
	subq	%r15, %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI11_1(%rip), %xmm0
	movl	$.L.str, %edi
	movb	$1, %al
	callq	printf
	leaq	3040(%rbx), %r15
	movl	$19, %r12d
.LBB11_5:                               # %.preheader200
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_6 Depth 2
	xorl	%r13d, %r13d
.LBB11_6:                               #   Parent Loop BB11_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r15,%r13,8), %esi
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r13
	cmpq	$20, %r13
	jne	.LBB11_6
# %bb.7:                                #   in Loop: Header=BB11_5 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	addq	$-160, %r15
	subq	$1, %r12
	jae	.LBB11_5
# %bb.8:
	movl	$10, %edi
	callq	putchar@PLT
.Ltmp21:
	movq	%rsp, %rdi
	movl	$3200, %esi                     # imm = 0xC80
	callq	hipMalloc
.Ltmp22:
# %bb.9:
	testl	%eax, %eax
	jne	.LBB11_10
# %bb.17:
	movq	(%rsp), %rdi
.Ltmp27:
	movl	$3200, %edx                     # imm = 0xC80
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp28:
# %bb.18:
	testl	%eax, %eax
	jne	.LBB11_19
# %bb.21:
.Ltmp34:
	leaq	16(%rsp), %rdi
	movl	$8000, %esi                     # imm = 0x1F40
	callq	hipMalloc
.Ltmp35:
# %bb.22:
	testl	%eax, %eax
	jne	.LBB11_23
# %bb.26:
.Ltmp41:
	leaq	112(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
.Ltmp42:
# %bb.27:
	testl	%eax, %eax
	jne	.LBB11_28
# %bb.31:
.Ltmp48:
	leaq	104(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
.Ltmp49:
# %bb.32:
	testl	%eax, %eax
	jne	.LBB11_33
# %bb.36:
.Ltmp55:
	leaq	64(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
.Ltmp56:
# %bb.37:
	testl	%eax, %eax
	jne	.LBB11_38
# %bb.41:
	movq	64(%rsp), %rdi
.Ltmp61:
	movl	$4, %edx
	xorl	%esi, %esi
	callq	hipMemset
.Ltmp62:
# %bb.42:
	testl	%eax, %eax
	jne	.LBB11_43
# %bb.45:
.Ltmp68:
	leaq	56(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
.Ltmp69:
# %bb.46:
	testl	%eax, %eax
	jne	.LBB11_47
# %bb.50:
	movq	56(%rsp), %rdi
.Ltmp74:
	movl	$4, %edx
	xorl	%esi, %esi
	callq	hipMemset
.Ltmp75:
# %bb.51:
	testl	%eax, %eax
	jne	.LBB11_52
# %bb.54:
.Ltmp81:
	leaq	8(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
.Ltmp82:
# %bb.55:
	testl	%eax, %eax
	jne	.LBB11_56
# %bb.59:
.Ltmp88:
	leaq	48(%rsp), %rdi
	movl	$8, %esi
	callq	hipMalloc
.Ltmp89:
# %bb.60:
	testl	%eax, %eax
	jne	.LBB11_61
# %bb.64:
.Ltmp95:
	leaq	40(%rsp), %rdi
	movl	$8, %esi
	callq	hipMalloc
.Ltmp96:
# %bb.65:
	testl	%eax, %eax
	jne	.LBB11_66
# %bb.69:
.Ltmp102:
	leaq	72(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
.Ltmp103:
# %bb.70:
	testl	%eax, %eax
	jne	.LBB11_71
# %bb.74:
.Ltmp109:
	leaq	24(%rsp), %rdi
	movl	$1600, %esi                     # imm = 0x640
	callq	hipMalloc
.Ltmp110:
# %bb.75:
	testl	%eax, %eax
	jne	.LBB11_76
# %bb.78:
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$1000, %ebp                     # imm = 0x3E8
	callq	clock
	movq	%rax, %r15
	movabsq	$4294967297, %r12               # imm = 0x100000001
.LBB11_79:                              # =>This Inner Loop Header: Depth=1
.Ltmp115:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp116:
# %bb.80:                               #   in Loop: Header=BB11_79 Depth=1
	testl	%eax, %eax
	jne	.LBB11_82
# %bb.81:                               #   in Loop: Header=BB11_79 Depth=1
	movq	(%rsp), %rdi
	movq	64(%rsp), %rsi
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rcx
.Ltmp117:
	callq	_Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
.Ltmp118:
.LBB11_82:                              #   in Loop: Header=BB11_79 Depth=1
.Ltmp119:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp120:
# %bb.83:                               #   in Loop: Header=BB11_79 Depth=1
	testl	%eax, %eax
	jne	.LBB11_85
# %bb.84:                               #   in Loop: Header=BB11_79 Depth=1
	movq	(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp121:
	callq	_Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap
.Ltmp122:
.LBB11_85:                              #   in Loop: Header=BB11_79 Depth=1
.Ltmp123:
	callq	hipDeviceSynchronize
.Ltmp124:
# %bb.86:                               #   in Loop: Header=BB11_79 Depth=1
	movq	8(%rsp), %rdi
.Ltmp125:
	movl	$4, %edx
	xorl	%esi, %esi
	callq	hipMemset
.Ltmp126:
# %bb.87:                               #   in Loop: Header=BB11_79 Depth=1
	testl	%eax, %eax
	jne	.LBB11_88
# %bb.92:                               #   in Loop: Header=BB11_79 Depth=1
.Ltmp132:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp133:
# %bb.93:                               #   in Loop: Header=BB11_79 Depth=1
	testl	%eax, %eax
	jne	.LBB11_95
# %bb.94:                               #   in Loop: Header=BB11_79 Depth=1
	movq	(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdx
	movq	24(%rsp), %rcx
.Ltmp134:
	callq	_Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_
.Ltmp135:
.LBB11_95:                              #   in Loop: Header=BB11_79 Depth=1
.Ltmp136:
	callq	hipDeviceSynchronize
.Ltmp137:
# %bb.96:                               #   in Loop: Header=BB11_79 Depth=1
.Ltmp138:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp139:
# %bb.97:                               #   in Loop: Header=BB11_79 Depth=1
	testl	%eax, %eax
	jne	.LBB11_99
# %bb.98:                               #   in Loop: Header=BB11_79 Depth=1
	movq	(%rsp), %rdi
	movq	56(%rsp), %rsi
	movq	8(%rsp), %rdx
	movq	48(%rsp), %rcx
	movq	40(%rsp), %r8
	movq	72(%rsp), %r9
.Ltmp140:
	callq	_Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
.Ltmp141:
.LBB11_99:                              #   in Loop: Header=BB11_79 Depth=1
	decl	%ebp
	jne	.LBB11_79
# %bb.100:
	callq	clock
	subq	%r15, %rax
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI11_1(%rip), %xmm0
	movl	$.L.str.7, %edi
	movb	$1, %al
	callq	printf
.Ltmp143:
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%rdi, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp144:
# %bb.101:
	testl	%eax, %eax
	jne	.LBB11_103
# %bb.102:
	movq	(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp145:
	callq	_Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap
.Ltmp146:
.LBB11_103:
.Ltmp147:
	callq	hipDeviceSynchronize
.Ltmp148:
# %bb.104:
	movq	16(%rsp), %rsi
.Ltmp149:
	movl	$8000, %edx                     # imm = 0x1F40
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp150:
# %bb.105:
	testl	%eax, %eax
	jne	.LBB11_124
# %bb.106:                              # %.preheader198.preheader
	movq	%r14, %r15
	addq	$7604, %r15                     # imm = 0x1DB4
	movl	$19, %r12d
.LBB11_107:                             # %.preheader198
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_108 Depth 2
	xorl	%r13d, %r13d
.LBB11_108:                             #   Parent Loop BB11_107 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r15,%r13), %esi
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	addq	$20, %r13
	cmpq	$400, %r13                      # imm = 0x190
	jne	.LBB11_108
# %bb.109:                              #   in Loop: Header=BB11_107 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	addq	$-400, %r15                     # imm = 0xFE70
	subq	$1, %r12
	jae	.LBB11_107
# %bb.110:
	movl	$10, %edi
	callq	putchar@PLT
	movq	(%rsp), %rsi
.Ltmp155:
	movl	$3200, %edx                     # imm = 0xC80
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp156:
# %bb.111:
	testl	%eax, %eax
	jne	.LBB11_126
# %bb.112:                              # %.preheader196.preheader
	movq	%rbx, %r15
	addq	$3040, %r15                     # imm = 0xBE0
	movl	$19, %r12d
.LBB11_113:                             # %.preheader196
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_114 Depth 2
	xorl	%r13d, %r13d
.LBB11_114:                             #   Parent Loop BB11_113 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r15,%r13,8), %esi
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r13
	cmpq	$20, %r13
	jne	.LBB11_114
# %bb.115:                              #   in Loop: Header=BB11_113 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	addq	$-160, %r15
	subq	$1, %r12
	jae	.LBB11_113
# %bb.116:
	movl	$.L.str.8, %edi
	movl	$.L.str.9, %esi
	callq	fopen
	movq	%rax, %r15
	movq	%rbx, %r12
	xorl	%r13d, %r13d
.LBB11_117:                             # %.preheader195
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_118 Depth 2
	xorl	%ebp, %ebp
.LBB11_118:                             #   Parent Loop BB11_117 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r12,%rbp,8), %edx
	movl	$.L.str.10, %esi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	fprintf
	incq	%rbp
	cmpq	$20, %rbp
	jne	.LBB11_118
# %bb.119:                              #   in Loop: Header=BB11_117 Depth=1
	movl	$10, %edi
	movq	%r15, %rsi
	callq	fputc@PLT
	incq	%r13
	addq	$160, %r12
	cmpq	$20, %r13
	jne	.LBB11_117
# %bb.120:
	movq	%r15, %rdi
	callq	fclose
	movq	8(%rsp), %rdi
.Ltmp162:
	movl	$4, %edx
	xorl	%esi, %esi
	callq	hipMemset
.Ltmp163:
# %bb.121:
	testl	%eax, %eax
	jne	.LBB11_122
# %bb.129:
	movq	24(%rsp), %rdi
.Ltmp168:
	movl	$1600, %edx                     # imm = 0x640
	xorl	%esi, %esi
	callq	hipMemset
.Ltmp169:
# %bb.130:
	testl	%eax, %eax
	jne	.LBB11_131
# %bb.133:
.Ltmp174:
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%rdi, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp175:
# %bb.134:
	testl	%eax, %eax
	jne	.LBB11_136
# %bb.135:
	movq	(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdx
	movq	24(%rsp), %rcx
.Ltmp176:
	callq	_Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_
.Ltmp177:
.LBB11_136:
.Ltmp178:
	callq	hipDeviceSynchronize
.Ltmp179:
# %bb.137:
	movq	24(%rsp), %rsi
.Ltmp181:
	leaq	144(%rsp), %rdi
	movl	$1600, %edx                     # imm = 0x640
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp182:
# %bb.138:
	testl	%eax, %eax
	jne	.LBB11_139
# %bb.142:
	movq	8(%rsp), %rsi
.Ltmp187:
	leaq	36(%rsp), %rdi
	movl	$4, %edx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp188:
# %bb.143:
	testl	%eax, %eax
	jne	.LBB11_144
# %bb.146:
	cvtss2sd	36(%rsp), %xmm0
	movl	$.L.str.11, %edi
	movb	$1, %al
	callq	printf
	movl	$19, %r15d
	leaq	1664(%rsp), %r12
.LBB11_147:                             # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_148 Depth 2
	xorl	%r13d, %r13d
.LBB11_148:                             #   Parent Loop BB11_147 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r12,%r13,4), %xmm0
	movl	$.L.str.12, %edi
	movb	$1, %al
	callq	printf
	incq	%r13
	cmpq	$20, %r13
	jne	.LBB11_148
# %bb.149:                              #   in Loop: Header=BB11_147 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	addq	$-80, %r12
	subq	$1, %r15
	jae	.LBB11_147
# %bb.150:
	movq	(%rsp), %rdi
.Ltmp193:
	callq	hipFree
.Ltmp194:
# %bb.151:
	movq	16(%rsp), %rdi
.Ltmp195:
	callq	hipFree
.Ltmp196:
# %bb.152:
	movq	%rbx, %rdi
	callq	free
	movq	%r14, %rdi
	callq	free
	movq	120(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB11_154
# %bb.153:
	callq	_ZdlPv
.LBB11_154:                             # %_ZNSt6vectorIfSaIfEED2Ev.exit158
	xorl	%eax, %eax
	addq	$1752, %rsp                     # imm = 0x6D8
	.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
.LBB11_88:
	.cfi_def_cfa_offset 1808
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$521, %edx                      # imm = 0x209
	xorl	%eax, %eax
	callq	printf
.Ltmp127:
	callq	hipGetLastError
.Ltmp128:
# %bb.89:
.Ltmp129:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp130:
.LBB11_12:
	movl	$.L.str.5, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.LBB11_10:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$428, %edx                      # imm = 0x1AC
	xorl	%eax, %eax
	callq	printf
.Ltmp23:
	callq	hipGetLastError
.Ltmp24:
# %bb.11:
.Ltmp25:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp26:
	jmp	.LBB11_12
.LBB11_19:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$429, %edx                      # imm = 0x1AD
	xorl	%eax, %eax
	callq	printf
.Ltmp29:
	callq	hipGetLastError
.Ltmp30:
# %bb.20:
.Ltmp31:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp32:
	jmp	.LBB11_12
.LBB11_23:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$433, %edx                      # imm = 0x1B1
	xorl	%eax, %eax
	callq	printf
.Ltmp36:
	callq	hipGetLastError
.Ltmp37:
# %bb.24:
.Ltmp38:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp39:
	jmp	.LBB11_12
.LBB11_28:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$448, %edx                      # imm = 0x1C0
	xorl	%eax, %eax
	callq	printf
.Ltmp43:
	callq	hipGetLastError
.Ltmp44:
# %bb.29:
.Ltmp45:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp46:
	jmp	.LBB11_12
.LBB11_33:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$450, %edx                      # imm = 0x1C2
	xorl	%eax, %eax
	callq	printf
.Ltmp50:
	callq	hipGetLastError
.Ltmp51:
# %bb.34:
.Ltmp52:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp53:
	jmp	.LBB11_12
.LBB11_38:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$453, %edx                      # imm = 0x1C5
	xorl	%eax, %eax
	callq	printf
.Ltmp57:
	callq	hipGetLastError
.Ltmp58:
# %bb.39:
.Ltmp59:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp60:
	jmp	.LBB11_12
.LBB11_43:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$454, %edx                      # imm = 0x1C6
	xorl	%eax, %eax
	callq	printf
.Ltmp63:
	callq	hipGetLastError
.Ltmp64:
# %bb.44:
.Ltmp65:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp66:
	jmp	.LBB11_12
.LBB11_47:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$458, %edx                      # imm = 0x1CA
	xorl	%eax, %eax
	callq	printf
.Ltmp70:
	callq	hipGetLastError
.Ltmp71:
# %bb.48:
.Ltmp72:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp73:
	jmp	.LBB11_12
.LBB11_52:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$459, %edx                      # imm = 0x1CB
	xorl	%eax, %eax
	callq	printf
.Ltmp76:
	callq	hipGetLastError
.Ltmp77:
# %bb.53:
.Ltmp78:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp79:
	jmp	.LBB11_12
.LBB11_56:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$463, %edx                      # imm = 0x1CF
	xorl	%eax, %eax
	callq	printf
.Ltmp83:
	callq	hipGetLastError
.Ltmp84:
# %bb.57:
.Ltmp85:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp86:
	jmp	.LBB11_12
.LBB11_61:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$467, %edx                      # imm = 0x1D3
	xorl	%eax, %eax
	callq	printf
.Ltmp90:
	callq	hipGetLastError
.Ltmp91:
# %bb.62:
.Ltmp92:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp93:
	jmp	.LBB11_12
.LBB11_66:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$469, %edx                      # imm = 0x1D5
	xorl	%eax, %eax
	callq	printf
.Ltmp97:
	callq	hipGetLastError
.Ltmp98:
# %bb.67:
.Ltmp99:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp100:
	jmp	.LBB11_12
.LBB11_71:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$473, %edx                      # imm = 0x1D9
	xorl	%eax, %eax
	callq	printf
.Ltmp104:
	callq	hipGetLastError
.Ltmp105:
# %bb.72:
.Ltmp106:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp107:
	jmp	.LBB11_12
.LBB11_76:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$478, %edx                      # imm = 0x1DE
	xorl	%eax, %eax
	callq	printf
.Ltmp111:
	callq	hipGetLastError
.Ltmp112:
# %bb.77:
.Ltmp113:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp114:
	jmp	.LBB11_12
.LBB11_124:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$548, %edx                      # imm = 0x224
	xorl	%eax, %eax
	callq	printf
.Ltmp151:
	callq	hipGetLastError
.Ltmp152:
# %bb.125:
.Ltmp153:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp154:
	jmp	.LBB11_12
.LBB11_126:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$559, %edx                      # imm = 0x22F
	xorl	%eax, %eax
	callq	printf
.Ltmp157:
	callq	hipGetLastError
.Ltmp158:
# %bb.127:
.Ltmp159:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp160:
	jmp	.LBB11_12
.LBB11_122:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$579, %edx                      # imm = 0x243
	xorl	%eax, %eax
	callq	printf
.Ltmp164:
	callq	hipGetLastError
.Ltmp165:
# %bb.123:
.Ltmp166:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp167:
	jmp	.LBB11_12
.LBB11_131:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$580, %edx                      # imm = 0x244
	xorl	%eax, %eax
	callq	printf
.Ltmp170:
	callq	hipGetLastError
.Ltmp171:
# %bb.132:
.Ltmp172:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp173:
	jmp	.LBB11_12
.LBB11_139:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$585, %edx                      # imm = 0x249
	xorl	%eax, %eax
	callq	printf
.Ltmp183:
	callq	hipGetLastError
.Ltmp184:
# %bb.140:
.Ltmp185:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp186:
	jmp	.LBB11_12
.LBB11_144:
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	movl	$586, %edx                      # imm = 0x24A
	xorl	%eax, %eax
	callq	printf
.Ltmp189:
	callq	hipGetLastError
.Ltmp190:
# %bb.145:
.Ltmp191:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp192:
	jmp	.LBB11_12
.LBB11_14:
.Ltmp20:
	movq	%rax, %rbx
	movq	80(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB11_157
# %bb.15:
	callq	_ZdlPv
	jmp	.LBB11_157
.LBB11_13:
.Ltmp17:
	jmp	.LBB11_156
.LBB11_73:
.Ltmp108:
	jmp	.LBB11_156
.LBB11_68:
.Ltmp101:
	jmp	.LBB11_156
.LBB11_63:
.Ltmp94:
	jmp	.LBB11_156
.LBB11_58:
.Ltmp87:
	jmp	.LBB11_156
.LBB11_35:
.Ltmp54:
	jmp	.LBB11_156
.LBB11_30:
.Ltmp47:
	jmp	.LBB11_156
.LBB11_25:
.Ltmp40:
	jmp	.LBB11_156
.LBB11_49:
.Ltmp80:
	jmp	.LBB11_156
.LBB11_40:
.Ltmp67:
	jmp	.LBB11_156
.LBB11_16:
.Ltmp33:
	jmp	.LBB11_156
.LBB11_141:
.Ltmp197:
	jmp	.LBB11_156
.LBB11_128:
.Ltmp180:
	jmp	.LBB11_156
.LBB11_155:
.Ltmp161:
	jmp	.LBB11_156
.LBB11_91:                              # %.loopexit.split-lp
.Ltmp131:
	jmp	.LBB11_156
.LBB11_90:                              # %.loopexit
.Ltmp142:
.LBB11_156:                             # %_ZNSt6vectorIfSaIfEED2Ev.exit156
	movq	%rax, %rbx
.LBB11_157:                             # %_ZNSt6vectorIfSaIfEED2Ev.exit156
	movq	120(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB11_159
# %bb.158:
	callq	_ZdlPv
.LBB11_159:                             # %_ZNSt6vectorIfSaIfEED2Ev.exit160
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end11:
	.size	main, .Lfunc_end11-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table11:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp15-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp15
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp17-.Lfunc_begin1          #     jumps to .Ltmp17
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp19-.Ltmp18                #   Call between .Ltmp18 and .Ltmp19
	.uleb128 .Ltmp20-.Lfunc_begin1          #     jumps to .Ltmp20
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp21-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp28-.Ltmp21                #   Call between .Ltmp21 and .Ltmp28
	.uleb128 .Ltmp33-.Lfunc_begin1          #     jumps to .Ltmp33
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp34-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp35-.Ltmp34                #   Call between .Ltmp34 and .Ltmp35
	.uleb128 .Ltmp40-.Lfunc_begin1          #     jumps to .Ltmp40
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp41-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Ltmp42-.Ltmp41                #   Call between .Ltmp41 and .Ltmp42
	.uleb128 .Ltmp47-.Lfunc_begin1          #     jumps to .Ltmp47
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp48-.Lfunc_begin1          # >> Call Site 7 <<
	.uleb128 .Ltmp49-.Ltmp48                #   Call between .Ltmp48 and .Ltmp49
	.uleb128 .Ltmp54-.Lfunc_begin1          #     jumps to .Ltmp54
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp55-.Lfunc_begin1          # >> Call Site 8 <<
	.uleb128 .Ltmp62-.Ltmp55                #   Call between .Ltmp55 and .Ltmp62
	.uleb128 .Ltmp67-.Lfunc_begin1          #     jumps to .Ltmp67
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin1          # >> Call Site 9 <<
	.uleb128 .Ltmp75-.Ltmp68                #   Call between .Ltmp68 and .Ltmp75
	.uleb128 .Ltmp80-.Lfunc_begin1          #     jumps to .Ltmp80
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp81-.Lfunc_begin1          # >> Call Site 10 <<
	.uleb128 .Ltmp82-.Ltmp81                #   Call between .Ltmp81 and .Ltmp82
	.uleb128 .Ltmp87-.Lfunc_begin1          #     jumps to .Ltmp87
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp88-.Lfunc_begin1          # >> Call Site 11 <<
	.uleb128 .Ltmp89-.Ltmp88                #   Call between .Ltmp88 and .Ltmp89
	.uleb128 .Ltmp94-.Lfunc_begin1          #     jumps to .Ltmp94
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp95-.Lfunc_begin1          # >> Call Site 12 <<
	.uleb128 .Ltmp96-.Ltmp95                #   Call between .Ltmp95 and .Ltmp96
	.uleb128 .Ltmp101-.Lfunc_begin1         #     jumps to .Ltmp101
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp102-.Lfunc_begin1         # >> Call Site 13 <<
	.uleb128 .Ltmp103-.Ltmp102              #   Call between .Ltmp102 and .Ltmp103
	.uleb128 .Ltmp108-.Lfunc_begin1         #     jumps to .Ltmp108
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp109-.Lfunc_begin1         # >> Call Site 14 <<
	.uleb128 .Ltmp110-.Ltmp109              #   Call between .Ltmp109 and .Ltmp110
	.uleb128 .Ltmp161-.Lfunc_begin1         #     jumps to .Ltmp161
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp115-.Lfunc_begin1         # >> Call Site 15 <<
	.uleb128 .Ltmp141-.Ltmp115              #   Call between .Ltmp115 and .Ltmp141
	.uleb128 .Ltmp142-.Lfunc_begin1         #     jumps to .Ltmp142
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp143-.Lfunc_begin1         # >> Call Site 16 <<
	.uleb128 .Ltmp156-.Ltmp143              #   Call between .Ltmp143 and .Ltmp156
	.uleb128 .Ltmp161-.Lfunc_begin1         #     jumps to .Ltmp161
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp162-.Lfunc_begin1         # >> Call Site 17 <<
	.uleb128 .Ltmp179-.Ltmp162              #   Call between .Ltmp162 and .Ltmp179
	.uleb128 .Ltmp180-.Lfunc_begin1         #     jumps to .Ltmp180
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp181-.Lfunc_begin1         # >> Call Site 18 <<
	.uleb128 .Ltmp196-.Ltmp181              #   Call between .Ltmp181 and .Ltmp196
	.uleb128 .Ltmp197-.Lfunc_begin1         #     jumps to .Ltmp197
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp127-.Lfunc_begin1         # >> Call Site 19 <<
	.uleb128 .Ltmp130-.Ltmp127              #   Call between .Ltmp127 and .Ltmp130
	.uleb128 .Ltmp131-.Lfunc_begin1         #     jumps to .Ltmp131
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp23-.Lfunc_begin1          # >> Call Site 20 <<
	.uleb128 .Ltmp32-.Ltmp23                #   Call between .Ltmp23 and .Ltmp32
	.uleb128 .Ltmp33-.Lfunc_begin1          #     jumps to .Ltmp33
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin1          # >> Call Site 21 <<
	.uleb128 .Ltmp39-.Ltmp36                #   Call between .Ltmp36 and .Ltmp39
	.uleb128 .Ltmp40-.Lfunc_begin1          #     jumps to .Ltmp40
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp43-.Lfunc_begin1          # >> Call Site 22 <<
	.uleb128 .Ltmp46-.Ltmp43                #   Call between .Ltmp43 and .Ltmp46
	.uleb128 .Ltmp47-.Lfunc_begin1          #     jumps to .Ltmp47
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp50-.Lfunc_begin1          # >> Call Site 23 <<
	.uleb128 .Ltmp53-.Ltmp50                #   Call between .Ltmp50 and .Ltmp53
	.uleb128 .Ltmp54-.Lfunc_begin1          #     jumps to .Ltmp54
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp57-.Lfunc_begin1          # >> Call Site 24 <<
	.uleb128 .Ltmp66-.Ltmp57                #   Call between .Ltmp57 and .Ltmp66
	.uleb128 .Ltmp67-.Lfunc_begin1          #     jumps to .Ltmp67
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp70-.Lfunc_begin1          # >> Call Site 25 <<
	.uleb128 .Ltmp79-.Ltmp70                #   Call between .Ltmp70 and .Ltmp79
	.uleb128 .Ltmp80-.Lfunc_begin1          #     jumps to .Ltmp80
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp83-.Lfunc_begin1          # >> Call Site 26 <<
	.uleb128 .Ltmp86-.Ltmp83                #   Call between .Ltmp83 and .Ltmp86
	.uleb128 .Ltmp87-.Lfunc_begin1          #     jumps to .Ltmp87
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp90-.Lfunc_begin1          # >> Call Site 27 <<
	.uleb128 .Ltmp93-.Ltmp90                #   Call between .Ltmp90 and .Ltmp93
	.uleb128 .Ltmp94-.Lfunc_begin1          #     jumps to .Ltmp94
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp97-.Lfunc_begin1          # >> Call Site 28 <<
	.uleb128 .Ltmp100-.Ltmp97               #   Call between .Ltmp97 and .Ltmp100
	.uleb128 .Ltmp101-.Lfunc_begin1         #     jumps to .Ltmp101
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp104-.Lfunc_begin1         # >> Call Site 29 <<
	.uleb128 .Ltmp107-.Ltmp104              #   Call between .Ltmp104 and .Ltmp107
	.uleb128 .Ltmp108-.Lfunc_begin1         #     jumps to .Ltmp108
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp111-.Lfunc_begin1         # >> Call Site 30 <<
	.uleb128 .Ltmp160-.Ltmp111              #   Call between .Ltmp111 and .Ltmp160
	.uleb128 .Ltmp161-.Lfunc_begin1         #     jumps to .Ltmp161
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp164-.Lfunc_begin1         # >> Call Site 31 <<
	.uleb128 .Ltmp173-.Ltmp164              #   Call between .Ltmp164 and .Ltmp173
	.uleb128 .Ltmp180-.Lfunc_begin1         #     jumps to .Ltmp180
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp183-.Lfunc_begin1         # >> Call Site 32 <<
	.uleb128 .Ltmp192-.Ltmp183              #   Call between .Ltmp183 and .Ltmp192
	.uleb128 .Ltmp197-.Lfunc_begin1         #     jumps to .Ltmp197
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp192-.Lfunc_begin1         # >> Call Site 33 <<
	.uleb128 .Lfunc_end11-.Ltmp192          #   Call between .Ltmp192 and .Lfunc_end11
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIfSaIfEEC2ERKS1_,"axG",@progbits,_ZNSt6vectorIfSaIfEEC2ERKS1_,comdat
	.weak	_ZNSt6vectorIfSaIfEEC2ERKS1_    # -- Begin function _ZNSt6vectorIfSaIfEEC2ERKS1_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIfSaIfEEC2ERKS1_,@function
_ZNSt6vectorIfSaIfEEC2ERKS1_:           # @_ZNSt6vectorIfSaIfEEC2ERKS1_
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	8(%rsi), %rax
	movq	(%rsi), %rcx
	movq	%rax, %r12
	subq	%rcx, %r12
	sarq	$2, %r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	cmpq	%rcx, %rax
	je	.LBB12_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIfE8allocateEmPKv
	movq	%rax, %r15
	jmp	.LBB12_3
.LBB12_1:
	xorl	%r15d, %r15d
.LBB12_3:
	movq	%r15, (%rbx)
	movq	%r15, 8(%rbx)
	leaq	(%r15,%r12,4), %rax
	movq	%rax, 16(%rbx)
	movq	(%r14), %rsi
	movq	8(%r14), %r14
	subq	%rsi, %r14
	cmpq	$5, %r14
	jl	.LBB12_5
# %bb.4:
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	memmove@PLT
.LBB12_7:
	addq	%r14, %r15
	movq	%r15, 8(%rbx)
	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
	retq
.LBB12_5:
	.cfi_def_cfa_offset 48
	cmpq	$4, %r14
	jne	.LBB12_7
# %bb.6:
	movss	(%rsi), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%r15)
	jmp	.LBB12_7
.Lfunc_end12:
	.size	_ZNSt6vectorIfSaIfEEC2ERKS1_, .Lfunc_end12-_ZNSt6vectorIfSaIfEEC2ERKS1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIfE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIfE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIfE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIfE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIfE8allocateEmPKv,@function
_ZNSt15__new_allocatorIfE8allocateEmPKv: # @_ZNSt15__new_allocatorIfE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB13_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB13_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB13_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB13_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end13:
	.size	_ZNSt15__new_allocatorIfE8allocateEmPKv, .Lfunc_end13-_ZNSt15__new_allocatorIfE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.text
	.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
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB14_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB14_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end14:
	.size	__hip_module_ctor, .Lfunc_end14-__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	.LBB15_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
.LBB15_2:
	retq
.Lfunc_end15:
	.size	__hip_module_dtor, .Lfunc_end15-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_,@object # @_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.section	.rodata,"a",@progbits
	.globl	_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.p2align	3, 0x0
_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_:
	.quad	_Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.size	_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_, 8

	.type	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap,@object # @_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.globl	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.p2align	3, 0x0
_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap:
	.quad	_Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.size	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap, 8

	.type	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_,@object # @_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.globl	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.p2align	3, 0x0
_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_:
	.quad	_Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.size	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_, 8

	.type	_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi,@object # @_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.globl	_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.p2align	3, 0x0
_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi:
	.quad	_Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.size	_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"generateZoningPlan: %lf\n"
	.size	.L.str, 25

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"%d, "
	.size	.L.str.1, 5

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"CUDA error at %s:%d\n"
	.size	.L.str.3, 21

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/gnishida/CUDATest/master/my_mcmc.hip"
	.size	.L.str.4, 99

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"  %s\n"
	.size	.L.str.5, 6

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"computeDistanceToStore GPU: %lf\n"
	.size	.L.str.7, 33

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"zone.txt"
	.size	.L.str.8, 9

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"w"
	.size	.L.str.9, 2

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

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Score: %lf\n"
	.size	.L.str.11, 12

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"%lf, "
	.size	.L.str.12, 6

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_"
	.size	.L__unnamed_1, 64

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap"
	.size	.L__unnamed_2, 54

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_"
	.size	.L__unnamed_3, 49

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi"
	.size	.L__unnamed_4, 67

	.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	"start..."
	.size	.Lstr, 9

	.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 __gxx_personality_v0
	.addrsig_sym _Z31__device_stub__generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.addrsig_sym _Z37__device_stub__computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.addrsig_sym _Z27__device_stub__computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.addrsig_sym _Z29__device_stub__acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.addrsig_sym _Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.addrsig_sym _Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.addrsig_sym _Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_ ; -- Begin function _Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.globl	_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
	.p2align	8
	.type	_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_,@function
_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_: ; @_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
; %bb.0:
	s_load_b256 s[0:7], s[0:1], 0x0
	v_mov_b32_e32 v8, 0
	s_waitcnt lgkmcnt(0)
	s_load_b32 s8, s[2:3], 0x0
.LBB0_1:                                ; =>This Inner Loop Header: Depth=1
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s8, s8, 0x41c64e6d
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_addk_i32 s8, 0x3039
	s_mul_i32 s9, s8, 0x41c64e6d
	s_bitset0_b32 s8, 31
	s_addk_i32 s9, 0x3039
	v_cvt_f32_u32_e32 v0, s8
	s_and_b32 s8, s9, 0x7fffffff
	s_mul_i32 s9, s9, 0x41c64e6d
	v_cvt_f32_u32_e32 v1, s8
	s_add_i32 s8, s9, 0x3039
	v_mul_f32_e32 v0, 0x30000000, v0
	s_mul_i32 s9, s8, 0x41c64e6d
	s_and_b32 s10, s8, 0x7fffffff
	v_mul_f32_e32 v1, 0x30000000, v1
	s_add_i32 s8, s9, 0x3039
	v_cvt_f32_u32_e32 v2, s10
	s_and_b32 s9, s8, 0x7fffffff
	v_fma_f32 v0, 0x41a00000, v0, 0
	v_cvt_f32_u32_e32 v3, s9
	v_fma_f32 v1, 0x41a00000, v1, 0
	v_mul_f32_e32 v2, 0x30000000, v2
	v_mov_b32_e32 v4, s8
	v_cvt_i32_f32_e32 v0, v0
	v_mul_f32_e32 v3, 0x30000000, v3
	v_cvt_i32_f32_e32 v9, v1
	v_fma_f32 v2, 0x41a00000, v2, 0
	global_store_b32 v8, v4, s[2:3]
	v_ashrrev_i32_e32 v1, 31, v0
	v_fma_f32 v3, 0x41a00000, v3, 0
	v_mul_lo_u32 v6, 0xa0, v9
	v_mul_hi_i32 v7, 0xa0, v9
	v_cvt_i32_f32_e32 v2, v2
	v_lshlrev_b64 v[4:5], 3, v[0:1]
	v_cvt_i32_f32_e32 v10, v3
	s_mov_b32 s9, -1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_ashrrev_i32_e32 v3, 31, v2
	v_add_co_u32 v1, vcc_lo, s0, v6
	v_mul_lo_u32 v11, 0xa0, v10
	v_add_co_ci_u32_e32 v6, vcc_lo, s1, v7, vcc_lo
	s_waitcnt vmcnt(0)
	v_mul_hi_i32 v12, 0xa0, v10
	v_add_co_u32 v4, vcc_lo, v1, v4
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v5, vcc_lo, v6, v5, vcc_lo
	v_lshlrev_b64 v[6:7], 3, v[2:3]
	v_add_co_u32 v1, vcc_lo, s0, v11
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v12, vcc_lo
	global_load_b32 v11, v[4:5], off
	v_add_co_u32 v6, vcc_lo, v1, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, v3, v7, vcc_lo
	global_load_b32 v12, v[6:7], off
	s_waitcnt vmcnt(1)
	v_cmp_eq_u32_e32 vcc_lo, 2, v11
	s_cbranch_vccnz .LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e64 s9, 2, v12
	v_mov_b32_e32 v12, 2
	s_branch .LBB0_4
.LBB0_3:                                ;   in Loop: Header=BB0_1 Depth=1
                                        ; implicit-def: $sgpr8
.LBB0_4:                                ; %Flow
                                        ;   in Loop: Header=BB0_1 Depth=1
	s_delay_alu instid0(VALU_DEP_2)
	s_and_not1_b32 vcc_lo, exec_lo, s9
	s_cbranch_vccnz .LBB0_1
; %bb.5:                                ; %.critedge
	v_dual_mov_b32 v8, 0 :: v_dual_mov_b32 v1, v9
	v_mov_b32_e32 v3, v10
	s_waitcnt vmcnt(0)
	s_clause 0x1
	global_store_b32 v[4:5], v12, off
	global_store_b32 v[6:7], v11, off
	s_clause 0x1
	global_store_b64 v8, v[0:1], s[4:5]
	global_store_b64 v8, v[2:3], s[6:7]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.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 0
		.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 13
		.amdhsa_next_free_sgpr 11
		.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	_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_, .Lfunc_end0-_Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 504
; NumSgprs: 13
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 13
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; 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
	.protected	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap ; -- Begin function _Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.globl	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
	.p2align	8
	.type	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap,@function
_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap: ; @_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
; %bb.0:
	s_load_b128 s[0:3], s[0:1], 0x0
	v_dual_mov_b32 v2, 0 :: v_dual_mov_b32 v5, 0x63
	s_mov_b32 s4, 0
	s_mul_i32 s15, s15, 20
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_mov_b32 v6, 0x7cf :: v_dual_mov_b32 v1, v2
	s_mul_i32 s14, s14, 20
	ds_store_b64 v2, v[1:2] offset:32000
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB1_1:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_5 Depth 2
	v_add_nc_u32_e32 v1, s4, v0
	s_mov_b32 s5, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u32_e32 0x190, v1
	s_cbranch_execz .LBB1_10
; %bb.2:                                ;   in Loop: Header=BB1_1 Depth=1
	v_and_b32_e32 v11, 0xffff, v1
	s_mov_b32 s6, exec_lo
	v_mov_b32_e32 v9, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_u32_u24_e32 v3, 0xcccd, v11
	v_lshrrev_b32_e32 v7, 20, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u16 v3, v7, 20
	v_sub_nc_u16 v1, v1, v3
	v_add_nc_u32_e32 v3, s15, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v8, 0xffff, v1
	v_add_nc_u32_e32 v1, s14, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_u32_e32 v4, v3, v1
	v_cmpx_gt_u32_e32 20, v4
	s_cbranch_execz .LBB1_4
; %bb.3:                                ;   in Loop: Header=BB1_1 Depth=1
	v_mad_u64_u32 v[9:10], null, 0xa0, v3, s[0:1]
	v_lshlrev_b64 v[12:13], 3, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v9, vcc_lo, v9, v12
	v_add_co_ci_u32_e32 v10, vcc_lo, v10, v13, vcc_lo
	global_load_b32 v9, v[9:10], off
.LBB1_4:                                ; %._crit_edge187
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	v_mad_i64_i32 v[12:13], null, v1, 20, 0
	v_mul_u32_u24_e32 v4, 20, v8
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v1, -1, v9
	v_mad_u32_u24 v11, v11, 20, 0x5dc0
	s_mov_b32 s6, 1
	v_mad_u32_u24 v4, 0x190, v7, v4
	v_mad_i64_i32 v[14:15], null, 0x190, v3, v[12:13]
	v_lshlrev_b32_e32 v3, 2, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add3_u32 v10, v4, v3, 0x5dc0
	v_add_co_u32 v3, vcc_lo, s2, v14
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v4, vcc_lo, s3, v15, vcc_lo
.LBB1_5:                                ;   Parent Loop BB1_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_mov_b32 s7, exec_lo
	global_store_b32 v[3:4], v5, off
	v_cmpx_ne_u32_e64 s6, v9
	s_xor_b32 s7, exec_lo, s7
	s_cbranch_execz .LBB1_7
; %bb.6:                                ;   in Loop: Header=BB1_5 Depth=2
	ds_store_b32 v11, v5
.LBB1_7:                                ; %Flow228
                                        ;   in Loop: Header=BB1_5 Depth=2
	s_and_not1_saveexec_b32 s7, s7
	s_cbranch_execz .LBB1_9
; %bb.8:                                ;   in Loop: Header=BB1_5 Depth=2
	ds_store_b32 v10, v2
	ds_inc_rtn_u32 v12, v2, v6 offset:32004
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v12, v12, 12
	ds_store_2addr_b32 v12, v8, v7 offset1:1
	ds_store_b32 v12, v1 offset:8
.LBB1_9:                                ;   in Loop: Header=BB1_5 Depth=2
	s_or_b32 exec_lo, exec_lo, s7
	v_add_co_u32 v3, vcc_lo, v3, 4
	v_add_co_ci_u32_e32 v4, vcc_lo, 0, v4, vcc_lo
	v_add_nc_u32_e32 v11, 4, v11
	s_add_i32 s6, s6, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s6, 6
	s_cbranch_scc1 .LBB1_5
.LBB1_10:                               ; %Flow230
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_add_i32 s4, s4, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmpk_eq_i32 s4, 0x190
	s_cbranch_scc0 .LBB1_1
; %bb.11:
	v_dual_mov_b32 v3, 0x7cf :: v_dual_mov_b32 v4, 0
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_mov_b32 s0, exec_lo
	ds_inc_rtn_u32 v1, v4, v3 offset:32000
	ds_load_b32 v2, v4 offset:32004
	s_waitcnt lgkmcnt(0)
	v_cmpx_lt_u32_e64 v1, v2
	s_cbranch_execz .LBB1_33
; %bb.12:                               ; %.lr.ph.preheader
	s_mov_b32 s1, 0
.LBB1_13:                               ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	v_mul_lo_u32 v5, v1, 12
	s_mov_b32 s4, exec_lo
	ds_load_2addr_b32 v[1:2], v5 offset1:1
	s_waitcnt lgkmcnt(0)
	v_max_u32_e32 v6, v1, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u32_e32 20, v6
	s_cbranch_execz .LBB1_32
; %bb.14:                               ;   in Loop: Header=BB1_13 Depth=1
	ds_load_b32 v5, v5 offset:8
	v_mul_lo_u32 v6, v1, 20
	v_mul_lo_u32 v7, 0x190, v2
	s_mov_b32 s5, 0
	s_mov_b32 s6, exec_lo
                                        ; implicit-def: $vgpr9
	s_waitcnt lgkmcnt(0)
	v_lshlrev_b32_e32 v8, 2, v5
	s_delay_alu instid0(VALU_DEP_1)
	v_add3_u32 v6, v7, v6, v8
	ds_load_b32 v8, v6 offset:24000
	v_add_nc_u32_e32 v6, 0x5dc0, v6
	s_waitcnt lgkmcnt(0)
	v_add_nc_u32_e32 v7, 1, v8
	v_cmpx_ne_u32_e32 0, v2
	s_xor_b32 s6, exec_lo, s6
	s_cbranch_execz .LBB1_18
; %bb.15:                               ;   in Loop: Header=BB1_13 Depth=1
	v_add_nc_u32_e32 v10, 0xfffffe70, v6
	v_add_nc_u32_e32 v9, 1, v8
	s_mov_b32 s5, exec_lo
	ds_min_rtn_i32 v10, v10, v9
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_u32_e64 v10, v9
	s_cbranch_execz .LBB1_17
; %bb.16:                               ;   in Loop: Header=BB1_13 Depth=1
	ds_inc_rtn_u32 v10, v4, v3 offset:32004
	v_add_nc_u32_e32 v11, -1, v2
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v10, v10, 12
	ds_store_2addr_b32 v10, v1, v11 offset1:1
	ds_store_b32 v10, v5 offset:8
.LBB1_17:                               ;   in Loop: Header=BB1_13 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	v_cmp_ne_u32_e32 vcc_lo, 19, v2
	s_and_b32 s5, vcc_lo, exec_lo
.LBB1_18:                               ; %Flow223
                                        ;   in Loop: Header=BB1_13 Depth=1
	s_and_not1_saveexec_b32 s6, s6
; %bb.19:                               ; %._crit_edge189
                                        ;   in Loop: Header=BB1_13 Depth=1
	v_add_nc_u32_e32 v9, 1, v8
	s_or_b32 s5, s5, exec_lo
; %bb.20:                               ; %Flow224
                                        ;   in Loop: Header=BB1_13 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	s_and_saveexec_b32 s6, s5
	s_cbranch_execz .LBB1_23
; %bb.21:                               ;   in Loop: Header=BB1_13 Depth=1
	ds_min_rtn_i32 v10, v6, v9 offset:400
	s_waitcnt lgkmcnt(0)
	v_cmp_gt_u32_e32 vcc_lo, v10, v9
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_23
; %bb.22:                               ;   in Loop: Header=BB1_13 Depth=1
	ds_inc_rtn_u32 v9, v4, v3 offset:32004
	v_add_nc_u32_e32 v10, 1, v2
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v9, v9, 12
	ds_store_2addr_b32 v9, v1, v10 offset1:1
	ds_store_b32 v9, v5 offset:8
.LBB1_23:                               ;   in Loop: Header=BB1_13 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	s_mov_b32 s5, 0
	s_mov_b32 s6, exec_lo
	v_cmpx_ne_u32_e32 0, v1
	s_xor_b32 s6, exec_lo, s6
	s_cbranch_execz .LBB1_27
; %bb.24:                               ;   in Loop: Header=BB1_13 Depth=1
	v_subrev_nc_u32_e32 v9, 20, v6
	v_add_nc_u32_e32 v7, 1, v8
	s_mov_b32 s5, exec_lo
	ds_min_rtn_i32 v8, v9, v7
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_u32_e64 v8, v7
	s_cbranch_execz .LBB1_26
; %bb.25:                               ;   in Loop: Header=BB1_13 Depth=1
	ds_inc_rtn_u32 v8, v4, v3 offset:32004
	v_add_nc_u32_e32 v9, -1, v1
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v8, v8, 12
	ds_store_2addr_b32 v8, v9, v2 offset1:1
	ds_store_b32 v8, v5 offset:8
.LBB1_26:                               ;   in Loop: Header=BB1_13 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	v_cmp_ne_u32_e32 vcc_lo, 19, v1
	s_and_b32 s5, vcc_lo, exec_lo
.LBB1_27:                               ; %Flow219
                                        ;   in Loop: Header=BB1_13 Depth=1
	s_and_not1_saveexec_b32 s6, s6
; %bb.28:                               ; %._crit_edge188
                                        ;   in Loop: Header=BB1_13 Depth=1
	s_or_b32 s5, s5, exec_lo
; %bb.29:                               ; %Flow220
                                        ;   in Loop: Header=BB1_13 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 exec_lo, exec_lo, s5
	s_cbranch_execz .LBB1_32
; %bb.30:                               ;   in Loop: Header=BB1_13 Depth=1
	ds_min_rtn_i32 v6, v6, v7 offset:20
	s_waitcnt lgkmcnt(0)
	v_cmp_gt_u32_e32 vcc_lo, v6, v7
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_32
; %bb.31:                               ;   in Loop: Header=BB1_13 Depth=1
	ds_inc_rtn_u32 v6, v4, v3 offset:32004
	v_add_nc_u32_e32 v1, 1, v1
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v6, v6, 12
	ds_store_2addr_b32 v6, v1, v2 offset1:1
	ds_store_b32 v6, v5 offset:8
.LBB1_32:                               ; %Flow225
                                        ;   in Loop: Header=BB1_13 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	ds_inc_rtn_u32 v1, v4, v3 offset:32000
	ds_load_b32 v2, v4 offset:32004
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_u32_e32 vcc_lo, v1, v2
	s_or_b32 s1, vcc_lo, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB1_13
.LBB1_33:                               ; %Flow227
	s_or_b32 exec_lo, exec_lo, s0
	s_mov_b32 s0, 0
	s_barrier
	buffer_gl0_inv
.LBB1_34:                               ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_38 Depth 2
	v_add_nc_u32_e32 v2, s0, v0
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u32_e32 0x190, v2
	s_cbranch_execz .LBB1_39
; %bb.35:                               ;   in Loop: Header=BB1_34 Depth=1
	v_and_b32_e32 v3, 0xffff, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_u32_u24_e32 v1, 0xcccd, v3
	v_lshrrev_b32_e32 v4, 20, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v1, s15, v4
	v_cmp_gt_u32_e32 vcc_lo, 20, v1
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_39
; %bb.36:                               ;   in Loop: Header=BB1_34 Depth=1
	v_mul_lo_u16 v4, v4, 20
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u16 v2, v2, v4
	v_and_b32_e32 v2, 0xffff, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v2, s14, v2
	v_cmp_gt_u32_e32 vcc_lo, 20, v2
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_39
; %bb.37:                               ; %.preheader
                                        ;   in Loop: Header=BB1_34 Depth=1
	v_mad_u64_u32 v[4:5], null, v2, 20, 0
	v_mad_u32_u24 v3, v3, 20, 0x5dc0
	s_movk_i32 s4, 0xffec
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[6:7], null, 0x190, v1, v[4:5]
	v_add_co_u32 v1, vcc_lo, s2, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, s3, v7, vcc_lo
.LBB1_38:                               ;   Parent Loop BB1_34 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_add_nc_u32_e32 v4, s4, v3
	s_add_i32 s4, s4, 4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s4, 0
	ds_load_b32 v4, v4 offset:20
	s_waitcnt lgkmcnt(0)
	global_atomic_min_i32 v[1:2], v4, off
	v_add_co_u32 v1, vcc_lo, v1, 4
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v2, vcc_lo
	s_cbranch_scc1 .LBB1_38
.LBB1_39:                               ; %.loopexit
                                        ;   in Loop: Header=BB1_34 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_add_i32 s0, s0, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmpk_eq_i32 s0, 0x190
	s_cbranch_scc0 .LBB1_34
; %bb.40:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
		.amdhsa_group_segment_fixed_size 32008
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 16
		.amdhsa_user_sgpr_count 14
		.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 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 16
		.amdhsa_next_free_sgpr 16
		.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_end1:
	.size	_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap, .Lfunc_end1-_Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1376
; NumSgprs: 18
; NumVgprs: 16
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 32008 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 16
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_ ; -- Begin function _Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.globl	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
	.p2align	8
	.type	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_,@function
_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_: ; @_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
; %bb.0:
	s_load_b256 s[0:7], s[0:1], 0x0
	v_mov_b32_e32 v4, 0
	s_mul_i32 s15, s15, 20
	s_mul_i32 s8, s14, 20
	s_mov_b32 s9, 0
	ds_store_b32 v4, v4
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB2_1:                                ; =>This Inner Loop Header: Depth=1
	v_add_nc_u32_e32 v1, s9, v0
	s_mov_b32 s10, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u32_e32 0x190, v1
	s_cbranch_execz .LBB2_7
; %bb.2:                                ;   in Loop: Header=BB2_1 Depth=1
	v_and_b32_e32 v2, 0xffff, v1
	s_mov_b32 s11, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_u32_u24_e32 v2, 0xcccd, v2
	v_lshrrev_b32_e32 v2, 20, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v5, s15, v2
	v_cmpx_gt_u32_e32 20, v5
	s_cbranch_execz .LBB2_6
; %bb.3:                                ;   in Loop: Header=BB2_1 Depth=1
	v_mul_lo_u16 v2, v2, 20
	v_mad_u64_u32 v[6:7], null, 0xa0, v5, s[0:1]
	s_mov_b32 s12, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u16 v1, v1, v2
	v_and_b32_e32 v1, 0xffff, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v2, s8, v1
	v_ashrrev_i32_e32 v3, 31, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[8:9], 3, v[2:3]
	v_add_co_u32 v6, vcc_lo, v6, v8
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, v7, v9, vcc_lo
	global_load_b32 v3, v[6:7], off
	s_waitcnt vmcnt(0)
	v_cmpx_gt_i32_e32 1, v3
	s_cbranch_execz .LBB2_5
; %bb.4:                                ; %.preheader
                                        ;   in Loop: Header=BB2_1 Depth=1
	v_mad_u64_u32 v[6:7], null, 0x190, v5, s[2:3]
	v_add_nc_u32_e32 v5, s14, v5
	s_delay_alu instid0(VALU_DEP_2)
	v_mad_i64_i32 v[10:11], null, v2, 20, v[6:7]
	s_clause 0x1
	global_load_b128 v[6:9], v[10:11], off
	global_load_b32 v2, v[10:11], off offset:16
	s_waitcnt vmcnt(1)
	v_cvt_f32_i32_e32 v3, v6
	v_cvt_f32_i32_e32 v10, v9
	v_mul_lo_u32 v6, 0x64, v6
	v_mul_lo_u32 v9, 0x64, v9
	v_mul_lo_u32 v11, 0x64, v7
	s_waitcnt vmcnt(0)
	v_cvt_f32_i32_e32 v2, v2
	v_mul_f32_e32 v12, 0xbb03126f, v3
	v_cvt_f32_i32_e32 v7, v7
	v_dual_mul_f32 v3, 0xba83126f, v3 :: v_dual_mul_f32 v10, 0xba83126f, v10
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_f32_e32 v13, 0xbb03126f, v2
	v_dual_mul_f32 v2, 0xba83126f, v2 :: v_dual_mul_f32 v7, 0xba83126f, v7
	v_min3_i32 v6, v6, v9, v11
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_dual_mul_f32 v9, 0x42c80000, v12 :: v_dual_mul_f32 v10, 0x42c80000, v10
	v_mul_f32_e32 v11, 0x42c80000, v13
	v_cvt_f32_i32_e32 v8, v8
	v_dual_mul_f32 v3, 0x42c80000, v3 :: v_dual_mul_f32 v2, 0x42c80000, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_dual_mul_f32 v12, 0x3fb8aa3b, v9 :: v_dual_mul_f32 v13, 0x3fb8aa3b, v11
	v_cvt_f32_i32_e32 v6, v6
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v9
	v_rndne_f32_e32 v20, v12
	v_mul_f32_e32 v7, 0x42c80000, v7
	v_fma_f32 v19, 0x3fb8aa3b, v9, -v12
	v_rndne_f32_e32 v22, v13
	v_mul_f32_e32 v8, 0xbb03126f, v8
	v_dual_sub_f32 v12, v12, v20 :: v_dual_mul_f32 v17, 0x3fb8aa3b, v2
	v_mul_f32_e32 v18, 0x3fb8aa3b, v7
	v_fma_f32 v21, 0x3fb8aa3b, v11, -v13
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_dual_sub_f32 v13, v13, v22 :: v_dual_mul_f32 v8, 0x42c80000, v8
	v_mul_f32_e32 v14, 0x3fb8aa3b, v3
	v_rndne_f32_e32 v32, v18
	v_fma_f32 v31, 0x3fb8aa3b, v7, -v18
	v_fmac_f32_e32 v21, 0x32a5705f, v11
	v_mul_f32_e32 v15, 0x3fb8aa3b, v8
	v_fma_f32 v23, 0x3fb8aa3b, v3, -v14
	v_sub_f32_e32 v18, v18, v32
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_dual_mul_f32 v16, 0x3fb8aa3b, v10 :: v_dual_add_f32 v13, v13, v21
	v_fma_f32 v25, 0x3fb8aa3b, v8, -v15
	v_rndne_f32_e32 v26, v15
	v_rndne_f32_e32 v24, v14
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_rndne_f32_e32 v28, v16
	v_fmac_f32_e32 v19, 0x32a5705f, v9
	v_fma_f32 v27, 0x3fb8aa3b, v10, -v16
	v_dual_sub_f32 v15, v15, v26 :: v_dual_sub_f32 v14, v14, v24
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_sub_f32_e32 v16, v16, v28
	v_dual_fmac_f32 v25, 0x32a5705f, v8 :: v_dual_add_f32 v12, v12, v19
	v_mul_f32_e32 v6, 0xba83126f, v6
	v_cvt_i32_f32_e32 v20, v20
	v_exp_f32_e32 v13, v13
	s_delay_alu instid0(VALU_DEP_3)
	v_add_f32_e32 v15, v15, v25
	v_exp_f32_e32 v12, v12
	v_mul_f32_e32 v33, 0x3fb8aa3b, v6
	v_rndne_f32_e32 v30, v17
	v_cvt_i32_f32_e32 v22, v22
	v_fma_f32 v29, 0x3fb8aa3b, v2, -v17
	v_cvt_i32_f32_e32 v24, v24
	v_fma_f32 v34, 0x3fb8aa3b, v6, -v33
	v_fmac_f32_e32 v23, 0x32a5705f, v3
	v_ldexp_f32 v13, v13, v22
	v_exp_f32_e32 v15, v15
	v_ldexp_f32 v12, v12, v20
	v_fmac_f32_e32 v34, 0x32a5705f, v6
	v_dual_add_f32 v14, v14, v23 :: v_dual_sub_f32 v17, v17, v30
	v_cvt_i32_f32_e32 v26, v26
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_cndmask_b32_e32 v12, 0, v12, vcc_lo
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v11
	v_exp_f32_e32 v14, v14
	v_cvt_i32_f32_e32 v28, v28
	s_delay_alu instid0(TRANS32_DEP_2) | instskip(SKIP_4) | instid1(TRANS32_DEP_1)
	v_ldexp_f32 v15, v15, v26
	v_cvt_i32_f32_e32 v21, v30
	v_cndmask_b32_e32 v13, 0, v13, vcc_lo
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v3
	v_rndne_f32_e32 v35, v33
	v_ldexp_f32 v14, v14, v24
	v_fmac_f32_e32 v31, 0x32a5705f, v7
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cvt_i32_f32_e32 v23, v35
	v_cndmask_b32_e32 v14, 0, v14, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_dual_fmac_f32 v27, 0x32a5705f, v10 :: v_dual_add_f32 v18, v18, v31
	v_fmac_f32_e32 v29, 0x32a5705f, v2
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v8
	v_add_f32_e32 v16, v16, v27
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_exp_f32_e32 v18, v18
	v_cndmask_b32_e32 v15, 0, v15, vcc_lo
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v10
	v_exp_f32_e32 v16, v16
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v16, v16, v28
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_add_f32 v17, v17, v29 :: v_dual_cndmask_b32 v16, 0, v16
	v_exp_f32_e32 v17, v17
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v2
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v17, v17, v21
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v17, 0, v17, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v9
	v_cndmask_b32_e32 v9, 0x7f800000, v12, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v11
	v_cvt_i32_f32_e32 v12, v32
	v_fma_f32 v9, v9, 0, 0
	v_cndmask_b32_e32 v11, 0x7f800000, v13, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v3
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_ldexp_f32 v12, v18, v12
	v_fmac_f32_e32 v9, 0, v11
	v_cndmask_b32_e32 v3, 0x7f800000, v14, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v8
	v_cndmask_b32_e32 v8, 0x7f800000, v15, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v10
	v_dual_sub_f32 v19, v33, v35 :: v_dual_cndmask_b32 v10, 0x7f800000, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v19, v19, v34
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v2
	v_exp_f32_e32 v19, v19
	v_cndmask_b32_e32 v11, 0x7f800000, v17, vcc_lo
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v6
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v19, v19, v23
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v2, 0, v19, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v6
	v_dual_cndmask_b32 v6, 0x7f800000, v2 :: v_dual_fmac_f32 v9, 0, v3
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v7
	v_mad_u64_u32 v[2:3], null, v5, 20, v[1:2]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_sub_f32_e32 v5, 1.0, v6
	v_fmac_f32_e32 v9, 0, v8
	v_cndmask_b32_e32 v1, 0, v12, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v7
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_fmac_f32_e32 v9, 0, v10
	v_ashrrev_i32_e32 v3, 31, v2
	v_cndmask_b32_e32 v1, 0x7f800000, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_dual_fmac_f32 v9, 0, v11 :: v_dual_sub_f32 v6, 1.0, v1
	v_lshlrev_b64 v[1:2], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v9, 0, v5
	v_add_co_u32 v1, vcc_lo, s6, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f32_e32 v3, v6, v9
	v_add_co_ci_u32_e32 v2, vcc_lo, s7, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_2)
	v_add_f32_e32 v4, v4, v3
	global_store_b32 v[1:2], v3, off
.LBB2_5:                                ; %Flow130
                                        ;   in Loop: Header=BB2_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
.LBB2_6:                                ; %Flow131
                                        ;   in Loop: Header=BB2_1 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s11
.LBB2_7:                                ;   in Loop: Header=BB2_1 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s10
	s_add_i32 s9, s9, 1
	s_cmpk_eq_i32 s9, 0x190
	s_cbranch_scc0 .LBB2_1
; %bb.8:
	v_bfrev_b32_e32 v0, 1
	s_mov_b32 s0, exec_lo
.LBB2_9:                                ; %ComputeLoop
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_ctz_i32_b32 s1, s0
	v_readlane_b32 s2, v4, s1
	s_lshl_b32 s1, 1, s1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s0, s0, s1
	s_cmp_lg_u32 s0, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v0, s2, v0
	s_cbranch_scc1 .LBB2_9
; %bb.10:                               ; %ComputeEnd
	v_mbcnt_lo_u32_b32 v1, exec_lo, 0
	s_mov_b32 s0, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v1
	s_xor_b32 s0, exec_lo, s0
	s_cbranch_execz .LBB2_12
; %bb.11:
	v_mov_b32_e32 v1, 0
	ds_add_f32 v1, v0
.LBB2_12:
	s_or_b32 exec_lo, exec_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_mov_b32 s0, exec_lo
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	v_mbcnt_lo_u32_b32 v0, s0, 0
	s_barrier
	buffer_gl0_inv
	s_mov_b32 s1, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB2_15
; %bb.13:
	s_bcnt1_i32_b32 s0, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cvt_f32_ubyte0_e32 v3, s0
	v_mov_b32_e32 v2, 0
	s_mov_b32 s0, 0
	global_load_b32 v1, v2, s[4:5]
	ds_load_b32 v0, v2
	s_waitcnt lgkmcnt(0)
	v_mul_f32_e32 v3, v0, v3
.LBB2_14:                               ; %atomicrmw.start
                                        ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v0, v1, v3
	global_atomic_cmpswap_b32 v0, v2, v[0:1], s[4:5] glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, v0, v1
	v_mov_b32_e32 v1, v0
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s0
	s_cbranch_execnz .LBB2_14
.LBB2_15:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
		.amdhsa_group_segment_fixed_size 4
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.amdhsa_user_sgpr_count 14
		.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 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 36
		.amdhsa_next_free_sgpr 16
		.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_end2:
	.size	_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_, .Lfunc_end2-_Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1584
; NumSgprs: 18
; NumVgprs: 36
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 4
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 36
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi ; -- Begin function _Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.globl	_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
	.p2align	8
	.type	_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi,@function
_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi: ; @_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
; %bb.0:
	s_load_b256 s[4:11], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_load_b32 s8, s[8:9], 0x0
	s_load_b32 s9, s[6:7], 0x0
	s_load_b128 s[0:3], s[0:1], 0x20
	s_waitcnt lgkmcnt(0)
	v_cmp_ngt_f32_e64 s9, s8, s9
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s9
	s_cbranch_vccz .LBB3_2
; %bb.1:
	s_load_b64 s[10:11], s[10:11], 0x0
	s_load_b64 s[12:13], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_mul_hi_i32 s9, s11, 0xa0
	s_mulk_i32 s11, 0xa0
	s_ashr_i32 s15, s10, 31
	s_mov_b32 s14, s10
	s_add_u32 s11, s4, s11
	s_addc_u32 s9, s5, s9
	s_lshl_b64 s[14:15], s[14:15], 3
	s_mul_hi_i32 s16, s13, 0xa0
	s_mulk_i32 s13, 0xa0
	s_add_u32 s14, s11, s14
	s_mov_b32 s10, s12
	s_addc_u32 s15, s9, s15
	s_ashr_i32 s11, s12, 31
	s_add_u32 s9, s4, s13
	s_addc_u32 s12, s5, s16
	s_lshl_b64 s[10:11], s[10:11], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s10, s9, s10
	s_addc_u32 s11, s12, s11
	s_load_b32 s9, s[10:11], 0x0
	s_waitcnt lgkmcnt(0)
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s9
	s_load_b32 s9, s[14:15], 0x0
	s_waitcnt lgkmcnt(0)
	global_store_b32 v0, v1, s[14:15]
	global_load_b64 v[0:1], v0, s[0:1]
	s_mov_b32 s1, 0
	s_mov_b32 s0, 0
	s_waitcnt vmcnt(0)
	v_mul_lo_u32 v4, 0xa0, v1
	v_ashrrev_i32_e32 v3, 31, v0
	v_mov_b32_e32 v2, v0
	v_mul_hi_i32 v5, 0xa0, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[0:1], 3, v[2:3]
	v_add_co_u32 v2, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_add_co_u32 v0, vcc_lo, v2, v0
	v_mov_b32_e32 v2, s9
	v_add_co_ci_u32_e32 v1, vcc_lo, v3, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
	s_branch .LBB3_3
.LBB3_2:
	s_mov_b32 s1, -1
                                        ; implicit-def: $sgpr0
.LBB3_3:                                ; %Flow
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s1
	s_cbranch_vccnz .LBB3_5
; %bb.4:
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s8
	s_mov_b32 s0, 1
	global_store_b32 v0, v1, s[6:7]
.LBB3_5:
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s0
	global_store_b32 v0, v1, s[2:3]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 48
		.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 0
		.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 6
		.amdhsa_next_free_sgpr 17
		.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_end3:
	.size	_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi, .Lfunc_end3-_Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 376
; NumSgprs: 19
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 19
; NumVGPRsForWavesPerEU: 6
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; 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	__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 __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
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_
    .private_segment_fixed_size: 0
    .sgpr_count:     13
    .sgpr_spill_count: 0
    .symbol:         _Z16generateProposalP10ZoningPlanPjP15HIP_vector_typeIiLj2EES4_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 32008
    .kernarg_segment_align: 8
    .kernarg_segment_size: 16
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z22computeDistanceToStoreP10ZoningPlanP11DistanceMap.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     16
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .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
    .group_segment_fixed_size: 4
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z12computeScoreP10ZoningPlanP11DistanceMapPfS3_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     36
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .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
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 48
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi
    .private_segment_fixed_size: 0
    .sgpr_count:     19
    .sgpr_spill_count: 0
    .symbol:         _Z14acceptProposalP10ZoningPlanPfS1_P15HIP_vector_typeIiLj2EES4_Pi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
