/*
 * SpaceTime Simulator
 *   Curso Deep Learning y Cuda - 2020
 *   Autor: Oscar Noel Amaya Garcia   
 *   email: dbanshee@gmail.com
 */
 
#include <cuda_runtime.h>

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <unistd.h>
#include <string.h>
#include <sys/time.h>

#define RUN_MODE_SIM            0
#define RUN_MODE_BENCH          1

#define SP_FILENAME             "sp.json"
#define SP_FILENAME_BUFF1       "sp_0.json"
#define SP_FILENAME_BUFF2       "sp_1.json"
#define SP_FILENAME_BENCH       "sp_bench.json"
#define MAX_BLACK_HOLES         10
#define SOFTENING               1e-9f
#define DT                      0.05f

#define MAX_ASTEROIDS           30
#define AST_FILENAME            "ast.json"
#define AST_FILENAME_BUFF1      "ast_0.json"
#define AST_FILENAME_BUFF2      "ast_1.json"
#define AST_FILENAME_BENCH      "ast_bench.json"

#define MAX_BENCHMARKS          128
#define BENCH_FILENAME          "benchmark.json"
#define BENCH_TIME_SECS         10
#define BENCH_CPU               0
#define BENCH_GPU               1
#define BENCH_REGEN_BH_STEPS    5
#define BENCH_FILE_ACCESS_STEPS 3

#define CUDA_OPT_NLEVELS        4
#define CUDA_OPT_LEVEL_0        0
#define CUDA_OPT_LEVEL_1        1
#define CUDA_OPT_LEVEL_2        2
#define CUDA_OPT_LEVEL_3        3

#define MAX_TIME_SIMULATION_SEC 360
#define REGEN_BLACK_HOLES_SEC   20

#define NUM_BECHMARKS 10

typedef struct blackHole {
    float x, y, g;
} blackHole;

typedef struct spacePoint {
    float x, y, g;
} spacePoint;

typedef struct asteroid { 
    float x, y, vx, vy; 
} asteroid;


typedef struct benchmark {
    char name[1024];
    int number;
    int config;
    int type;   // CPU = 0, GPU = 1
    long time;  // millis
    int steps;
} benchmark;


///////////////
// Global Vars
///////////////

// Runtime
int runMode = RUN_MODE_SIM;
int spCurrentBuff = 0; 
int astCurrentBuff = 0; 
int nBlackHoles = 0;
int nAsteroids = MAX_ASTEROIDS;
blackHole* blackHoles = NULL;
int bhSize;
asteroid* asteroids = NULL;
int astSize;
spacePoint* SPBox = NULL;
int spSize;
float top = 2, left = -2, bottom = -2, right = 2;
float spStep = 0.1;
int nelems;
int rows, cols;
int cudaOptLevel = CUDA_OPT_LEVEL_3;

// BenchMark
int nBenchmark;
int bechmarkRegenBHSteps = MAX_TIME_SIMULATION_SEC;
int bechmarkRegenWriteFileSteps = REGEN_BLACK_HOLES_SEC;
benchmark BENCHS[MAX_BENCHMARKS];
char benchName[1024];
int benchNum;
int benchConfig;
int benchType;


//////////////////
// Error Handling
//////////////////

void checkCudaError(cudaError_t err) {
  if (err != cudaSuccess) {
    printf("Error: %s", cudaGetErrorString(err));
    exit(-1);
  }
}

/////////////////
// Miscellaneous
/////////////////

long currentTimeMillis() {
  struct timeval time;
  gettimeofday(&time, NULL);
  long s1 = (int64_t)(time.tv_sec) * 1000;
  long s2 = (time.tv_usec / 1000);
  return s1 + s2;
}

void initRandom() {
    srand(time(NULL));
}

float getRandom() {
    return (double) rand() / (double)RAND_MAX ;
}

float getRandonLimits(float min, float max) {
    float scale = rand() / (float) RAND_MAX; /* [0, 1.0] */
    return min + scale * ( max - min );      /* [min, max] */
}

int nsleep(long miliseconds) {
   struct timespec req, rem;

   if (miliseconds > 999) {   
        req.tv_sec = (int)(miliseconds / 1000);
        req.tv_nsec = (miliseconds - ((long)req.tv_sec * 1000)) * 1000000;
   } else {   
        req.tv_sec = 0;
        req.tv_nsec = miliseconds * 1000000;
   }   

   return nanosleep(&req , &rem);
}

/////////////
// File Dump
/////////////

void spaceTimeToFile(spacePoint* SPBox, int nRows, int nCols) {

    char filename[16];
    
    if (runMode != RUN_MODE_SIM) {
        strcpy(filename, SP_FILENAME_BENCH);
    } else {
        if (spCurrentBuff == 0) {
            strcpy(filename, SP_FILENAME_BUFF1);
            spCurrentBuff = 1;
        } else {
            strcpy(filename, SP_FILENAME_BUFF2);
            spCurrentBuff = 0;
        }
    }
    
    FILE *fp;
    fp = fopen(filename, "w+");
    
    fputs("{\"space\":[", fp);
    for (int i = 0; i < nRows; i++) {
        for (int j = 0; j < nCols; j++) {
            int idx = i*nRows+j; 
            fprintf(fp, "[%0.2f,%0.2f,%0.2f]", SPBox[idx].x, SPBox[idx].y, SPBox[idx].g);
            
            if (i+1 < nRows || j+1 < nCols) {
                fprintf(fp, ",");
            }
        }
    }    
    fputs("]", fp);
    
    fputs(",\"blackHoles\":[", fp);
    for (int i = 0; i < nBlackHoles; i++) {
        fprintf(fp, "[%0.2f,%0.2f,%0.2f]", blackHoles[i].x, blackHoles[i].y, blackHoles[i].g);
        if (i+1 < nBlackHoles) {
            fprintf(fp, ",");
        }
    }
    fputs("]}", fp);
    fclose(fp);
    
    if (runMode == RUN_MODE_SIM) {
        if (access(SP_FILENAME, F_OK) != -1) {
            remove(SP_FILENAME);
        }
        symlink(filename, SP_FILENAME);
    }
}

void asteroidsToFile(asteroid* AST, int nAsteroids) {

    char filename[16];
    if (runMode != RUN_MODE_SIM) {
        strcpy(filename, AST_FILENAME_BENCH);
    } else {
        if (astCurrentBuff == 0) {
            strcpy(filename, AST_FILENAME_BUFF1);
            astCurrentBuff = 1;
        } else {
            strcpy(filename, AST_FILENAME_BUFF2);
            astCurrentBuff = 0;
        }
    }
    
    FILE *fp;
    fp = fopen(filename, "w+");
    
    fputs("{\"asteroids\":[", fp);
    for (int i = 0; i < nAsteroids; i++) { 
        fprintf(fp, "[%0.2f,%0.2f]", AST[i].x, AST[i].y);
            
        if (i+1 < nAsteroids) {
           fprintf(fp, ",");
        }
        
    }    
    fputs("]}", fp);
    fclose(fp);
    
    if (runMode == RUN_MODE_SIM) {
        if (access(AST_FILENAME, F_OK) != -1) {
            remove(AST_FILENAME);
        }
        symlink(filename, AST_FILENAME);
    }
}

void benchMarksToFile(benchmark* BENCHS, int nBenchMarks) {
    printf("Writing benchmark to File: %s\n", BENCH_FILENAME);
    fflush(stdout);
    
    FILE *fp;
    fp = fopen(BENCH_FILENAME, "w+");
    
    fputs("{\"benchmarks\":[", fp);
    for (int i = 0; i < nBenchMarks; i++) { 
        fputs("{", fp);
        fprintf(fp, "\"name\": \"%s\",", BENCHS[i].name);
        fprintf(fp, "\"number\": %d,",   BENCHS[i].number);
        fprintf(fp, "\"type\": %d,",     BENCHS[i].type);
        fprintf(fp, "\"config\": %d,",   BENCHS[i].config);
        fprintf(fp, "\"time\": %ld,",    BENCHS[i].time);
        fprintf(fp, "\"steps\": %d",     BENCHS[i].steps);
        fputs("}", fp);
        
        if (i+1 < nBenchMarks) {
           fprintf(fp, ",");
        }
    }    
    fputs("]}", fp);
    fclose(fp);
}

///////////////
// CPU Runtime
///////////////

void freeBlackHoles() {
    if (blackHoles != NULL) {
        cudaFree(blackHoles);
        blackHoles = NULL;
    }
}

void initBlackHoles() { 
    freeBlackHoles();
    
    bhSize = nBlackHoles*sizeof(blackHole);
    checkCudaError(cudaMallocManaged(&blackHoles, bhSize));
    
    for (int i = 0 ; i < nBlackHoles ; i++) {
        blackHoles[i].x = getRandonLimits(left, right);
        blackHoles[i].y = getRandonLimits(bottom, top);
        blackHoles[i].g = 500.0f;
    }
}

void generateBlackHoles() { 
    nBlackHoles = (int) getRandonLimits(1, MAX_BLACK_HOLES) % MAX_BLACK_HOLES;
    initBlackHoles();
}

void initSpaceTime() {
    rows = abs(right-left) / spStep;
    cols = abs(top-bottom) / spStep;
    nelems = cols*rows;

    spSize = sizeof(spacePoint) * nelems;
    checkCudaError(cudaMallocManaged(&SPBox, spSize));
    memset(SPBox, 0, spSize);
}

void freeSpaceTime() {
    if (SPBox != NULL) {
        cudaFree(SPBox);
        SPBox = NULL;
    }
}

void calculateSpaceTime(spacePoint* SPBox, int nRows, int nCols) { 
    for (int i = 0; i < nRows; i++) {
        for (int j = 0; j < nCols; j++) {
            float x = (i / (float) nRows * (right-left)) + left;
            float y = (j / (float) nCols * (top-bottom)) + bottom;
            
            int idx = i*nRows+j;
            
            float g = 0.0f;
            for (int b = 0; b < nBlackHoles; b++){
                float dx = x - blackHoles[b].x;
                float dy = y - blackHoles[b].y;
                float distSqr = sqrt(dx*dx + dy*dy);
                if (distSqr == 0.0f) {
                    distSqr = 0.000000001;
                }  
                
                float invDist = 1 / (pow(distSqr, 0.05));
                g += (blackHoles[b].g * invDist);                                
            }
            SPBox[idx].x = x;
            SPBox[idx].y = y;
            SPBox[idx].g = g;
        }
    }
}

void freeAsteroids() {
    if (asteroids != NULL) {
        cudaFree(asteroids);
        asteroids = NULL;
    }
}

void initAsteroids() {
    freeAsteroids();
    astSize = nAsteroids*sizeof(asteroid);
    checkCudaError(cudaMallocManaged(&asteroids, astSize));
    memset(asteroids, 0, astSize);

    for (int i = 0; i < nAsteroids; i++) {
        asteroids[i].x = getRandonLimits(left, right);
        asteroids[i].y = getRandonLimits(bottom, top); 
    }
}

void calculateAsteroids(asteroid* AST, int nAsteroids, blackHole* BH, int nBlackHoles, float dt) {
    for (int i = 0; i < nAsteroids; i++) {
        float Fx = 0.0f; float Fy = 0.0f;

        for (int j = 0; j < nBlackHoles; j++) {
            float dx = AST[i].x - BH[j].x;
            float dy = AST[i].y - BH[j].y;
            
            if (dx == 0) break;
            if (dy == 0) break;
            
            float distSqr = dx*dx + dy*dy;
            //float invDist = rsqrtf(distSqr);
            float invDist = 1 / sqrt(distSqr*distSqr);

            Fx += dx * invDist; Fy += dy * invDist;
        }
        
        float modF = sqrt(Fx*Fx + Fy*Fy);
        Fx = Fx / modF;
        Fy = Fy / modF;
        
        AST[i].vx += dt*-Fx; 
        AST[i].vy += dt*-Fy;
        AST[i].x  += AST[i].vx*0.01;
        AST[i].y  += AST[i].vy*0.01;
    }
}

void runSimulationCPU() {
    printf("Running Simulation CPU ...\n");
    printf("SpaceTime Params: rows: %d, cols: %d, size: %d\n", rows, cols, nelems);
    
    long initSimulation = currentTimeMillis();
    int elapsedSimulation = 0;
    long lastBlackHoleRegen = 0;
    
    initSpaceTime();
    initAsteroids();
    
    while (elapsedSimulation < MAX_TIME_SIMULATION_SEC) {   
        
        long current = currentTimeMillis();
        
        if (blackHoles == NULL || (current - lastBlackHoleRegen) / 1000 > REGEN_BLACK_HOLES_SEC) {
            generateBlackHoles();
            calculateSpaceTime(SPBox, rows, cols);
            spaceTimeToFile(SPBox, rows, cols);
            lastBlackHoleRegen = current;
        }
    
        calculateAsteroids(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
        asteroidsToFile(asteroids, nAsteroids);
        
        nsleep(250);
        elapsedSimulation = (currentTimeMillis() - initSimulation) / 1000;
    }
    
    freeAsteroids();
}

////////////////////
// GPU CUDA Runtime
////////////////////

__global__ void calculateSpaceTimeK(spacePoint* SPBox, int nRows, int nCols, float left, float right, float top, float bottom, blackHole* BH, int nBlackHoles) { 
    int i = threadIdx.x + blockIdx.x * blockDim.x;
    int j = threadIdx.y + blockIdx.y * blockDim.y;
    
    if (i < nRows && j < nCols) {
        float x = (i / (float) nRows * (right-left)) + left;
        float y = (j / (float) nCols * (top-bottom)) + bottom;
            
        int idx = i*nRows+j;
            
        float g = 0.0f;
        for (int b = 0; b < nBlackHoles; b++){
            float dx = x - BH[b].x;
            float dy = y - BH[b].y;
            float distSqr = sqrt(dx*dx + dy*dy);
            if (distSqr == 0.0f) {
                distSqr = 0.000000001;
            }  
                
            float invDist = 1 / (pow((float)distSqr, (float)0.05));
            g += (BH[b].g * invDist);                                
        }
        
        SPBox[idx].x = x;
        SPBox[idx].y = y;
        SPBox[idx].g = g;
    }
}

__global__ void calculateSpaceTimeKSHM(spacePoint* SPBox, int nRows, int nCols, float left, float right, float top, float bottom, blackHole* BH, int nBlackHoles, int bhSize) { 

    extern __shared__ float s[];
    blackHole* bhCache = (blackHole*) s;

    int i = threadIdx.x + blockIdx.x * blockDim.x;
    int j = threadIdx.y + blockIdx.y * blockDim.y;
    
    if (i == 0 && j == 0)
        memcpy(bhCache, BH, bhSize);
    __syncthreads();
    
    if (i < nRows && j < nCols) {
        float x = (i / (float) nRows * (right-left)) + left;
        float y = (j / (float) nCols * (top-bottom)) + bottom;
            
        int idx = i*nRows+j;
            
        float g = 0.0f;
        for (int b = 0; b < nBlackHoles; b++){
            float dx = x - bhCache[b].x;
            float dy = y - bhCache[b].y;
            float distSqr = sqrt(dx*dx + dy*dy);
            if (distSqr == 0.0f) {
                distSqr = 0.000000001;
            }  
                
            float invDist = 1 / (pow((float)distSqr, (float)0.05));
            g += (bhCache[b].g * invDist);                                
        }
        
        SPBox[idx].x = x;
        SPBox[idx].y = y;
        SPBox[idx].g = g;
    }
}

__global__ void calculateAsteroidsK(asteroid* AST, int nAsteroids, blackHole* BH, int nBlackHoles, float dt) {

    int idx    = (blockIdx.x * blockDim.x) + threadIdx.x;
    int stride = gridDim.x * blockDim.x;

    for (int i = idx; i < nAsteroids; i += stride) {
        float Fx = 0.0f; float Fy = 0.0f;

        for (int j = 0; j < nBlackHoles; j++) {
            float dx = AST[i].x - BH[j].x;
            float dy = AST[i].y - BH[j].y;
            
            if (dx == 0) break;
            if (dy == 0) break;
            
            float distSqr = dx*dx + dy*dy; //+ SOFTENING;
            //float invDist = rsqrtf(distSqr);
            float invDist = 1 / sqrt(distSqr*distSqr);
            //float invDist3 = invDist * invDist * invDist;

            Fx += dx * invDist; Fy += dy * invDist;
        }
        
        float modF = sqrt(Fx*Fx + Fy*Fy);
        Fx = Fx / modF;
        Fy = Fy / modF;
        
        AST[i].vx += dt*-Fx; 
        AST[i].vy += dt*-Fy;
        AST[i].x  += AST[i].vx*0.01;
        AST[i].y  += AST[i].vy*0.01;
    }
}

__global__ void calculateAsteroidsKSHM(asteroid* AST, int nAsteroids, blackHole* BH, int nBlackHoles, float dt, int bhSize) {

    extern __shared__ float s[];
    blackHole* bhCache = (blackHole*) s;
    
    int idx    = (blockIdx.x * blockDim.x) + threadIdx.x;
    int stride = gridDim.x * blockDim.x;
    
    if (idx == 0) 
        memcpy(bhCache, BH, bhSize);
    __syncthreads();

    for (int i = idx; i < nAsteroids; i += stride) {
        float Fx = 0.0f; float Fy = 0.0f;

        for (int j = 0; j < nBlackHoles; j++) {
            float dx = AST[i].x - bhCache[j].x;
            float dy = AST[i].y - bhCache[j].y;
            
            if (dx == 0) break;
            if (dy == 0) break;
            
            float distSqr = dx*dx + dy*dy;
            float invDist = 1 / sqrt(distSqr*distSqr);

            Fx += dx * invDist; Fy += dy * invDist;
        }
        
        float modF = sqrt(Fx*Fx + Fy*Fy);
        Fx = Fx / modF;
        Fy = Fy / modF;
        
        AST[i].vx += dt*-Fx; 
        AST[i].vy += dt*-Fy;
        AST[i].x  += AST[i].vx*0.01;
        AST[i].y  += AST[i].vy*0.01;
    }
}

void runSimulationGPU() {
    printf("Running Simulation GPU ...\n");
    
    long initSimulation = currentTimeMillis();
    int elapsedSimulation = 0;
    long lastBlackHoleRegen = 0;
    
    int multiProcessorCount = 32;
    initSpaceTime();
    initAsteroids();
    
    printf("SpaceTime Params: rows: %d, cols: %d, size: %d\n", rows, cols, nelems);
    
    dim3 threads_per_block_K1(32, 32, 1);
    dim3 total_blocks_K1((rows / threads_per_block_K1.x) + 1, (cols / threads_per_block_K1.y) + 1, 1);
        
    int threads_per_block_K2 = 1024;
    int number_of_blocks_K2 = ceil(((nAsteroids / (float) threads_per_block_K2) + 1) / multiProcessorCount) * multiProcessorCount;
    
    
    while (elapsedSimulation < MAX_TIME_SIMULATION_SEC) {   
        
        long current = currentTimeMillis();
        
        if (blackHoles == NULL || (current - lastBlackHoleRegen) / 1000 > REGEN_BLACK_HOLES_SEC) {
            generateBlackHoles();
            
            calculateSpaceTimeK<<<total_blocks_K1, threads_per_block_K1>>>(SPBox, rows, cols, left, right, top, bottom, blackHoles, nBlackHoles);
            checkCudaError(cudaGetLastError());
            calculateAsteroidsK<<<number_of_blocks_K2, threads_per_block_K2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
            checkCudaError(cudaGetLastError());
            checkCudaError(cudaDeviceSynchronize());
            
            spaceTimeToFile(SPBox, rows, cols);
            
            lastBlackHoleRegen = current;
        }
    
        calculateAsteroidsK<<<number_of_blocks_K2, threads_per_block_K2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
        checkCudaError(cudaGetLastError());
        
        
        checkCudaError(cudaDeviceSynchronize());
        asteroidsToFile(asteroids, nAsteroids);
        
        nsleep(250);
        elapsedSimulation = (currentTimeMillis() - initSimulation) / 1000;
    }
    
    freeAsteroids();
}


//////////////
// Benchmarks
//////////////

void recordBenchmark(int i, char* name, int num, int type, int config, long time, int steps) {
    if (i < MAX_BENCHMARKS) {
        strcpy(BENCHS[i].name, name);
        BENCHS[i].number = num;
        BENCHS[i].type = type;
        BENCHS[i].config = config;
        BENCHS[i].time = time;
        BENCHS[i].steps = steps;
    }
}

void accessSPBenchCPU(spacePoint* SPBox, int nRows, int nCols) {
    float x, y, g;

    for (int i = 0; i < nRows; i++) {
        for (int j = 0; j < nCols; j++) {
            int idx = i*nRows+j; 
            x = SPBox[idx].x; y = SPBox[idx].y; g = SPBox[idx].g;
            x++; y++; g++;
        }
    }
}

void accessBHBenchCPU(){
    float x, y, g;
    for (int i = 0; i < nBlackHoles; i++) {
        x = blackHoles[i].x; y = blackHoles[i].y; g = blackHoles[i].g;
        x++; y++; g++;
    }
}

void accessAstBenchCPU(asteroid* AST, int nAsteroids){
    float x, y;
    for (int i = 0; i < nAsteroids; i++) { 
        x = AST[i].x; y = AST[i].y;
        x++; y++; 
    }    
}

void runBenchMarkCPU() {
    printf("\nBenchmark CPU %d_%d - Config %d\n", benchNum, benchConfig, benchConfig);
    printf("  top: %0.2f, bottom: %0.2f, left: %0.2f, right: %0.2f\n", top, bottom, left, right);
    printf("  spStep : %f, nBlackHoles :%d, nAsteroids: %d\n", spStep, nBlackHoles, nAsteroids);
    printf("  Matrix Space Resolution [%d, %d]\n", (int) (abs(right-left) / spStep), (int) (abs(top-bottom) / spStep));
    fflush(stdout);
    
    
    initSpaceTime();
    initAsteroids();
    initBlackHoles();
    
    long startTime = currentTimeMillis();
    int step = 0;    
    while (((currentTimeMillis() - startTime) / 1000) < BENCH_TIME_SECS) {
        if (step % bechmarkRegenBHSteps == 0) {
            initBlackHoles();
        }
        
        if (step % bechmarkRegenWriteFileSteps == 0) {
            accessSPBenchCPU(SPBox, rows, cols);
            accessAstBenchCPU(asteroids, nAsteroids);
        }
        
        calculateSpaceTime(SPBox, rows, cols);
        calculateAsteroids(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
        step++;
    }
    
    accessSPBenchCPU(SPBox, rows, cols);
    accessAstBenchCPU(asteroids, nAsteroids);
    
    long elapsedTime = currentTimeMillis() - startTime;
    
    freeSpaceTime();
    freeAsteroids();
    freeBlackHoles();
    
    sprintf(benchName, "Benchmark %d_%d", benchNum, benchConfig);
    recordBenchmark(nBenchmark, benchName, benchNum, benchType, benchConfig, elapsedTime, step);
    printf("\n  Benchmark %d - Time: %ld millis, steps : %d\n", nBenchmark, elapsedTime, step);
    printf("    Steps Per Second : %ld\n\n", step / (elapsedTime / 1000));
}

void runBenchMarkGPU() {

    printf("\n Benchmark GPU %d_%d - Config %d\n", benchNum, benchConfig, benchConfig);
    printf("  top: %0.2f, bottom: %0.2f, left: %0.2f, right: %0.2f\n", top, bottom, left, right);
    printf("  spStep: %f, nBlackHoles: %d, nAsteroids: %d\n", spStep, nBlackHoles, nAsteroids);
    printf("  Matrix Space Resolution [%d, %d]\n", (int) (abs(right-left) / spStep), (int) (abs(top-bottom) / spStep));
    fflush(stdout);
    
    int deviceId;
    int multiProcessorCount = 32;
    int computePreemptionSupported;
    cudaDeviceProp deviceProp;
    
    cudaGetDevice(&deviceId);
    cudaGetDeviceProperties(&deviceProp, deviceId);
    
    multiProcessorCount = deviceProp.multiProcessorCount;
    computePreemptionSupported = deviceProp.computePreemptionSupported;
    printf("  Device supports Compute Preemption: %s\n", computePreemptionSupported ? "Yes" : "No");

    initSpaceTime();
    initAsteroids();
    initBlackHoles();
    

    dim3 threads_per_block_K1(32, 32, 1);
    dim3 total_blocks_K1((rows / threads_per_block_K1.x) + 1, (cols / threads_per_block_K1.y) + 1, 1);
    //printf("    K1 -> Threads Per Block: [%d,%d], Total BLocks: [%d, %d]\n", threads_per_block_K1.x, threads_per_block_K1.y, total_blocks_K1.x, total_blocks_K1.y);
        
    //int threads_per_block_K2 = 64;
    int threads_per_block_K2 = 1024;
    int number_of_blocks_K2 = ceil(((nAsteroids / (float) threads_per_block_K2) + 1) / multiProcessorCount) * multiProcessorCount;
    //printf("    K2 -> Threads Per Block: [%d], Total BLocks: [%d]\n", threads_per_block_K2, number_of_blocks_K2);

    
    long startTime = currentTimeMillis();
    int step = 0;    
    while (((currentTimeMillis() - startTime) / 1000) < BENCH_TIME_SECS) {
        if (step % bechmarkRegenBHSteps == 0) {
            checkCudaError(cudaDeviceSynchronize());
            
            if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported)
                cudaMemPrefetchAsync(blackHoles, bhSize, cudaCpuDeviceId);
            
            initBlackHoles();
            
            if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported)
                cudaMemPrefetchAsync(blackHoles, bhSize, deviceId);
        }
        
        if (step % bechmarkRegenWriteFileSteps == 0) {
            if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported) {
                cudaMemPrefetchAsync(SPBox, spSize, cudaCpuDeviceId);
                cudaMemPrefetchAsync(asteroids, astSize, cudaCpuDeviceId);
            }
        
            //nsleep(150L); // CPU Ocupancy
            checkCudaError(cudaDeviceSynchronize());
            accessSPBenchCPU(SPBox, rows, cols);
            accessAstBenchCPU(asteroids, nAsteroids);
            
            if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported) {
                cudaMemPrefetchAsync(SPBox, spSize, deviceId);
                cudaMemPrefetchAsync(asteroids, astSize, deviceId);
            }
        } 
       
        if (cudaOptLevel >= CUDA_OPT_LEVEL_1) {
            cudaStream_t stream1, stream2;
            checkCudaError(cudaStreamCreate(&stream1));
            checkCudaError(cudaStreamCreate(&stream2));
            
            if (cudaOptLevel >= CUDA_OPT_LEVEL_3) {
                calculateSpaceTimeKSHM<<<total_blocks_K1, threads_per_block_K1, bhSize, stream1>>>(SPBox, rows, cols, left, right, top, bottom, blackHoles, nBlackHoles, bhSize);
                calculateAsteroidsKSHM<<<number_of_blocks_K2, threads_per_block_K2, bhSize, stream2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT, bhSize);
            } else {
                calculateSpaceTimeK<<<total_blocks_K1, threads_per_block_K1, 0, stream1>>>(SPBox, rows, cols, left, right, top, bottom, blackHoles, nBlackHoles);
                calculateAsteroidsK<<<number_of_blocks_K2, threads_per_block_K2, 0, stream2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
            }
            
            checkCudaError(cudaGetLastError());
            cudaStreamDestroy(stream1);
            cudaStreamDestroy(stream2);
        } else {
            calculateSpaceTimeK<<<total_blocks_K1, threads_per_block_K1>>>(SPBox, rows, cols, left, right, top, bottom, blackHoles, nBlackHoles);
            checkCudaError(cudaGetLastError());
            calculateAsteroidsK<<<number_of_blocks_K2, threads_per_block_K2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
            checkCudaError(cudaGetLastError());
        }
        
        step++;
    }
    
    if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported) {
        cudaMemPrefetchAsync(SPBox, spSize, cudaCpuDeviceId);
        cudaMemPrefetchAsync(asteroids, astSize, cudaCpuDeviceId);
    }
    
    checkCudaError(cudaDeviceSynchronize());
    accessSPBenchCPU(SPBox, rows, cols);
    accessAstBenchCPU(asteroids, nAsteroids);

    long elapsedTime = currentTimeMillis() - startTime + 1;
  
    freeSpaceTime();
    freeAsteroids();
    freeBlackHoles();

    sprintf(benchName, "Benchmark %d_%d", benchNum, benchConfig);
    recordBenchmark(nBenchmark, benchName, benchNum, benchType, benchConfig, elapsedTime, step);
    printf("\n  Benchmark %d - Time: %ld millis, steps : %d\n", nBenchmark, elapsedTime, step);
    printf("    Steps Per Second : %ld\n\n", step / (elapsedTime / 1000));
}

void runBenchmarks() {
    benchType = BENCH_GPU;
    
    for (int opLevel =  0; opLevel < CUDA_OPT_NLEVELS; opLevel++) {
        // Start on BENCH_CPU for include CPU execution. 
        for (int cp = BENCH_GPU ; cp <= BENCH_GPU; cp++) {
            benchType = cp;
            benchConfig = cudaOptLevel = opLevel;

            // Benchmark 0
            benchNum = 0;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.01;
            nBlackHoles = 100; nAsteroids = 100;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;

            // Benchmark 1
            benchNum = 1;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.01;
            nBlackHoles = 500; nAsteroids = 500;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();  
            nBenchmark++;
            
            // Benchmark 2
            benchNum = 2;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.01;
            nBlackHoles = 1000; nAsteroids = 1000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();  
            nBenchmark++;
            
            // Benchmark 3
            benchNum = 3;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.01;
            nBlackHoles = 1000; nAsteroids = 5000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();  
            nBenchmark++;

            // Benchmark 4
            benchNum = 4;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.001;
            nBlackHoles = 100; nAsteroids = 100;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;

            // Benchmark 5
            benchNum = 5;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.001;
            nBlackHoles = 500; nAsteroids = 500;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            
            // Benchmark 6
            benchNum = 6;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.001;
            nBlackHoles = 1000; nAsteroids = 1000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            
            // Benchmark 7
            /*
            benchNum = 7;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.001;
            nBlackHoles = 5000; nAsteroids = 5000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            */
            
            // Benchmark 8
            benchNum = 8;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.0005;
            nBlackHoles = 100; nAsteroids = 100;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            
            /*
            // Benchmark 9
            benchNum = 9;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.0005;
            nBlackHoles = 500; nAsteroids = 500;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            */
            
            /*
            // Benchmark 10
            benchNum = 10;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.0005;
            nBlackHoles = 1000; nAsteroids = 1000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            
            // Benchmark 11
            benchNum = 11;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.0005;
            nBlackHoles = 1000; nAsteroids = 1000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            */
        }
    }
    fflush(stdout);
}

void runAllBechmarks() {
    printf("Running All Benchmarks ...\n");
    long startTime = currentTimeMillis();
    nBenchmark = 0;
    runBenchmarks();
    benchMarksToFile(BENCHS, nBenchmark);
    printf("Benchmarks in : %ld seconds\n", (currentTimeMillis() - startTime) / 1000);
}

// Device Query code extracted from https://github.com/NVIDIA/cuda-samples
inline int _ConvertSMVer2Cores(int major, int minor) {
  // Defines for GPU Architecture types (using the SM version to determine
  // the # of cores per SM
  typedef struct {
    int SM;  // 0xMm (hexidecimal notation), M = SM Major version,
    // and m = SM minor version
    int Cores;
  } sSMtoCores;

  sSMtoCores nGpuArchCoresPerSM[] = {
      {0x30, 192},
      {0x32, 192},
      {0x35, 192},
      {0x37, 192},
      {0x50, 128},
      {0x52, 128},
      {0x53, 128},
      {0x60,  64},
      {0x61, 128},
      {0x62, 128},
      {0x70,  64},
      {0x72,  64},
      {0x75,  64},
      {-1, -1}};

  int index = 0;

  while (nGpuArchCoresPerSM[index].SM != -1) {
    if (nGpuArchCoresPerSM[index].SM == ((major << 4) + minor)) {
      return nGpuArchCoresPerSM[index].Cores;
    }

    index++;
  }

  // If we don't find the values, we default use the previous one
  // to run properly
  printf(
      "MapSMtoCores for SM %d.%d is undefined."
      "  Default to use %d Cores/SM\n",
      major, minor, nGpuArchCoresPerSM[index - 1].Cores);
  return nGpuArchCoresPerSM[index - 1].Cores;
}


void printfGPUDeviceInfo(){
    int deviceId;
    cudaDeviceProp deviceProp;
    int driverVersion = 0, runtimeVersion = 0;
    char msg[256];
    
    cudaGetDevice(&deviceId);
    cudaGetDeviceProperties(&deviceProp, deviceId);
    
    printf("GPU Info\n");
    printf(" Device: \"%s\"\n", deviceProp.name);
    cudaDriverGetVersion(&driverVersion);
    cudaRuntimeGetVersion(&runtimeVersion);
    printf("  CUDA Driver Version / Runtime Version          %d.%d / %d.%d\n",
           driverVersion / 1000, (driverVersion % 100) / 10,
           runtimeVersion / 1000, (runtimeVersion % 100) / 10);
    printf("  CUDA Capability Major/Minor version number:    %d.%d\n",
           deviceProp.major, deviceProp.minor);
    snprintf(msg, sizeof(msg),
             "  Total amount of global memory:                 %.0f MBytes "
             "(%llu bytes)\n",
             static_cast<float>(deviceProp.totalGlobalMem / 1048576.0f),
             (unsigned long long)deviceProp.totalGlobalMem);
    printf("%s", msg);

    printf("  (%2d) Multiprocessors, (%3d) CUDA Cores/MP:     %d CUDA Cores\n",
           deviceProp.multiProcessorCount,
           _ConvertSMVer2Cores(deviceProp.major, deviceProp.minor),
           _ConvertSMVer2Cores(deviceProp.major, deviceProp.minor) *
               deviceProp.multiProcessorCount);
    printf(
        "  GPU Max Clock rate:                            %.0f MHz (%0.2f "
        "GHz)\n",
        deviceProp.clockRate * 1e-3f, deviceProp.clockRate * 1e-6f);
        printf(
        "  Maximum Texture Dimension Size (x,y,z)         1D=(%d), 2D=(%d, "
        "%d), 3D=(%d, %d, %d)\n",
        deviceProp.maxTexture1D, deviceProp.maxTexture2D[0],
        deviceProp.maxTexture2D[1], deviceProp.maxTexture3D[0],
        deviceProp.maxTexture3D[1], deviceProp.maxTexture3D[2]);
    printf(
        "  Maximum Layered 1D Texture Size, (num) layers  1D=(%d), %d layers\n",
        deviceProp.maxTexture1DLayered[0], deviceProp.maxTexture1DLayered[1]);
    printf(
        "  Maximum Layered 2D Texture Size, (num) layers  2D=(%d, %d), %d "
        "layers\n",
        deviceProp.maxTexture2DLayered[0], deviceProp.maxTexture2DLayered[1],
        deviceProp.maxTexture2DLayered[2]);

    printf("  Total amount of constant memory:               %zu bytes\n",
           deviceProp.totalConstMem);
    printf("  Total amount of shared memory per block:       %zu bytes\n",
           deviceProp.sharedMemPerBlock);
    printf("  Total number of registers available per block: %d\n",
           deviceProp.regsPerBlock);
    printf("  Warp size:                                     %d\n",
           deviceProp.warpSize);
    printf("  Maximum number of threads per multiprocessor:  %d\n",
           deviceProp.maxThreadsPerMultiProcessor);
    printf("  Maximum number of threads per block:           %d\n",
           deviceProp.maxThreadsPerBlock);
    printf("  Max dimension size of a thread block (x,y,z): (%d, %d, %d)\n",
           deviceProp.maxThreadsDim[0], deviceProp.maxThreadsDim[1],
           deviceProp.maxThreadsDim[2]);
    printf("  Max dimension size of a grid size    (x,y,z): (%d, %d, %d)\n",
           deviceProp.maxGridSize[0], deviceProp.maxGridSize[1],
           deviceProp.maxGridSize[2]);
    printf("  Maximum memory pitch:                          %zu bytes\n",
           deviceProp.memPitch);
    printf("  Texture alignment:                             %zu bytes\n",
           deviceProp.textureAlignment);
    printf(
        "  Concurrent copy and kernel execution:          %s with %d copy "
        "engine(s)\n",
        (deviceProp.deviceOverlap ? "Yes" : "No"), deviceProp.asyncEngineCount);
    printf("  Run time limit on kernels:                     %s\n",
           deviceProp.kernelExecTimeoutEnabled ? "Yes" : "No");
    printf("  Integrated GPU sharing Host Memory:            %s\n",
           deviceProp.integrated ? "Yes" : "No");
    printf("  Support host page-locked memory mapping:       %s\n",
           deviceProp.canMapHostMemory ? "Yes" : "No");
    printf("  Alignment requirement for Surfaces:            %s\n",
           deviceProp.surfaceAlignment ? "Yes" : "No");
    printf("  Device has ECC support:                        %s\n",
           deviceProp.ECCEnabled ? "Enabled" : "Disabled");
    printf("  Device supports Unified Addressing (UVA):      %s\n",
           deviceProp.unifiedAddressing ? "Yes" : "No");
    printf("  Device supports Compute Preemption:            %s\n",
           deviceProp.computePreemptionSupported ? "Yes" : "No");
    printf("  Supports Cooperative Kernel Launch:            %s\n",
           deviceProp.cooperativeLaunch ? "Yes" : "No");
    printf("  Supports MultiDevice Co-op Kernel Launch:      %s\n",
           deviceProp.cooperativeMultiDeviceLaunch ? "Yes" : "No");
    printf("  Device PCI Domain ID / Bus ID / location ID:   %d / %d / %d\n",
           deviceProp.pciDomainID, deviceProp.pciBusID, deviceProp.pciDeviceID);

}

int main(const int argc, const char** argv) {
    runMode = RUN_MODE_SIM; // RUN_MODE_SIM | RUN_MODE_BENCH

    printf("Cuda Space Time Simulator - 2020\n\n");
    printf("  Author: Oscar Noel Amaya Garcia. email: dbanshee@gmail.com\n");
    printf("  nVidia DLI - Volunteer practice\n");
    printf("\n\n");
    
    printfGPUDeviceInfo();
    printf("\n\n");
    
    if (argc > 2) {
        printf("Invalid args.\n");
        printf("cudaspsim [benchmark]\n");
        exit(-1);
    } else if(argc == 2 && strcmp(argv[1], "benchmark") == 0) {
        runMode = RUN_MODE_BENCH;
    }
    
    if (runMode == RUN_MODE_SIM) {
        runSimulationGPU();
    } else {
        runAllBechmarks();
        printf("\n");
    }
}


	.file	"tmpxft_0038eb5a_00000000-6_cudaspsim.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2073:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2073:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"Error: %s"
	.text
	.globl	_Z14checkCudaError9cudaError
	.type	_Z14checkCudaError9cudaError, @function
_Z14checkCudaError9cudaError:
.LFB2040:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L2
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	cudaGetErrorString@PLT
	movl	$2, %edi
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %edi
	call	exit@PLT
.L2:
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2040:
	.size	_Z14checkCudaError9cudaError, .-_Z14checkCudaError9cudaError
	.globl	_Z17currentTimeMillisv
	.type	_Z17currentTimeMillisv, @function
_Z17currentTimeMillisv:
.LFB2041:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	gettimeofday@PLT
	movq	16(%rsp), %rax
	movl	$1000, %esi
	imulq	$1000, 8(%rsp), %rcx
	cqto
	idivq	%rsi
	addq	%rcx, %rax
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2041:
	.size	_Z17currentTimeMillisv, .-_Z17currentTimeMillisv
	.globl	_Z10initRandomv
	.type	_Z10initRandomv, @function
_Z10initRandomv:
.LFB2042:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	xorl	%edi, %edi
	call	time@PLT
	popq	%rdx
	.cfi_def_cfa_offset 8
	movl	%eax, %edi
	jmp	srand@PLT
	.cfi_endproc
.LFE2042:
	.size	_Z10initRandomv, .-_Z10initRandomv
	.globl	_Z9getRandomv
	.type	_Z9getRandomv, @function
_Z9getRandomv:
.LFB2043:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC2(%rip), %xmm0
	popq	%rdx
	.cfi_def_cfa_offset 8
	cvtsd2ss	%xmm0, %xmm0
	ret
	.cfi_endproc
.LFE2043:
	.size	_Z9getRandomv, .-_Z9getRandomv
	.globl	_Z15getRandonLimitsff
	.type	_Z15getRandonLimitsff, @function
_Z15getRandonLimitsff:
.LFB2044:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movss	%xmm0, 12(%rsp)
	movss	%xmm1, 8(%rsp)
	call	rand@PLT
	movss	12(%rsp), %xmm2
	movss	8(%rsp), %xmm1
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC3(%rip), %xmm0
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	subss	%xmm2, %xmm1
	mulss	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	addss	%xmm2, %xmm0
	ret
	.cfi_endproc
.LFE2044:
	.size	_Z15getRandonLimitsff, .-_Z15getRandonLimitsff
	.globl	_Z6nsleepl
	.type	_Z6nsleepl, @function
_Z6nsleepl:
.LFB2045:
	.cfi_startproc
	endbr64
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	cmpq	$999, %rdi
	jle	.L18
	movq	%rdi, %rax
	movl	$1000, %ecx
	cqto
	idivq	%rcx
	cltq
	imulq	$-1000, %rax, %rdx
	addq	%rdi, %rdx
	imulq	$1000000, %rdx, %rdi
	jmp	.L19
.L18:
	imulq	$1000000, %rdi, %rdi
	xorl	%eax, %eax
.L19:
	movq	%rdi, 16(%rsp)
	leaq	24(%rsp), %rsi
	leaq	8(%rsp), %rdi
	movq	%rax, 8(%rsp)
	call	nanosleep@PLT
	movq	40(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$56, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2045:
	.size	_Z6nsleepl, .-_Z6nsleepl
	.section	.rodata.str1.1
.LC4:
	.string	"w+"
.LC5:
	.string	"{\"space\":["
.LC6:
	.string	"[%0.2f,%0.2f,%0.2f]"
.LC7:
	.string	","
.LC8:
	.string	",\"blackHoles\":["
.LC9:
	.string	"]}"
.LC10:
	.string	"sp.json"
	.text
	.globl	_Z15spaceTimeToFileP10spacePointii
	.type	_Z15spaceTimeToFileP10spacePointii, @function
_Z15spaceTimeToFileP10spacePointii:
.LFB2046:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%esi, %ebx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	cmpl	$0, runMode(%rip)
	je	.L23
	movabsq	$7521977184360034419, %rax
	movq	%rax, 40(%rsp)
	movabsq	$31084788931520611, %rax
	movq	%rax, 46(%rsp)
	jmp	.L24
.L23:
	cmpl	$0, spCurrentBuff(%rip)
	jne	.L25
	movabsq	$8030879307144327283, %rax
	movw	$110, 48(%rsp)
	movq	%rax, 40(%rsp)
	movl	$1, spCurrentBuff(%rip)
	jmp	.L24
.L25:
	movabsq	$8030879307161104499, %rax
	movw	$110, 48(%rsp)
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movl	%eax, spCurrentBuff(%rip)
.L24:
	leaq	40(%rsp), %rax
	leaq	.LC4(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	fopen@PLT
	leaq	.LC5(%rip), %rdi
	movq	%rax, %rsi
	movq	%rax, (%rsp)
	call	fputs@PLT
.L26:
	cmpl	%ebx, %r15d
	jge	.L30
	movslq	%r14d, %rcx
	movq	16(%rsp), %rax
	xorl	%ebp, %ebp
	imulq	$12, %rcx, %rcx
	leaq	(%rax,%rcx), %r13
.L31:
	cmpl	%r12d, %ebp
	leal	1(%r15), %r8d
	jge	.L42
	movq	(%rsp), %rdi
	leaq	.LC6(%rip), %rdx
	movb	$3, %al
	incl	%ebp
	movl	$2, %esi
	movl	%r8d, 28(%rsp)
	cvtss2sd	0(%r13), %xmm0
	cvtss2sd	8(%r13), %xmm2
	cvtss2sd	4(%r13), %xmm1
	call	__fprintf_chk@PLT
	movl	28(%rsp), %r8d
	cmpl	%r8d, %ebx
	jg	.L27
	cmpl	%ebp, %r12d
	jle	.L28
.L27:
	movq	(%rsp), %rdi
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L28:
	addq	$12, %r13
	jmp	.L31
.L42:
	movl	%r8d, %r15d
	addl	%ebx, %r14d
	jmp	.L26
.L30:
	movq	(%rsp), %rsi
	movl	$93, %edi
	xorl	%ebx, %ebx
	leaq	.LC6(%rip), %rbp
	call	fputc@PLT
	movq	(%rsp), %rsi
	leaq	.LC8(%rip), %rdi
	call	fputs@PLT
.L32:
	cmpl	%ebx, nBlackHoles(%rip)
	jle	.L43
	imulq	$12, %rbx, %rax
	movq	(%rsp), %rdi
	movq	%rbp, %rdx
	movl	$2, %esi
	addq	blackHoles(%rip), %rax
	cvtss2sd	(%rax), %xmm0
	cvtss2sd	8(%rax), %xmm2
	cvtss2sd	4(%rax), %xmm1
	movb	$3, %al
	call	__fprintf_chk@PLT
	leal	1(%rbx), %eax
	cmpl	%eax, nBlackHoles(%rip)
	jle	.L33
	movq	(%rsp), %rdi
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L33:
	incq	%rbx
	jmp	.L32
.L43:
	movq	(%rsp), %rsi
	leaq	.LC9(%rip), %rdi
	call	fputs@PLT
	movq	(%rsp), %rdi
	call	fclose@PLT
	cmpl	$0, runMode(%rip)
	jne	.L22
	leaq	.LC10(%rip), %rbx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	access@PLT
	incl	%eax
	je	.L36
	movq	%rbx, %rdi
	call	remove@PLT
.L36:
	movq	8(%rsp), %rdi
	movq	%rbx, %rsi
	call	symlink@PLT
.L22:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	addq	$72, %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
.LFE2046:
	.size	_Z15spaceTimeToFileP10spacePointii, .-_Z15spaceTimeToFileP10spacePointii
	.section	.rodata.str1.1
.LC11:
	.string	"{\"asteroids\":["
.LC12:
	.string	"[%0.2f,%0.2f]"
.LC13:
	.string	"ast.json"
	.text
	.globl	_Z15asteroidsToFileP8asteroidi
	.type	_Z15asteroidsToFileP8asteroidi, @function
_Z15asteroidsToFileP8asteroidi:
.LFB2047:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	cmpl	$0, runMode(%rip)
	je	.L45
	movabsq	$7164775530375705441, %rax
	movq	%rax, 8(%rsp)
	movabsq	$31084788931520611, %rax
	movq	%rax, 15(%rsp)
	jmp	.L46
.L45:
	cmpl	$0, astCurrentBuff(%rip)
	jne	.L47
	movabsq	$8316510447187817313, %rax
	movl	$1, astCurrentBuff(%rip)
	movq	%rax, 8(%rsp)
	movl	$7237491, 15(%rsp)
	jmp	.L46
.L47:
	movabsq	$8316510451482784609, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movl	$7237491, 15(%rsp)
	movl	%eax, astCurrentBuff(%rip)
.L46:
	leaq	8(%rsp), %r14
	leaq	.LC4(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	leaq	.LC12(%rip), %r15
	call	fopen@PLT
	leaq	.LC11(%rip), %rdi
	movq	%rax, %rsi
	movq	%rax, %rbp
	call	fputs@PLT
.L48:
	cmpl	%r12d, %r13d
	jge	.L58
	movq	%r15, %rdx
	movl	$2, %esi
	movq	%rbp, %rdi
	movb	$2, %al
	incl	%r13d
	cvtss2sd	(%rbx), %xmm0
	cvtss2sd	4(%rbx), %xmm1
	call	__fprintf_chk@PLT
	cmpl	%r12d, %r13d
	jge	.L49
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L49:
	addq	$16, %rbx
	jmp	.L48
.L58:
	movq	%rbp, %rsi
	leaq	.LC9(%rip), %rdi
	call	fputs@PLT
	movq	%rbp, %rdi
	call	fclose@PLT
	cmpl	$0, runMode(%rip)
	jne	.L44
	leaq	.LC13(%rip), %rbx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	access@PLT
	incl	%eax
	je	.L52
	movq	%rbx, %rdi
	call	remove@PLT
.L52:
	movq	%rbx, %rsi
	movq	%r14, %rdi
	call	symlink@PLT
.L44:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L53
	call	__stack_chk_fail@PLT
.L53:
	addq	$40, %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
.LFE2047:
	.size	_Z15asteroidsToFileP8asteroidi, .-_Z15asteroidsToFileP8asteroidi
	.section	.rodata.str1.1
.LC14:
	.string	"benchmark.json"
.LC15:
	.string	"Writing benchmark to File: %s\n"
.LC16:
	.string	"{\"benchmarks\":["
.LC17:
	.string	"\"name\": \"%s\","
.LC18:
	.string	"\"number\": %d,"
.LC19:
	.string	"\"type\": %d,"
.LC20:
	.string	"\"config\": %d,"
.LC21:
	.string	"\"time\": %ld,"
.LC22:
	.string	"\"steps\": %d"
	.text
	.globl	_Z16benchMarksToFileP9benchmarki
	.type	_Z16benchMarksToFileP9benchmarki, @function
_Z16benchMarksToFileP9benchmarki:
.LFB2048:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	.LC17(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	%esi, %r13d
	leaq	.LC15(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	movl	$2, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC14(%rip), %rbx
	movq	%rbx, %rdx
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	%rbx, %rdi
	leaq	.LC4(%rip), %rsi
	call	fopen@PLT
	leaq	.LC16(%rip), %rdi
	movq	%rax, %rsi
	movq	%rax, %rbx
	call	fputs@PLT
.L60:
	movq	%rbx, %rsi
	cmpl	%r13d, %r12d
	jge	.L64
	movl	$123, %edi
	incl	%r12d
	call	fputc@PLT
	movq	%rbp, %rcx
	movq	%r14, %rdx
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	1024(%rbp), %ecx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC18(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movl	1032(%rbp), %ecx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC19(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movl	1028(%rbp), %ecx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC20(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	1040(%rbp), %rcx
	leaq	.LC21(%rip), %rdx
	call	__fprintf_chk@PLT
	movl	1048(%rbp), %ecx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC22(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movq	%rbx, %rsi
	movl	$125, %edi
	call	fputc@PLT
	cmpl	%r13d, %r12d
	jge	.L61
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L61:
	addq	$1056, %rbp
	jmp	.L60
.L64:
	leaq	.LC9(%rip), %rdi
	call	fputs@PLT
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	fclose@PLT
	.cfi_endproc
.LFE2048:
	.size	_Z16benchMarksToFileP9benchmarki, .-_Z16benchMarksToFileP9benchmarki
	.globl	_Z14freeBlackHolesv
	.type	_Z14freeBlackHolesv, @function
_Z14freeBlackHolesv:
.LFB2049:
	.cfi_startproc
	endbr64
	movq	blackHoles(%rip), %rdi
	testq	%rdi, %rdi
	je	.L71
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	cudaFree@PLT
	xorl	%edx, %edx
	movq	%rdx, blackHoles(%rip)
	popq	%rcx
	.cfi_def_cfa_offset 8
	ret
.L71:
	ret
	.cfi_endproc
.LFE2049:
	.size	_Z14freeBlackHolesv, .-_Z14freeBlackHolesv
	.globl	_Z14initBlackHolesv
	.type	_Z14initBlackHolesv, @function
_Z14initBlackHolesv:
.LFB2050:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	call	_Z14freeBlackHolesv
	imull	$12, nBlackHoles(%rip), %esi
	movl	$1, %edx
	leaq	blackHoles(%rip), %rdi
	movl	%esi, bhSize(%rip)
	movslq	%esi, %rsi
	call	cudaMallocManaged@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
.L75:
	cmpl	%ebx, nBlackHoles(%rip)
	jle	.L78
	imulq	$12, %rbx, %rbp
	movq	blackHoles(%rip), %r12
	incq	%rbx
	movss	right(%rip), %xmm1
	movss	left(%rip), %xmm0
	call	_Z15getRandonLimitsff
	addq	%rbp, %r12
	movss	top(%rip), %xmm1
	movss	%xmm0, (%r12)
	movss	bottom(%rip), %xmm0
	movq	blackHoles(%rip), %r12
	call	_Z15getRandonLimitsff
	movq	blackHoles(%rip), %rax
	addq	%rbp, %r12
	movss	%xmm0, 4(%r12)
	movl	$0x43fa0000, 8(%rax,%rbp)
	jmp	.L75
.L78:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2050:
	.size	_Z14initBlackHolesv, .-_Z14initBlackHolesv
	.globl	_Z18generateBlackHolesv
	.type	_Z18generateBlackHolesv, @function
_Z18generateBlackHolesv:
.LFB2051:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	movss	.LC24(%rip), %xmm1
	movss	.LC25(%rip), %xmm0
	call	_Z15getRandonLimitsff
	movl	$10, %ecx
	cvttss2sil	%xmm0, %eax
	cltd
	idivl	%ecx
	movl	%edx, nBlackHoles(%rip)
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	_Z14initBlackHolesv
	.cfi_endproc
.LFE2051:
	.size	_Z18generateBlackHolesv, .-_Z18generateBlackHolesv
	.globl	_Z13initSpaceTimev
	.type	_Z13initSpaceTimev, @function
_Z13initSpaceTimev:
.LFB2052:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	movss	right(%rip), %xmm0
	movl	$1, %edx
	leaq	SPBox(%rip), %rdi
	subss	left(%rip), %xmm0
	movss	spStep(%rip), %xmm1
	movss	.LC26(%rip), %xmm2
	andps	%xmm2, %xmm0
	divss	%xmm1, %xmm0
	cvttss2sil	%xmm0, %esi
	movss	top(%rip), %xmm0
	subss	bottom(%rip), %xmm0
	andps	%xmm2, %xmm0
	divss	%xmm1, %xmm0
	movl	%esi, rows(%rip)
	cvttss2sil	%xmm0, %eax
	imull	%eax, %esi
	movl	%eax, cols(%rip)
	movl	%esi, nelems(%rip)
	imull	$12, %esi, %esi
	movl	%esi, spSize(%rip)
	movslq	%esi, %rsi
	call	cudaMallocManaged@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	movslq	spSize(%rip), %rcx
	movq	SPBox(%rip), %rdi
	xorl	%eax, %eax
	rep stosb
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2052:
	.size	_Z13initSpaceTimev, .-_Z13initSpaceTimev
	.globl	_Z13freeSpaceTimev
	.type	_Z13freeSpaceTimev, @function
_Z13freeSpaceTimev:
.LFB2053:
	.cfi_startproc
	endbr64
	movq	SPBox(%rip), %rdi
	testq	%rdi, %rdi
	je	.L89
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	cudaFree@PLT
	xorl	%edx, %edx
	movq	%rdx, SPBox(%rip)
	popq	%rcx
	.cfi_def_cfa_offset 8
	ret
.L89:
	ret
	.cfi_endproc
.LFE2053:
	.size	_Z13freeSpaceTimev, .-_Z13freeSpaceTimev
	.globl	_Z18calculateSpaceTimeP10spacePointii
	.type	_Z18calculateSpaceTimeP10spacePointii, @function
_Z18calculateSpaceTimeP10spacePointii:
.LFB2054:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	movl	%esi, %r15d
	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
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 16(%rsp)
	movl	%eax, 12(%rsp)
.L93:
	cmpl	%r15d, %ebp
	jge	.L92
	movslq	12(%rsp), %rax
	movq	16(%rsp), %rcx
	xorl	%ebx, %ebx
	imulq	$12, %rax, %rax
	leaq	(%rcx,%rax), %r14
.L100:
	cmpl	%r12d, %ebx
	jge	.L103
	cvtsi2ssl	%r15d, %xmm1
	movss	left(%rip), %xmm2
	xorl	%r13d, %r13d
	movl	$0x00000000, (%rsp)
	cvtsi2ssl	%ebp, %xmm0
	divss	%xmm1, %xmm0
	movss	right(%rip), %xmm1
	subss	%xmm2, %xmm1
	mulss	%xmm1, %xmm0
	cvtsi2ssl	%r12d, %xmm1
	addss	%xmm2, %xmm0
	movss	bottom(%rip), %xmm2
	movss	%xmm0, 4(%rsp)
	cvtsi2ssl	%ebx, %xmm0
	divss	%xmm1, %xmm0
	movss	top(%rip), %xmm1
	subss	%xmm2, %xmm1
	mulss	%xmm1, %xmm0
	addss	%xmm2, %xmm0
	movss	%xmm0, 8(%rsp)
.L94:
	cmpl	%r13d, nBlackHoles(%rip)
	jle	.L104
	imulq	$12, %r13, %rdx
	movss	4(%rsp), %xmm0
	movss	8(%rsp), %xmm1
	addq	blackHoles(%rip), %rdx
	subss	(%rdx), %xmm0
	subss	4(%rdx), %xmm1
	movq	%rdx, 24(%rsp)
	mulss	%xmm1, %xmm1
	mulss	%xmm0, %xmm0
	addss	%xmm1, %xmm0
	call	sqrtf@PLT
	xorps	%xmm1, %xmm1
	movq	24(%rsp), %rdx
	ucomiss	%xmm1, %xmm0
	jp	.L95
	movl	.LC27(%rip), %ecx
	movd	%xmm0, %eax
	cmove	%ecx, %eax
	movd	%eax, %xmm0
.L95:
	movsd	.LC29(%rip), %xmm1
	movq	%rdx, 24(%rsp)
	cvtss2sd	%xmm0, %xmm0
	incq	%r13
	call	pow@PLT
	movq	24(%rsp), %rdx
	movaps	%xmm0, %xmm1
	movsd	.LC30(%rip), %xmm0
	divsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	mulss	8(%rdx), %xmm0
	addss	(%rsp), %xmm0
	movss	%xmm0, (%rsp)
	jmp	.L94
.L104:
	movss	4(%rsp), %xmm4
	movss	8(%rsp), %xmm5
	incl	%ebx
	addq	$12, %r14
	movss	(%rsp), %xmm6
	movss	%xmm4, -12(%r14)
	movss	%xmm5, -8(%r14)
	movss	%xmm6, -4(%r14)
	jmp	.L100
.L103:
	addl	%r15d, 12(%rsp)
	incl	%ebp
	jmp	.L93
.L92:
	addq	$40, %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
.LFE2054:
	.size	_Z18calculateSpaceTimeP10spacePointii, .-_Z18calculateSpaceTimeP10spacePointii
	.globl	_Z13freeAsteroidsv
	.type	_Z13freeAsteroidsv, @function
_Z13freeAsteroidsv:
.LFB2055:
	.cfi_startproc
	endbr64
	movq	asteroids(%rip), %rdi
	testq	%rdi, %rdi
	je	.L111
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	cudaFree@PLT
	xorl	%edx, %edx
	movq	%rdx, asteroids(%rip)
	popq	%rcx
	.cfi_def_cfa_offset 8
	ret
.L111:
	ret
	.cfi_endproc
.LFE2055:
	.size	_Z13freeAsteroidsv, .-_Z13freeAsteroidsv
	.globl	_Z13initAsteroidsv
	.type	_Z13initAsteroidsv, @function
_Z13initAsteroidsv:
.LFB2056:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	call	_Z13freeAsteroidsv
	movl	nAsteroids(%rip), %esi
	movl	$1, %edx
	leaq	asteroids(%rip), %rdi
	sall	$4, %esi
	movl	%esi, astSize(%rip)
	movslq	%esi, %rsi
	call	cudaMallocManaged@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	movslq	astSize(%rip), %rcx
	movq	asteroids(%rip), %rdi
	xorl	%eax, %eax
	rep stosb
.L115:
	cmpl	%ebx, nAsteroids(%rip)
	jle	.L118
	movq	asteroids(%rip), %r12
	movss	right(%rip), %xmm1
	movq	%rbx, %rbp
	incq	%rbx
	movss	left(%rip), %xmm0
	salq	$4, %rbp
	addq	%rbp, %r12
	call	_Z15getRandonLimitsff
	movss	top(%rip), %xmm1
	addq	asteroids(%rip), %rbp
	movss	%xmm0, (%r12)
	movss	bottom(%rip), %xmm0
	call	_Z15getRandonLimitsff
	movss	%xmm0, 4(%rbp)
	jmp	.L115
.L118:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z13initAsteroidsv, .-_Z13initAsteroidsv
	.globl	_Z18calculateAsteroidsP8asteroidiP9blackHoleif
	.type	_Z18calculateAsteroidsP8asteroidiP9blackHoleif, @function
_Z18calculateAsteroidsP8asteroidiP9blackHoleif:
.LFB2057:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdx, 8(%rsp)
	movss	%xmm0, 4(%rsp)
.L120:
	cmpl	%r12d, %ebp
	jge	.L119
	xorps	%xmm2, %xmm2
	movq	8(%rsp), %r15
	xorl	%ebx, %ebx
	movaps	%xmm2, %xmm1
.L124:
	cmpl	%r13d, %ebx
	jge	.L121
	movss	4(%r14), %xmm3
	xorps	%xmm0, %xmm0
	movss	(%r14), %xmm4
	movb	$0, %cl
	subss	4(%r15), %xmm3
	subss	(%r15), %xmm4
	addq	$12, %r15
	ucomiss	%xmm0, %xmm3
	setnp	%al
	cmovne	%ecx, %eax
	testb	%al, %al
	jne	.L121
	ucomiss	%xmm0, %xmm4
	setnp	%cl
	cmove	%ecx, %eax
	testb	%al, %al
	jne	.L121
	movaps	%xmm4, %xmm0
	movaps	%xmm3, %xmm5
	movss	%xmm2, 28(%rsp)
	incl	%ebx
	mulss	%xmm3, %xmm5
	movss	%xmm1, 24(%rsp)
	mulss	%xmm4, %xmm0
	movss	%xmm4, 20(%rsp)
	movss	%xmm3, 16(%rsp)
	addss	%xmm5, %xmm0
	mulss	%xmm0, %xmm0
	call	sqrtf@PLT
	movss	20(%rsp), %xmm4
	movss	16(%rsp), %xmm3
	movaps	%xmm0, %xmm5
	movss	24(%rsp), %xmm1
	movss	28(%rsp), %xmm2
	movss	.LC25(%rip), %xmm0
	divss	%xmm5, %xmm0
	mulss	%xmm0, %xmm4
	mulss	%xmm0, %xmm3
	addss	%xmm4, %xmm1
	addss	%xmm3, %xmm2
	jmp	.L124
.L121:
	movaps	%xmm1, %xmm0
	movaps	%xmm2, %xmm3
	movss	%xmm1, 20(%rsp)
	incl	%ebp
	mulss	%xmm2, %xmm3
	movss	%xmm2, 16(%rsp)
	addq	$16, %r14
	mulss	%xmm1, %xmm0
	addss	%xmm3, %xmm0
	call	sqrtf@PLT
	movss	16(%rsp), %xmm2
	movss	20(%rsp), %xmm1
	movsd	.LC32(%rip), %xmm3
	divss	%xmm0, %xmm2
	divss	%xmm0, %xmm1
	xorps	.LC31(%rip), %xmm2
	movss	4(%rsp), %xmm0
	mulss	%xmm2, %xmm0
	cvtss2sd	-16(%r14), %xmm2
	addss	-4(%r14), %xmm0
	movss	%xmm0, -4(%r14)
	cvtss2sd	%xmm0, %xmm0
	mulsd	%xmm3, %xmm0
	xorps	.LC31(%rip), %xmm1
	mulss	4(%rsp), %xmm1
	addss	-8(%r14), %xmm1
	movss	%xmm1, -8(%r14)
	cvtss2sd	%xmm1, %xmm1
	mulsd	%xmm3, %xmm1
	addsd	%xmm1, %xmm2
	cvtss2sd	-12(%r14), %xmm1
	addsd	%xmm0, %xmm1
	cvtsd2ss	%xmm2, %xmm2
	cvtsd2ss	%xmm1, %xmm1
	movss	%xmm2, -16(%r14)
	movss	%xmm1, -12(%r14)
	jmp	.L120
.L119:
	addq	$40, %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
.LFE2057:
	.size	_Z18calculateAsteroidsP8asteroidiP9blackHoleif, .-_Z18calculateAsteroidsP8asteroidiP9blackHoleif
	.section	.rodata.str1.1
.LC33:
	.string	"Running Simulation CPU ...\n"
.LC34:
	.string	"SpaceTime Params: rows: %d, cols: %d, size: %d\n"
	.text
	.globl	_Z16runSimulationCPUv
	.type	_Z16runSimulationCPUv, @function
_Z16runSimulationCPUv:
.LFB2058:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC33(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__printf_chk@PLT
	movl	nelems(%rip), %r8d
	xorl	%eax, %eax
	movl	cols(%rip), %ecx
	movl	rows(%rip), %edx
	leaq	.LC34(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	call	_Z17currentTimeMillisv
	movq	%rax, %rbp
	call	_Z13initSpaceTimev
	call	_Z13initAsteroidsv
.L129:
	call	_Z17currentTimeMillisv
	cmpq	$0, blackHoles(%rip)
	movq	%rax, %rbx
	je	.L127
	subq	%r12, %rax
	cmpq	$20999, %rax
	jle	.L128
.L127:
	call	_Z18generateBlackHolesv
	movq	SPBox(%rip), %r12
	movl	cols(%rip), %r14d
	movl	rows(%rip), %r13d
	movq	%r12, %rdi
	movl	%r14d, %edx
	movl	%r13d, %esi
	call	_Z18calculateSpaceTimeP10spacePointii
	movq	%r12, %rdi
	movl	%r14d, %edx
	movl	%r13d, %esi
	call	_Z15spaceTimeToFileP10spacePointii
	movq	%rbx, %r12
.L128:
	movl	nAsteroids(%rip), %r13d
	movq	asteroids(%rip), %rbx
	movl	nBlackHoles(%rip), %ecx
	movq	blackHoles(%rip), %rdx
	movss	.LC35(%rip), %xmm0
	movl	%r13d, %esi
	movq	%rbx, %rdi
	call	_Z18calculateAsteroidsP8asteroidiP9blackHoleif
	movl	%r13d, %esi
	movq	%rbx, %rdi
	call	_Z15asteroidsToFileP8asteroidi
	movl	$250, %edi
	call	_Z6nsleepl
	call	_Z17currentTimeMillisv
	movl	$1000, %ecx
	subq	%rbp, %rax
	cqto
	idivq	%rcx
	cmpl	$359, %eax
	jle	.L129
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_Z13freeAsteroidsv
	.cfi_endproc
.LFE2058:
	.size	_Z16runSimulationCPUv, .-_Z16runSimulationCPUv
	.globl	_Z15recordBenchmarkiPciiili
	.type	_Z15recordBenchmarkiPciiili, @function
_Z15recordBenchmarkiPciiili:
.LFB2060:
	.cfi_startproc
	endbr64
	cmpl	$127, %edi
	jg	.L135
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	%ecx, %r13d
	movslq	%edi, %rcx
	imulq	$1056, %rcx, %rcx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%edx, %r12d
	movl	$1024, %edx
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%r8d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%r9, %rbx
	pushq	%rax
	.cfi_def_cfa_offset 48
	leaq	BENCHS(%rip), %rax
	addq	%rax, %rcx
	movq	%rcx, %rdi
	call	__strcpy_chk@PLT
	movl	%r12d, 1024(%rax)
	movq	%rax, %rcx
	movl	%r13d, 1032(%rax)
	movl	%ebp, 1028(%rax)
	movq	%rbx, 1040(%rax)
	movl	48(%rsp), %eax
	movl	%eax, 1048(%rcx)
	popq	%rdx
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L135:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	ret
	.cfi_endproc
.LFE2060:
	.size	_Z15recordBenchmarkiPciiili, .-_Z15recordBenchmarkiPciiili
	.globl	_Z16accessSPBenchCPUP10spacePointii
	.type	_Z16accessSPBenchCPUP10spacePointii, @function
_Z16accessSPBenchCPUP10spacePointii:
.LFB2061:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE2061:
	.size	_Z16accessSPBenchCPUP10spacePointii, .-_Z16accessSPBenchCPUP10spacePointii
	.globl	_Z16accessBHBenchCPUv
	.type	_Z16accessBHBenchCPUv, @function
_Z16accessBHBenchCPUv:
.LFB2062:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE2062:
	.size	_Z16accessBHBenchCPUv, .-_Z16accessBHBenchCPUv
	.globl	_Z17accessAstBenchCPUP8asteroidi
	.type	_Z17accessAstBenchCPUP8asteroidi, @function
_Z17accessAstBenchCPUP8asteroidi:
.LFB2063:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE2063:
	.size	_Z17accessAstBenchCPUP8asteroidi, .-_Z17accessAstBenchCPUP8asteroidi
	.section	.rodata.str1.1
.LC36:
	.string	"\nBenchmark CPU %d_%d - Config %d\n"
.LC37:
	.string	"  top: %0.2f, bottom: %0.2f, left: %0.2f, right: %0.2f\n"
.LC38:
	.string	"  spStep : %f, nBlackHoles :%d, nAsteroids: %d\n"
.LC39:
	.string	"  Matrix Space Resolution [%d, %d]\n"
.LC40:
	.string	"Benchmark %d_%d"
.LC41:
	.string	"\n  Benchmark %d - Time: %ld millis, steps : %d\n"
.LC42:
	.string	"    Steps Per Second : %ld\n\n"
	.text
	.globl	_Z15runBenchMarkCPUv
	.type	_Z15runBenchMarkCPUv, @function
_Z15runBenchMarkCPUv:
.LFB2064:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	benchConfig(%rip), %ecx
	movl	$2, %edi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	benchNum(%rip), %edx
	leaq	.LC36(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%ecx, %r8d
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
	leaq	.LC37(%rip), %rsi
	movb	$4, %al
	movl	$2, %edi
	cvtss2sd	right(%rip), %xmm3
	cvtss2sd	left(%rip), %xmm2
	cvtss2sd	bottom(%rip), %xmm1
	cvtss2sd	top(%rip), %xmm0
	call	__printf_chk@PLT
	movl	nAsteroids(%rip), %ecx
	movl	nBlackHoles(%rip), %edx
	movb	$1, %al
	leaq	.LC38(%rip), %rsi
	movl	$2, %edi
	cvtss2sd	spStep(%rip), %xmm0
	call	__printf_chk@PLT
	movss	top(%rip), %xmm0
	xorl	%eax, %eax
	subss	bottom(%rip), %xmm0
	movss	spStep(%rip), %xmm1
	movss	.LC26(%rip), %xmm2
	movl	$2, %edi
	leaq	.LC39(%rip), %rsi
	andps	%xmm2, %xmm0
	divss	%xmm1, %xmm0
	cvttss2sil	%xmm0, %ecx
	movss	right(%rip), %xmm0
	subss	left(%rip), %xmm0
	andps	%xmm2, %xmm0
	divss	%xmm1, %xmm0
	cvttss2sil	%xmm0, %edx
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	call	_Z13initSpaceTimev
	call	_Z13initAsteroidsv
	call	_Z14initBlackHolesv
	call	_Z17currentTimeMillisv
	movq	%rax, %r12
.L142:
	call	_Z17currentTimeMillisv
	subq	%r12, %rax
	cmpq	$9999, %rax
	jg	.L146
	movl	%ebx, %eax
	cltd
	idivl	bechmarkRegenBHSteps(%rip)
	testl	%edx, %edx
	jne	.L143
	call	_Z14initBlackHolesv
.L143:
	movl	cols(%rip), %edx
	movl	rows(%rip), %esi
	incl	%ebx
	movq	SPBox(%rip), %rdi
	call	_Z18calculateSpaceTimeP10spacePointii
	movss	.LC35(%rip), %xmm0
	movl	nBlackHoles(%rip), %ecx
	movq	blackHoles(%rip), %rdx
	movl	nAsteroids(%rip), %esi
	movq	asteroids(%rip), %rdi
	call	_Z18calculateAsteroidsP8asteroidiP9blackHoleif
	jmp	.L142
.L146:
	call	_Z17currentTimeMillisv
	subq	%r12, %rax
	leaq	benchName(%rip), %r12
	movq	%rax, %rbp
	call	_Z13freeSpaceTimev
	call	_Z13freeAsteroidsv
	call	_Z14freeBlackHolesv
	movq	%r12, %rdi
	movl	$1024, %edx
	xorl	%eax, %eax
	movl	benchConfig(%rip), %r9d
	movl	benchNum(%rip), %r8d
	movl	$2, %esi
	leaq	.LC40(%rip), %rcx
	call	__sprintf_chk@PLT
	movl	benchConfig(%rip), %r8d
	movq	%rbp, %r9
	movl	benchType(%rip), %ecx
	movl	benchNum(%rip), %edx
	movl	nBenchmark(%rip), %edi
	pushq	%rax
	.cfi_def_cfa_offset 40
	movq	%r12, %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	call	_Z15recordBenchmarkiPciiili
	popq	%rdx
	.cfi_def_cfa_offset 40
	movl	nBenchmark(%rip), %edx
	movl	%ebx, %r8d
	popq	%rcx
	.cfi_def_cfa_offset 32
	leaq	.LC41(%rip), %rsi
	movq	%rbp, %rcx
	movl	$2, %edi
	xorl	%eax, %eax
	movslq	%ebx, %rbx
	call	__printf_chk@PLT
	movq	%rbp, %rax
	movl	$1000, %ecx
	leaq	.LC42(%rip), %rsi
	cqto
	movl	$2, %edi
	idivq	%rcx
	movq	%rax, %rbp
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 24
	cqto
	idivq	%rbp
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	movq	%rax, %rdx
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2064:
	.size	_Z15runBenchMarkCPUv, .-_Z15runBenchMarkCPUv
	.section	.rodata._Z19_ConvertSMVer2Coresii.str1.1,"aMS",@progbits,1
.LC43:
	.string	"MapSMtoCores for SM %d.%d is undefined.  Default to use %d Cores/SM\n"
	.section	.rodata
	.align 32
.LC0:
	.long	48
	.long	192
	.long	50
	.long	192
	.long	53
	.long	192
	.long	55
	.long	192
	.long	80
	.long	128
	.long	82
	.long	128
	.long	83
	.long	128
	.long	96
	.long	64
	.long	97
	.long	128
	.long	98
	.long	128
	.long	112
	.long	64
	.long	114
	.long	64
	.long	117
	.long	64
	.long	-1
	.long	-1
	.section	.text._Z19_ConvertSMVer2Coresii,"axG",@progbits,_Z19_ConvertSMVer2Coresii,comdat
	.weak	_Z19_ConvertSMVer2Coresii
	.type	_Z19_ConvertSMVer2Coresii, @function
_Z19_ConvertSMVer2Coresii:
.LFB2068:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %edx
	movl	%esi, %r9d
	movl	$28, %ecx
	leaq	.LC0(%rip), %rsi
	addq	$-128, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	leaq	8(%rsp), %r8
	rep movsl
	movl	%edx, %esi
	sall	$4, %esi
	addl	%r9d, %esi
.L148:
	movl	(%r8,%rax,8), %edi
	movslq	%eax, %rcx
	cmpl	$-1, %edi
	je	.L154
	incq	%rax
	cmpl	%edi, %esi
	jne	.L148
	movl	12(%rsp,%rcx,8), %ebx
	jmp	.L147
.L154:
	decl	%eax
	movl	%r9d, %ecx
	movl	$2, %edi
	cltq
	leaq	.LC43(%rip), %rsi
	movl	12(%rsp,%rax,8), %ebx
	xorl	%eax, %eax
	movl	%ebx, %r8d
	call	__printf_chk@PLT
.L147:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L151
	call	__stack_chk_fail@PLT
.L151:
	subq	$-128, %rsp
	.cfi_def_cfa_offset 16
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2068:
	.size	_Z19_ConvertSMVer2Coresii, .-_Z19_ConvertSMVer2Coresii
	.section	.rodata.str1.1
.LC44:
	.string	"Yes"
.LC45:
	.string	"No"
.LC46:
	.string	"Enabled"
.LC47:
	.string	"Disabled"
.LC48:
	.string	"GPU Info\n"
.LC49:
	.string	" Device: \"%s\"\n"
.LC50:
	.string	"  CUDA Driver Version / Runtime Version          %d.%d / %d.%d\n"
.LC51:
	.string	"  CUDA Capability Major/Minor version number:    %d.%d\n"
.LC53:
	.string	"  Total amount of global memory:                 %.0f MBytes (%llu bytes)\n"
.LC54:
	.string	"%s"
.LC55:
	.string	"  (%2d) Multiprocessors, (%3d) CUDA Cores/MP:     %d CUDA Cores\n"
.LC58:
	.string	"  GPU Max Clock rate:                            %.0f MHz (%0.2f GHz)\n"
.LC59:
	.string	"  Maximum Texture Dimension Size (x,y,z)         1D=(%d), 2D=(%d, %d), 3D=(%d, %d, %d)\n"
.LC60:
	.string	"  Maximum Layered 1D Texture Size, (num) layers  1D=(%d), %d layers\n"
.LC61:
	.string	"  Maximum Layered 2D Texture Size, (num) layers  2D=(%d, %d), %d layers\n"
.LC62:
	.string	"  Total amount of constant memory:               %zu bytes\n"
.LC63:
	.string	"  Total amount of shared memory per block:       %zu bytes\n"
.LC64:
	.string	"  Total number of registers available per block: %d\n"
.LC65:
	.string	"  Warp size:                                     %d\n"
.LC66:
	.string	"  Maximum number of threads per multiprocessor:  %d\n"
.LC67:
	.string	"  Maximum number of threads per block:           %d\n"
.LC68:
	.string	"  Max dimension size of a thread block (x,y,z): (%d, %d, %d)\n"
.LC69:
	.string	"  Max dimension size of a grid size    (x,y,z): (%d, %d, %d)\n"
.LC70:
	.string	"  Maximum memory pitch:                          %zu bytes\n"
.LC71:
	.string	"  Texture alignment:                             %zu bytes\n"
.LC72:
	.string	"  Concurrent copy and kernel execution:          %s with %d copy engine(s)\n"
.LC73:
	.string	"  Run time limit on kernels:                     %s\n"
.LC74:
	.string	"  Integrated GPU sharing Host Memory:            %s\n"
.LC75:
	.string	"  Support host page-locked memory mapping:       %s\n"
.LC76:
	.string	"  Alignment requirement for Surfaces:            %s\n"
.LC77:
	.string	"  Device has ECC support:                        %s\n"
.LC78:
	.string	"  Device supports Unified Addressing (UVA):      %s\n"
.LC79:
	.string	"  Device supports Compute Preemption:            %s\n"
.LC80:
	.string	"  Supports Cooperative Kernel Launch:            %s\n"
.LC81:
	.string	"  Supports MultiDevice Co-op Kernel Launch:      %s\n"
.LC82:
	.string	"  Device PCI Domain ID / Bus ID / location ID:   %d / %d / %d\n"
	.text
	.globl	_Z19printfGPUDeviceInfov
	.type	_Z19printfGPUDeviceInfov, @function
_Z19printfGPUDeviceInfov:
.LFB2069:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%ecx, %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$1336, %rsp
	.cfi_def_cfa_offset 1360
	movq	%fs:40, %rax
	movq	%rax, 1320(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rdi
	movl	%ecx, 24(%rsp)
	leaq	32(%rsp), %rbx
	movl	%ecx, 28(%rsp)
	call	cudaGetDevice@PLT
	movl	20(%rsp), %esi
	movq	%rbx, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	leaq	.LC48(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC49(%rip), %rsi
	call	__printf_chk@PLT
	leaq	24(%rsp), %rdi
	call	cudaDriverGetVersion@PLT
	leaq	28(%rsp), %rdi
	call	cudaRuntimeGetVersion@PLT
	movl	28(%rsp), %eax
	movl	$100, %r10d
	movl	$10, %edi
	movl	$1000, %esi
	cltd
	idivl	%r10d
	movl	%edx, %eax
	cltd
	idivl	%edi
	movl	%eax, %r9d
	movl	28(%rsp), %eax
	cltd
	idivl	%esi
	movl	%eax, %r8d
	movl	24(%rsp), %eax
	cltd
	idivl	%r10d
	movl	%edx, %eax
	cltd
	idivl	%edi
	movl	$2, %edi
	movl	%eax, %ecx
	movl	24(%rsp), %eax
	cltd
	idivl	%esi
	leaq	.LC50(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	396(%rsp), %ecx
	movl	$2, %edi
	xorl	%eax, %eax
	movl	392(%rsp), %edx
	leaq	.LC51(%rip), %rsi
	call	__printf_chk@PLT
	movq	320(%rsp), %r9
	testq	%r9, %r9
	js	.L156
	cvtsi2ssq	%r9, %xmm0
	jmp	.L157
.L156:
	movq	%r9, %rax
	movq	%r9, %rdx
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2ssq	%rax, %xmm0
	addss	%xmm0, %xmm0
.L157:
	mulss	.LC52(%rip), %xmm0
	leaq	1064(%rsp), %rbx
	movl	$256, %ecx
	movb	$1, %al
	leaq	.LC53(%rip), %r8
	movq	%rbx, %rdi
	movl	$2, %edx
	movl	$256, %esi
	leaq	.LC44(%rip), %rbp
	cvtss2sd	%xmm0, %xmm0
	call	__snprintf_chk@PLT
	movq	%rbx, %rdx
	movl	$2, %edi
	leaq	.LC54(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC45(%rip), %rbx
	call	__printf_chk@PLT
	movl	396(%rsp), %esi
	movl	392(%rsp), %edi
	call	_Z19_ConvertSMVer2Coresii
	imull	420(%rsp), %eax
	movl	396(%rsp), %esi
	movl	392(%rsp), %edi
	movl	%eax, 12(%rsp)
	call	_Z19_ConvertSMVer2Coresii
	movl	12(%rsp), %r8d
	movl	$2, %edi
	movl	420(%rsp), %edx
	movl	%eax, %ecx
	leaq	.LC55(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movss	.LC56(%rip), %xmm1
	leaq	.LC58(%rip), %rsi
	movb	$2, %al
	cvtsi2ssl	380(%rsp), %xmm0
	movl	$2, %edi
	mulss	%xmm0, %xmm1
	mulss	.LC57(%rip), %xmm0
	cvtss2sd	%xmm1, %xmm1
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	movl	496(%rsp), %eax
	leaq	.LC59(%rip), %rsi
	movl	$2, %edi
	pushq	%rax
	.cfi_def_cfa_offset 1368
	movl	500(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 1376
	movl	504(%rsp), %r9d
	xorl	%eax, %eax
	movl	472(%rsp), %r8d
	movl	468(%rsp), %ecx
	movl	456(%rsp), %edx
	call	__printf_chk@PLT
	popq	%rax
	.cfi_def_cfa_offset 1368
	popq	%rdx
	.cfi_def_cfa_offset 1360
	movl	$2, %edi
	movl	520(%rsp), %ecx
	movl	516(%rsp), %edx
	leaq	.LC60(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	532(%rsp), %r8d
	xorl	%eax, %eax
	movl	528(%rsp), %ecx
	movl	524(%rsp), %edx
	leaq	.LC61(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	384(%rsp), %rdx
	leaq	.LC62(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	328(%rsp), %rdx
	leaq	.LC63(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	336(%rsp), %edx
	leaq	.LC64(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	340(%rsp), %edx
	leaq	.LC65(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	656(%rsp), %edx
	leaq	.LC66(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	352(%rsp), %edx
	leaq	.LC67(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	364(%rsp), %r8d
	xorl	%eax, %eax
	movl	360(%rsp), %ecx
	movl	356(%rsp), %edx
	leaq	.LC68(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	376(%rsp), %r8d
	xorl	%eax, %eax
	movl	372(%rsp), %ecx
	movl	368(%rsp), %edx
	leaq	.LC69(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	344(%rsp), %rdx
	leaq	.LC70(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	400(%rsp), %rdx
	leaq	.LC71(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	cmpl	$0, 416(%rsp)
	movq	%rbp, %rdx
	movl	632(%rsp), %ecx
	cmove	%rbx, %rdx
	leaq	.LC72(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$0, 424(%rsp)
	movq	%rbp, %rdx
	leaq	.LC73(%rip), %rsi
	cmove	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$0, 428(%rsp)
	movq	%rbp, %rdx
	leaq	.LC74(%rip), %rsi
	cmove	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$0, 432(%rsp)
	movq	%rbp, %rdx
	leaq	.LC75(%rip), %rsi
	cmove	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rdx
	movl	$2, %edi
	cmpq	$0, 600(%rsp)
	cmove	%rbx, %rdx
	leaq	.LC76(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$0, 612(%rsp)
	leaq	.LC46(%rip), %rax
	leaq	.LC47(%rip), %rdx
	cmovne	%rax, %rdx
	leaq	.LC77(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$0, 636(%rsp)
	movq	%rbp, %rdx
	leaq	.LC78(%rip), %rsi
	cmove	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$0, 712(%rsp)
	movq	%rbp, %rdx
	leaq	.LC79(%rip), %rsi
	cmove	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$0, 720(%rsp)
	movq	%rbp, %rdx
	leaq	.LC80(%rip), %rsi
	cmove	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$0, 724(%rsp)
	movq	%rbp, %rdx
	leaq	.LC81(%rip), %rsi
	cmove	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	620(%rsp), %r8d
	movl	616(%rsp), %ecx
	xorl	%eax, %eax
	movl	624(%rsp), %edx
	leaq	.LC82(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	1320(%rsp), %rax
	subq	%fs:40, %rax
	je	.L168
	call	__stack_chk_fail@PLT
.L168:
	addq	$1336, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2069:
	.size	_Z19printfGPUDeviceInfov, .-_Z19printfGPUDeviceInfov
	.globl	_Z68__device_stub__Z19calculateSpaceTimeKP10spacePointiiffffP9blackHoleiP10spacePointiiffffP9blackHolei
	.type	_Z68__device_stub__Z19calculateSpaceTimeKP10spacePointiiffffP9blackHoleiP10spacePointiiffffP9blackHolei, @function
_Z68__device_stub__Z19calculateSpaceTimeKP10spacePointiiffffP9blackHoleiP10spacePointiiffffP9blackHolei:
.LFB2095:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movl	%esi, 36(%rsp)
	leaq	76(%rsp), %rsi
	movl	%edx, 32(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movss	%xmm0, 28(%rsp)
	movss	%xmm1, 24(%rsp)
	movss	%xmm2, 20(%rsp)
	movss	%xmm3, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L180
	pushq	56(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 224
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L180:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L182
	call	__stack_chk_fail@PLT
.L182:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2095:
	.size	_Z68__device_stub__Z19calculateSpaceTimeKP10spacePointiiffffP9blackHoleiP10spacePointiiffffP9blackHolei, .-_Z68__device_stub__Z19calculateSpaceTimeKP10spacePointiiffffP9blackHoleiP10spacePointiiffffP9blackHolei
	.globl	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.type	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei, @function
_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei:
.LFB2096:
	.cfi_startproc
	endbr64
	jmp	_Z68__device_stub__Z19calculateSpaceTimeKP10spacePointiiffffP9blackHoleiP10spacePointiiffffP9blackHolei
	.cfi_endproc
.LFE2096:
	.size	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei, .-_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.globl	_Z72__device_stub__Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleiiP10spacePointiiffffP9blackHoleii
	.type	_Z72__device_stub__Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleiiP10spacePointiiffffP9blackHoleii, @function
_Z72__device_stub__Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleiiP10spacePointiiffffP9blackHoleii:
.LFB2097:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movl	%esi, 36(%rsp)
	leaq	84(%rsp), %rsi
	movl	%edx, 32(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movl	%r9d, (%rsp)
	movss	%xmm0, 28(%rsp)
	movss	%xmm1, 24(%rsp)
	movss	%xmm2, 20(%rsp)
	movss	%xmm3, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 184(%rsp)
	movq	%rsp, %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L185
	pushq	64(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 240
	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 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L185:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L187
	call	__stack_chk_fail@PLT
.L187:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2097:
	.size	_Z72__device_stub__Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleiiP10spacePointiiffffP9blackHoleii, .-_Z72__device_stub__Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleiiP10spacePointiiffffP9blackHoleii
	.globl	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.type	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii, @function
_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii:
.LFB2098:
	.cfi_startproc
	endbr64
	jmp	_Z72__device_stub__Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleiiP10spacePointiiffffP9blackHoleii
	.cfi_endproc
.LFE2098:
	.size	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii, .-_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.globl	_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif
	.type	_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif, @function
_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif:
.LFB2099:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 16(%rsp)
	leaq	40(%rsp), %rcx
	movss	%xmm0, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L190
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L190:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L192
	call	__stack_chk_fail@PLT
.L192:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2099:
	.size	_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif, .-_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif
	.globl	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif
	.type	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif, @function
_Z19calculateAsteroidsKP8asteroidiP9blackHoleif:
.LFB2100:
	.cfi_startproc
	endbr64
	jmp	_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif
	.cfi_endproc
.LFE2100:
	.size	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif, .-_Z19calculateAsteroidsKP8asteroidiP9blackHoleif
	.section	.rodata.str1.1
.LC83:
	.string	"Running Simulation GPU ...\n"
	.text
	.globl	_Z16runSimulationGPUv
	.type	_Z16runSimulationGPUv, @function
_Z16runSimulationGPUv:
.LFB2059:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC83(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	movabsq	$4294967297, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	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
	movl	$4194305, %ebx
	salq	$10, %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	call	__printf_chk@PLT
	call	_Z17currentTimeMillisv
	movq	%rax, %r12
	call	_Z13initSpaceTimev
	call	_Z13initAsteroidsv
	movl	nelems(%rip), %r8d
	xorl	%eax, %eax
	movl	cols(%rip), %ecx
	movl	rows(%rip), %edx
	leaq	.LC34(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	cvtsi2ssl	nAsteroids(%rip), %xmm0
	mulss	.LC84(%rip), %xmm0
	movl	$1, 8(%rsp)
	addss	.LC25(%rip), %xmm0
	mulss	.LC85(%rip), %xmm0
	movl	$1, 20(%rsp)
	movl	cols(%rip), %eax
	movl	rows(%rip), %edx
	shrl	$5, %eax
	shrl	$5, %edx
	incl	%eax
	incl	%edx
	movl	%edx, 12(%rsp)
	movl	%eax, 16(%rsp)
	call	ceilf@PLT
	mulss	.LC86(%rip), %xmm0
	cvttss2sil	%xmm0, %r14d
.L201:
	call	_Z17currentTimeMillisv
	cmpq	$0, blackHoles(%rip)
	movq	%rax, %rbp
	je	.L196
	subq	%r13, %rax
	cmpq	$20999, %rax
	jle	.L197
.L196:
	call	_Z18generateBlackHolesv
	movl	8(%rsp), %ecx
	movl	20(%rsp), %esi
	xorl	%r9d, %r9d
	movq	12(%rsp), %rdi
	xorl	%r8d, %r8d
	movabsq	$137438953504, %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L198
	movl	nBlackHoles(%rip), %r8d
	movq	blackHoles(%rip), %rcx
	movss	bottom(%rip), %xmm3
	movss	top(%rip), %xmm2
	movss	right(%rip), %xmm1
	movss	left(%rip), %xmm0
	movl	cols(%rip), %edx
	movl	rows(%rip), %esi
	movq	SPBox(%rip), %rdi
	call	_Z68__device_stub__Z19calculateSpaceTimeKP10spacePointiiffffP9blackHoleiP10spacePointiiffffP9blackHolei
.L198:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	movq	%r15, 28(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%r14d, 24(%rsp)
	movl	32(%rsp), %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	24(%rsp), %rdi
	movq	%rbx, 36(%rsp)
	movl	$1, 44(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L199
	movss	.LC35(%rip), %xmm0
	movl	nBlackHoles(%rip), %ecx
	movq	blackHoles(%rip), %rdx
	movl	nAsteroids(%rip), %esi
	movq	asteroids(%rip), %rdi
	call	_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif
.L199:
	call	cudaGetLastError@PLT
	movq	%rbp, %r13
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	movl	cols(%rip), %edx
	movl	rows(%rip), %esi
	movq	SPBox(%rip), %rdi
	call	_Z15spaceTimeToFileP10spacePointii
.L197:
	movq	%r15, 28(%rsp)
	movl	32(%rsp), %esi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%r14d, 24(%rsp)
	movq	24(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	%rbx, 36(%rsp)
	movl	$1, 44(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L200
	movss	.LC35(%rip), %xmm0
	movl	nBlackHoles(%rip), %ecx
	movq	blackHoles(%rip), %rdx
	movl	nAsteroids(%rip), %esi
	movq	asteroids(%rip), %rdi
	call	_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif
.L200:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	movl	nAsteroids(%rip), %esi
	movq	asteroids(%rip), %rdi
	call	_Z15asteroidsToFileP8asteroidi
	movl	$250, %edi
	call	_Z6nsleepl
	call	_Z17currentTimeMillisv
	movl	$1000, %ecx
	subq	%r12, %rax
	cqto
	idivq	%rcx
	cmpl	$359, %eax
	jle	.L201
	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
	jmp	_Z13freeAsteroidsv
	.cfi_endproc
.LFE2059:
	.size	_Z16runSimulationGPUv, .-_Z16runSimulationGPUv
	.globl	_Z65__device_stub__Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifiP8asteroidiP9blackHoleifi
	.type	_Z65__device_stub__Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifiP8asteroidiP9blackHoleifi, @function
_Z65__device_stub__Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifiP8asteroidiP9blackHoleifi:
.LFB2101:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 16(%rsp)
	leaq	48(%rsp), %rcx
	movl	%r8d, (%rsp)
	movss	%xmm0, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 136(%rsp)
	movq	%rsp, %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L204
	pushq	48(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 192
	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 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L204:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L206
	call	__stack_chk_fail@PLT
.L206:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2101:
	.size	_Z65__device_stub__Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifiP8asteroidiP9blackHoleifi, .-_Z65__device_stub__Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifiP8asteroidiP9blackHoleifi
	.globl	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.type	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi, @function
_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi:
.LFB2102:
	.cfi_startproc
	endbr64
	jmp	_Z65__device_stub__Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifiP8asteroidiP9blackHoleifi
	.cfi_endproc
.LFE2102:
	.size	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi, .-_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.section	.rodata.str1.1
.LC87:
	.string	"\n Benchmark GPU %d_%d - Config %d\n"
.LC88:
	.string	"  spStep: %f, nBlackHoles: %d, nAsteroids: %d\n"
.LC89:
	.string	"  Device supports Compute Preemption: %s\n"
	.text
	.globl	_Z15runBenchMarkGPUv
	.type	_Z15runBenchMarkGPUv, @function
_Z15runBenchMarkGPUv:
.LFB2065:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC87(%rip), %rsi
	movl	$2, %edi
	movabsq	$137438953504, %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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1144, %rsp
	.cfi_def_cfa_offset 1200
	movl	benchConfig(%rip), %ecx
	movl	benchNum(%rip), %edx
	movq	%fs:40, %rax
	movq	%rax, 1128(%rsp)
	xorl	%eax, %eax
	movl	%ecx, %r8d
	call	__printf_chk@PLT
	leaq	.LC37(%rip), %rsi
	movb	$4, %al
	movl	$2, %edi
	cvtss2sd	right(%rip), %xmm3
	cvtss2sd	left(%rip), %xmm2
	cvtss2sd	bottom(%rip), %xmm1
	cvtss2sd	top(%rip), %xmm0
	call	__printf_chk@PLT
	movl	nAsteroids(%rip), %ecx
	movl	nBlackHoles(%rip), %edx
	movb	$1, %al
	leaq	.LC88(%rip), %rsi
	movl	$2, %edi
	cvtss2sd	spStep(%rip), %xmm0
	call	__printf_chk@PLT
	movss	top(%rip), %xmm0
	xorl	%eax, %eax
	subss	bottom(%rip), %xmm0
	movss	.LC26(%rip), %xmm2
	movss	spStep(%rip), %xmm1
	movl	$2, %edi
	leaq	.LC39(%rip), %rsi
	andps	%xmm2, %xmm0
	divss	%xmm1, %xmm0
	cvttss2sil	%xmm0, %ecx
	movss	right(%rip), %xmm0
	subss	left(%rip), %xmm0
	andps	%xmm2, %xmm0
	divss	%xmm1, %xmm0
	cvttss2sil	%xmm0, %edx
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	leaq	28(%rsp), %rdi
	call	cudaGetDevice@PLT
	movl	28(%rsp), %esi
	leaq	96(%rsp), %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movl	776(%rsp), %ebp
	leaq	.LC44(%rip), %rax
	leaq	.LC45(%rip), %rdx
	movl	484(%rsp), %ebx
	leaq	.LC89(%rip), %rsi
	movl	$2, %edi
	testl	%ebp, %ebp
	cmovne	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	call	_Z13initSpaceTimev
	call	_Z13initAsteroidsv
	call	_Z14initBlackHolesv
	cvtsi2ssl	%ebx, %xmm1
	xorl	%ebx, %ebx
	movl	cols(%rip), %eax
	cvtsi2ssl	nAsteroids(%rip), %xmm0
	mulss	.LC84(%rip), %xmm0
	movl	$1, 56(%rsp)
	addss	.LC25(%rip), %xmm0
	movl	rows(%rip), %edx
	shrl	$5, %eax
	movl	$1, 68(%rsp)
	incl	%eax
	shrl	$5, %edx
	movl	%eax, 64(%rsp)
	divss	%xmm1, %xmm0
	incl	%edx
	movss	%xmm1, 12(%rsp)
	movl	%edx, 60(%rsp)
	call	ceilf@PLT
	movss	12(%rsp), %xmm1
	mulss	%xmm0, %xmm1
	cvttss2sil	%xmm1, %r14d
	call	_Z17currentTimeMillisv
	movq	%rax, %r13
.L211:
	call	_Z17currentTimeMillisv
	testl	%ebp, %ebp
	setne	%r12b
	subq	%r13, %rax
	cmpq	$9999, %rax
	jg	.L265
	movl	%ebx, %eax
	cltd
	idivl	bechmarkRegenBHSteps(%rip)
	testl	%edx, %edx
	jne	.L213
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	cmpl	$1, cudaOptLevel(%rip)
	jle	.L214
	testb	%r12b, %r12b
	je	.L214
	movslq	bhSize(%rip), %rsi
	movq	blackHoles(%rip), %rdi
	xorl	%ecx, %ecx
	orl	$-1, %edx
	call	cudaMemPrefetchAsync@PLT
.L214:
	call	_Z14initBlackHolesv
	cmpl	$1, cudaOptLevel(%rip)
	jle	.L213
	testb	%r12b, %r12b
	je	.L213
	movslq	bhSize(%rip), %rsi
	movl	28(%rsp), %edx
	xorl	%ecx, %ecx
	movq	blackHoles(%rip), %rdi
	call	cudaMemPrefetchAsync@PLT
.L213:
	movl	%ebx, %eax
	movl	cudaOptLevel(%rip), %ecx
	cltd
	idivl	bechmarkRegenWriteFileSteps(%rip)
	testl	%edx, %edx
	jne	.L217
	decl	%ecx
	jle	.L218
	testb	%r12b, %r12b
	je	.L218
	movslq	spSize(%rip), %rsi
	movq	SPBox(%rip), %rdi
	xorl	%ecx, %ecx
	orl	$-1, %edx
	call	cudaMemPrefetchAsync@PLT
	movslq	astSize(%rip), %rsi
	xorl	%ecx, %ecx
	orl	$-1, %edx
	movq	asteroids(%rip), %rdi
	call	cudaMemPrefetchAsync@PLT
.L218:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	cmpl	$1, cudaOptLevel(%rip)
	jle	.L217
	testb	%r12b, %r12b
	je	.L217
	movslq	spSize(%rip), %rsi
	movl	28(%rsp), %edx
	xorl	%ecx, %ecx
	movq	SPBox(%rip), %rdi
	call	cudaMemPrefetchAsync@PLT
	movslq	astSize(%rip), %rsi
	movl	28(%rsp), %edx
	xorl	%ecx, %ecx
	movq	asteroids(%rip), %rdi
	call	cudaMemPrefetchAsync@PLT
.L217:
	cmpl	$0, cudaOptLevel(%rip)
	jle	.L220
	leaq	32(%rsp), %rdi
	call	cudaStreamCreate@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	leaq	40(%rsp), %rdi
	call	cudaStreamCreate@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	cmpl	$2, cudaOptLevel(%rip)
	movq	32(%rsp), %r9
	movl	56(%rsp), %ecx
	movq	60(%rsp), %rdi
	movl	68(%rsp), %esi
	jle	.L221
	movslq	bhSize(%rip), %r8
	movq	%r15, %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L222
	movl	bhSize(%rip), %r9d
	movl	nBlackHoles(%rip), %r8d
	movq	blackHoles(%rip), %rcx
	movss	bottom(%rip), %xmm3
	movss	top(%rip), %xmm2
	movss	right(%rip), %xmm1
	movss	left(%rip), %xmm0
	movl	cols(%rip), %edx
	movl	rows(%rip), %esi
	movq	SPBox(%rip), %rdi
	call	_Z72__device_stub__Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleiiP10spacePointiiffffP9blackHoleii
.L222:
	movl	%r14d, 72(%rsp)
	movl	$4194305, %edx
	movq	40(%rsp), %r9
	movabsq	$4294967297, %rax
	movq	%rax, 76(%rsp)
	movslq	bhSize(%rip), %r8
	salq	$10, %rdx
	movl	$1, %ecx
	movq	72(%rsp), %rdi
	movl	80(%rsp), %esi
	movq	%rdx, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L224
	movl	bhSize(%rip), %r8d
	movss	.LC35(%rip), %xmm0
	movl	nBlackHoles(%rip), %ecx
	movq	blackHoles(%rip), %rdx
	movl	nAsteroids(%rip), %esi
	movq	asteroids(%rip), %rdi
	call	_Z65__device_stub__Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifiP8asteroidiP9blackHoleifi
	jmp	.L224
.L221:
	xorl	%r8d, %r8d
	movq	%r15, %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L225
	movl	nBlackHoles(%rip), %r8d
	movq	blackHoles(%rip), %rcx
	movss	bottom(%rip), %xmm3
	movss	top(%rip), %xmm2
	movss	right(%rip), %xmm1
	movss	left(%rip), %xmm0
	movl	cols(%rip), %edx
	movl	rows(%rip), %esi
	movq	SPBox(%rip), %rdi
	call	_Z68__device_stub__Z19calculateSpaceTimeKP10spacePointiiffffP9blackHoleiP10spacePointiiffffP9blackHolei
.L225:
	movl	%r14d, 72(%rsp)
	movl	$4194305, %edx
	movq	40(%rsp), %r9
	movabsq	$4294967297, %rax
	movq	%rax, 76(%rsp)
	movl	80(%rsp), %esi
	salq	$10, %rdx
	xorl	%r8d, %r8d
	movq	72(%rsp), %rdi
	movl	$1, %ecx
	movq	%rdx, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L224
	movss	.LC35(%rip), %xmm0
	movl	nBlackHoles(%rip), %ecx
	movq	blackHoles(%rip), %rdx
	movl	nAsteroids(%rip), %esi
	movq	asteroids(%rip), %rdi
	call	_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif
.L224:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	movq	32(%rsp), %rdi
	call	cudaStreamDestroy@PLT
	movq	40(%rsp), %rdi
	call	cudaStreamDestroy@PLT
	jmp	.L227
.L220:
	movl	56(%rsp), %ecx
	movq	60(%rsp), %rdi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	68(%rsp), %esi
	movq	%r15, %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L228
	movl	nBlackHoles(%rip), %r8d
	movq	blackHoles(%rip), %rcx
	movss	bottom(%rip), %xmm3
	movss	top(%rip), %xmm2
	movss	right(%rip), %xmm1
	movss	left(%rip), %xmm0
	movl	cols(%rip), %edx
	movl	rows(%rip), %esi
	movq	SPBox(%rip), %rdi
	call	_Z68__device_stub__Z19calculateSpaceTimeKP10spacePointiiffffP9blackHoleiP10spacePointiiffffP9blackHolei
.L228:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	movl	%r14d, 72(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rax
	movl	$4194305, %edx
	movl	$1, %ecx
	movl	$1, 92(%rsp)
	movq	%rax, 76(%rsp)
	movq	72(%rsp), %rdi
	salq	$10, %rdx
	movl	80(%rsp), %esi
	movq	%rdx, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L229
	movss	.LC35(%rip), %xmm0
	movl	nBlackHoles(%rip), %ecx
	movq	blackHoles(%rip), %rdx
	movl	nAsteroids(%rip), %esi
	movq	asteroids(%rip), %rdi
	call	_Z61__device_stub__Z19calculateAsteroidsKP8asteroidiP9blackHoleifP8asteroidiP9blackHoleif
.L229:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
.L227:
	incl	%ebx
	jmp	.L211
.L265:
	cmpl	$1, cudaOptLevel(%rip)
	jle	.L231
	testb	%r12b, %r12b
	je	.L231
	movslq	spSize(%rip), %rsi
	movq	SPBox(%rip), %rdi
	xorl	%ecx, %ecx
	orl	$-1, %edx
	call	cudaMemPrefetchAsync@PLT
	movslq	astSize(%rip), %rsi
	xorl	%ecx, %ecx
	orl	$-1, %edx
	movq	asteroids(%rip), %rdi
	call	cudaMemPrefetchAsync@PLT
.L231:
	call	cudaDeviceSynchronize@PLT
	leaq	benchName(%rip), %r12
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaError
	call	_Z17currentTimeMillisv
	subq	%r13, %rax
	leaq	1(%rax), %rbp
	call	_Z13freeSpaceTimev
	call	_Z13freeAsteroidsv
	call	_Z14freeBlackHolesv
	movl	$1024, %edx
	movq	%r12, %rdi
	xorl	%eax, %eax
	movl	benchConfig(%rip), %r9d
	movl	benchNum(%rip), %r8d
	movl	$2, %esi
	leaq	.LC40(%rip), %rcx
	call	__sprintf_chk@PLT
	movl	benchConfig(%rip), %r8d
	movq	%rbp, %r9
	movl	benchType(%rip), %ecx
	movl	benchNum(%rip), %edx
	movl	nBenchmark(%rip), %edi
	pushq	%rax
	.cfi_def_cfa_offset 1208
	movq	%r12, %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 1216
	call	_Z15recordBenchmarkiPciiili
	popq	%rdx
	.cfi_def_cfa_offset 1208
	movl	nBenchmark(%rip), %edx
	movl	%ebx, %r8d
	popq	%rcx
	.cfi_def_cfa_offset 1200
	leaq	.LC41(%rip), %rsi
	movq	%rbp, %rcx
	movl	$2, %edi
	xorl	%eax, %eax
	movslq	%ebx, %rbx
	call	__printf_chk@PLT
	movq	%rbp, %rax
	movl	$1000, %ecx
	leaq	.LC42(%rip), %rsi
	cqto
	movl	$2, %edi
	idivq	%rcx
	movq	%rax, %rbp
	movq	%rbx, %rax
	cqto
	idivq	%rbp
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	1128(%rsp), %rax
	subq	%fs:40, %rax
	je	.L232
	call	__stack_chk_fail@PLT
.L232:
	addq	$1144, %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
.LFE2065:
	.size	_Z15runBenchMarkGPUv, .-_Z15runBenchMarkGPUv
	.globl	_Z13runBenchmarksv
	.type	_Z13runBenchmarksv, @function
_Z13runBenchmarksv:
.LFB2066:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	xorl	%ebx, %ebx
.L267:
	movss	.LC91(%rip), %xmm0
	xorl	%eax, %eax
	movl	%ebx, cudaOptLevel(%rip)
	movl	%eax, benchNum(%rip)
	movl	%ebx, benchConfig(%rip)
	incl	%ebx
	movss	%xmm0, left(%rip)
	movss	%xmm0, bottom(%rip)
	movl	$1, benchType(%rip)
	movl	$0x40000000, top(%rip)
	movl	$0x40000000, right(%rip)
	movl	$0x3c23d70a, spStep(%rip)
	movl	$100, nBlackHoles(%rip)
	movl	$100, nAsteroids(%rip)
	call	_Z15runBenchMarkGPUv
	movss	.LC91(%rip), %xmm0
	incl	nBenchmark(%rip)
	movl	$1, benchNum(%rip)
	movss	%xmm0, left(%rip)
	movss	%xmm0, bottom(%rip)
	movl	$0x40000000, top(%rip)
	movl	$0x40000000, right(%rip)
	movl	$0x3c23d70a, spStep(%rip)
	movl	$500, nBlackHoles(%rip)
	movl	$500, nAsteroids(%rip)
	call	_Z15runBenchMarkGPUv
	movss	.LC91(%rip), %xmm0
	incl	nBenchmark(%rip)
	movl	$2, benchNum(%rip)
	movss	%xmm0, left(%rip)
	movss	%xmm0, bottom(%rip)
	movl	$0x40000000, top(%rip)
	movl	$0x40000000, right(%rip)
	movl	$0x3c23d70a, spStep(%rip)
	movl	$1000, nBlackHoles(%rip)
	movl	$1000, nAsteroids(%rip)
	call	_Z15runBenchMarkGPUv
	movss	.LC91(%rip), %xmm0
	incl	nBenchmark(%rip)
	movl	$3, benchNum(%rip)
	movss	%xmm0, left(%rip)
	movss	%xmm0, bottom(%rip)
	movl	$0x40000000, top(%rip)
	movl	$0x40000000, right(%rip)
	movl	$0x3c23d70a, spStep(%rip)
	movl	$1000, nBlackHoles(%rip)
	movl	$5000, nAsteroids(%rip)
	call	_Z15runBenchMarkGPUv
	movss	.LC91(%rip), %xmm0
	incl	nBenchmark(%rip)
	movl	$4, benchNum(%rip)
	movss	%xmm0, left(%rip)
	movss	%xmm0, bottom(%rip)
	movl	$0x40000000, top(%rip)
	movl	$0x40000000, right(%rip)
	movl	$0x3a83126f, spStep(%rip)
	movl	$100, nBlackHoles(%rip)
	movl	$100, nAsteroids(%rip)
	call	_Z15runBenchMarkGPUv
	movss	.LC91(%rip), %xmm0
	incl	nBenchmark(%rip)
	movl	$5, benchNum(%rip)
	movss	%xmm0, left(%rip)
	movss	%xmm0, bottom(%rip)
	movl	$0x40000000, top(%rip)
	movl	$0x40000000, right(%rip)
	movl	$0x3a83126f, spStep(%rip)
	movl	$500, nBlackHoles(%rip)
	movl	$500, nAsteroids(%rip)
	call	_Z15runBenchMarkGPUv
	movss	.LC91(%rip), %xmm0
	incl	nBenchmark(%rip)
	movl	$6, benchNum(%rip)
	movss	%xmm0, left(%rip)
	movss	%xmm0, bottom(%rip)
	movl	$0x40000000, top(%rip)
	movl	$0x40000000, right(%rip)
	movl	$0x3a83126f, spStep(%rip)
	movl	$1000, nBlackHoles(%rip)
	movl	$1000, nAsteroids(%rip)
	call	_Z15runBenchMarkGPUv
	movss	.LC91(%rip), %xmm0
	incl	nBenchmark(%rip)
	movl	$8, benchNum(%rip)
	movl	$0x40000000, top(%rip)
	movl	$0x40000000, right(%rip)
	movl	$0x3a03126f, spStep(%rip)
	movl	$100, nBlackHoles(%rip)
	movl	$100, nAsteroids(%rip)
	movss	%xmm0, left(%rip)
	movss	%xmm0, bottom(%rip)
	call	_Z15runBenchMarkGPUv
	incl	nBenchmark(%rip)
	cmpl	$4, %ebx
	jne	.L267
	movq	stdout(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	fflush@PLT
	.cfi_endproc
.LFE2066:
	.size	_Z13runBenchmarksv, .-_Z13runBenchmarksv
	.section	.rodata.str1.1
.LC94:
	.string	"Running All Benchmarks ...\n"
.LC95:
	.string	"Benchmarks in : %ld seconds\n"
	.text
	.globl	_Z15runAllBechmarksv
	.type	_Z15runAllBechmarksv, @function
_Z15runAllBechmarksv:
.LFB2067:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC94(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	call	_Z17currentTimeMillisv
	movq	%rax, %rbx
	xorl	%eax, %eax
	movl	%eax, nBenchmark(%rip)
	call	_Z13runBenchmarksv
	movl	nBenchmark(%rip), %esi
	leaq	BENCHS(%rip), %rdi
	call	_Z16benchMarksToFileP9benchmarki
	call	_Z17currentTimeMillisv
	movl	$1000, %ecx
	movl	$2, %edi
	leaq	.LC95(%rip), %rsi
	subq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2067:
	.size	_Z15runAllBechmarksv, .-_Z15runAllBechmarksv
	.section	.rodata.str1.1
.LC96:
	.string	"Cuda Space Time Simulator - 2020\n\n"
.LC97:
	.string	"  Author: Oscar Noel Amaya Garcia. email: dbanshee@gmail.com\n"
.LC98:
	.string	"  nVidia DLI - Volunteer practice\n"
.LC99:
	.string	"\n\n"
.LC100:
	.string	"Invalid args.\n"
.LC101:
	.string	"cudaspsim [benchmark]\n"
.LC102:
	.string	"benchmark"
.LC103:
	.string	"\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2070:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%eax, %eax
	leaq	.LC99(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edi, %ebp
	movl	$2, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rsi, %rbx
	leaq	.LC96(%rip), %rsi
	movl	%eax, runMode(%rip)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC97(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC98(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	call	_Z19printfGPUDeviceInfov
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	cmpl	$2, %ebp
	jle	.L273
	leaq	.LC100(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$2, %edi
	leaq	.LC101(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %edi
	call	exit@PLT
.L273:
	jne	.L274
	movq	8(%rbx), %rdi
	leaq	.LC102(%rip), %rsi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L274
	movl	$1, runMode(%rip)
	jmp	.L275
.L274:
	cmpl	$0, runMode(%rip)
	jne	.L275
	call	_Z16runSimulationGPUv
	jmp	.L276
.L275:
	call	_Z15runAllBechmarksv
	leaq	.LC103(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L276:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2070:
	.size	main, .-main
	.section	.rodata.str1.1
.LC104:
	.string	"_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi"
.LC105:
	.string	"_Z19calculateAsteroidsKP8asteroidiP9blackHoleif"
.LC106:
	.string	"_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii"
.LC107:
	.string	"_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2104:
	.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	.LC104(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi(%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	.LC105(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif(%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	.LC106(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii(%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	.LC107(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei(%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
.LFE2104:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	benchType
	.bss
	.align 4
	.type	benchType, @object
	.size	benchType, 4
benchType:
	.zero	4
	.globl	benchConfig
	.align 4
	.type	benchConfig, @object
	.size	benchConfig, 4
benchConfig:
	.zero	4
	.globl	benchNum
	.align 4
	.type	benchNum, @object
	.size	benchNum, 4
benchNum:
	.zero	4
	.globl	benchName
	.align 32
	.type	benchName, @object
	.size	benchName, 1024
benchName:
	.zero	1024
	.globl	BENCHS
	.align 32
	.type	BENCHS, @object
	.size	BENCHS, 135168
BENCHS:
	.zero	135168
	.globl	bechmarkRegenWriteFileSteps
	.data
	.align 4
	.type	bechmarkRegenWriteFileSteps, @object
	.size	bechmarkRegenWriteFileSteps, 4
bechmarkRegenWriteFileSteps:
	.long	20
	.globl	bechmarkRegenBHSteps
	.align 4
	.type	bechmarkRegenBHSteps, @object
	.size	bechmarkRegenBHSteps, 4
bechmarkRegenBHSteps:
	.long	360
	.globl	nBenchmark
	.bss
	.align 4
	.type	nBenchmark, @object
	.size	nBenchmark, 4
nBenchmark:
	.zero	4
	.globl	cudaOptLevel
	.data
	.align 4
	.type	cudaOptLevel, @object
	.size	cudaOptLevel, 4
cudaOptLevel:
	.long	3
	.globl	cols
	.bss
	.align 4
	.type	cols, @object
	.size	cols, 4
cols:
	.zero	4
	.globl	rows
	.align 4
	.type	rows, @object
	.size	rows, 4
rows:
	.zero	4
	.globl	nelems
	.align 4
	.type	nelems, @object
	.size	nelems, 4
nelems:
	.zero	4
	.globl	spStep
	.data
	.align 4
	.type	spStep, @object
	.size	spStep, 4
spStep:
	.long	1036831949
	.globl	right
	.align 4
	.type	right, @object
	.size	right, 4
right:
	.long	1073741824
	.globl	bottom
	.align 4
	.type	bottom, @object
	.size	bottom, 4
bottom:
	.long	-1073741824
	.globl	left
	.align 4
	.type	left, @object
	.size	left, 4
left:
	.long	-1073741824
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.long	1073741824
	.globl	spSize
	.bss
	.align 4
	.type	spSize, @object
	.size	spSize, 4
spSize:
	.zero	4
	.globl	SPBox
	.align 8
	.type	SPBox, @object
	.size	SPBox, 8
SPBox:
	.zero	8
	.globl	astSize
	.align 4
	.type	astSize, @object
	.size	astSize, 4
astSize:
	.zero	4
	.globl	asteroids
	.align 8
	.type	asteroids, @object
	.size	asteroids, 8
asteroids:
	.zero	8
	.globl	bhSize
	.align 4
	.type	bhSize, @object
	.size	bhSize, 4
bhSize:
	.zero	4
	.globl	blackHoles
	.align 8
	.type	blackHoles, @object
	.size	blackHoles, 8
blackHoles:
	.zero	8
	.globl	nAsteroids
	.data
	.align 4
	.type	nAsteroids, @object
	.size	nAsteroids, 4
nAsteroids:
	.long	30
	.globl	nBlackHoles
	.bss
	.align 4
	.type	nBlackHoles, @object
	.size	nBlackHoles, 4
nBlackHoles:
	.zero	4
	.globl	astCurrentBuff
	.align 4
	.type	astCurrentBuff, @object
	.size	astCurrentBuff, 4
astCurrentBuff:
	.zero	4
	.globl	spCurrentBuff
	.align 4
	.type	spCurrentBuff, @object
	.size	spCurrentBuff, 4
spCurrentBuff:
	.zero	4
	.globl	runMode
	.align 4
	.type	runMode, @object
	.size	runMode, 4
runMode:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	-4194304
	.long	1105199103
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC3:
	.long	805306368
	.align 4
.LC24:
	.long	1092616192
	.align 4
.LC25:
	.long	1065353216
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC26:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst4
	.align 4
.LC27:
	.long	814313567
	.section	.rodata.cst8
	.align 8
.LC29:
	.long	-1717986918
	.long	1068079513
	.align 8
.LC30:
	.long	0
	.long	1072693248
	.section	.rodata.cst16
	.align 16
.LC31:
	.long	-2147483648
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC32:
	.long	1202590843
	.long	1065646817
	.section	.rodata.cst4
	.align 4
.LC35:
	.long	1028443341
	.align 4
.LC52:
	.long	897581056
	.align 4
.LC56:
	.long	897988541
	.align 4
.LC57:
	.long	981668463
	.align 4
.LC84:
	.long	981467136
	.align 4
.LC85:
	.long	1023410176
	.align 4
.LC86:
	.long	1107296256
	.align 4
.LC91:
	.long	-1073741824
	.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:

/*
 * SpaceTime Simulator
 *   Curso Deep Learning y Cuda - 2020
 *   Autor: Oscar Noel Amaya Garcia   
 *   email: dbanshee@gmail.com
 */
 
#include <hip/hip_runtime.h>

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <unistd.h>
#include <string.h>
#include <sys/time.h>

#define RUN_MODE_SIM            0
#define RUN_MODE_BENCH          1

#define SP_FILENAME             "sp.json"
#define SP_FILENAME_BUFF1       "sp_0.json"
#define SP_FILENAME_BUFF2       "sp_1.json"
#define SP_FILENAME_BENCH       "sp_bench.json"
#define MAX_BLACK_HOLES         10
#define SOFTENING               1e-9f
#define DT                      0.05f

#define MAX_ASTEROIDS           30
#define AST_FILENAME            "ast.json"
#define AST_FILENAME_BUFF1      "ast_0.json"
#define AST_FILENAME_BUFF2      "ast_1.json"
#define AST_FILENAME_BENCH      "ast_bench.json"

#define MAX_BENCHMARKS          128
#define BENCH_FILENAME          "benchmark.json"
#define BENCH_TIME_SECS         10
#define BENCH_CPU               0
#define BENCH_GPU               1
#define BENCH_REGEN_BH_STEPS    5
#define BENCH_FILE_ACCESS_STEPS 3

#define CUDA_OPT_NLEVELS        4
#define CUDA_OPT_LEVEL_0        0
#define CUDA_OPT_LEVEL_1        1
#define CUDA_OPT_LEVEL_2        2
#define CUDA_OPT_LEVEL_3        3

#define MAX_TIME_SIMULATION_SEC 360
#define REGEN_BLACK_HOLES_SEC   20

#define NUM_BECHMARKS 10

typedef struct blackHole {
    float x, y, g;
} blackHole;

typedef struct spacePoint {
    float x, y, g;
} spacePoint;

typedef struct asteroid { 
    float x, y, vx, vy; 
} asteroid;


typedef struct benchmark {
    char name[1024];
    int number;
    int config;
    int type;   // CPU = 0, GPU = 1
    long time;  // millis
    int steps;
} benchmark;


///////////////
// Global Vars
///////////////

// Runtime
int runMode = RUN_MODE_SIM;
int spCurrentBuff = 0; 
int astCurrentBuff = 0; 
int nBlackHoles = 0;
int nAsteroids = MAX_ASTEROIDS;
blackHole* blackHoles = NULL;
int bhSize;
asteroid* asteroids = NULL;
int astSize;
spacePoint* SPBox = NULL;
int spSize;
float top = 2, left = -2, bottom = -2, right = 2;
float spStep = 0.1;
int nelems;
int rows, cols;
int cudaOptLevel = CUDA_OPT_LEVEL_3;

// BenchMark
int nBenchmark;
int bechmarkRegenBHSteps = MAX_TIME_SIMULATION_SEC;
int bechmarkRegenWriteFileSteps = REGEN_BLACK_HOLES_SEC;
benchmark BENCHS[MAX_BENCHMARKS];
char benchName[1024];
int benchNum;
int benchConfig;
int benchType;


//////////////////
// Error Handling
//////////////////

void checkCudaError(hipError_t err) {
  if (err != hipSuccess) {
    printf("Error: %s", hipGetErrorString(err));
    exit(-1);
  }
}

/////////////////
// Miscellaneous
/////////////////

long currentTimeMillis() {
  struct timeval time;
  gettimeofday(&time, NULL);
  long s1 = (int64_t)(time.tv_sec) * 1000;
  long s2 = (time.tv_usec / 1000);
  return s1 + s2;
}

void initRandom() {
    srand(time(NULL));
}

float getRandom() {
    return (double) rand() / (double)RAND_MAX ;
}

float getRandonLimits(float min, float max) {
    float scale = rand() / (float) RAND_MAX; /* [0, 1.0] */
    return min + scale * ( max - min );      /* [min, max] */
}

int nsleep(long miliseconds) {
   struct timespec req, rem;

   if (miliseconds > 999) {   
        req.tv_sec = (int)(miliseconds / 1000);
        req.tv_nsec = (miliseconds - ((long)req.tv_sec * 1000)) * 1000000;
   } else {   
        req.tv_sec = 0;
        req.tv_nsec = miliseconds * 1000000;
   }   

   return nanosleep(&req , &rem);
}

/////////////
// File Dump
/////////////

void spaceTimeToFile(spacePoint* SPBox, int nRows, int nCols) {

    char filename[16];
    
    if (runMode != RUN_MODE_SIM) {
        strcpy(filename, SP_FILENAME_BENCH);
    } else {
        if (spCurrentBuff == 0) {
            strcpy(filename, SP_FILENAME_BUFF1);
            spCurrentBuff = 1;
        } else {
            strcpy(filename, SP_FILENAME_BUFF2);
            spCurrentBuff = 0;
        }
    }
    
    FILE *fp;
    fp = fopen(filename, "w+");
    
    fputs("{\"space\":[", fp);
    for (int i = 0; i < nRows; i++) {
        for (int j = 0; j < nCols; j++) {
            int idx = i*nRows+j; 
            fprintf(fp, "[%0.2f,%0.2f,%0.2f]", SPBox[idx].x, SPBox[idx].y, SPBox[idx].g);
            
            if (i+1 < nRows || j+1 < nCols) {
                fprintf(fp, ",");
            }
        }
    }    
    fputs("]", fp);
    
    fputs(",\"blackHoles\":[", fp);
    for (int i = 0; i < nBlackHoles; i++) {
        fprintf(fp, "[%0.2f,%0.2f,%0.2f]", blackHoles[i].x, blackHoles[i].y, blackHoles[i].g);
        if (i+1 < nBlackHoles) {
            fprintf(fp, ",");
        }
    }
    fputs("]}", fp);
    fclose(fp);
    
    if (runMode == RUN_MODE_SIM) {
        if (access(SP_FILENAME, F_OK) != -1) {
            remove(SP_FILENAME);
        }
        symlink(filename, SP_FILENAME);
    }
}

void asteroidsToFile(asteroid* AST, int nAsteroids) {

    char filename[16];
    if (runMode != RUN_MODE_SIM) {
        strcpy(filename, AST_FILENAME_BENCH);
    } else {
        if (astCurrentBuff == 0) {
            strcpy(filename, AST_FILENAME_BUFF1);
            astCurrentBuff = 1;
        } else {
            strcpy(filename, AST_FILENAME_BUFF2);
            astCurrentBuff = 0;
        }
    }
    
    FILE *fp;
    fp = fopen(filename, "w+");
    
    fputs("{\"asteroids\":[", fp);
    for (int i = 0; i < nAsteroids; i++) { 
        fprintf(fp, "[%0.2f,%0.2f]", AST[i].x, AST[i].y);
            
        if (i+1 < nAsteroids) {
           fprintf(fp, ",");
        }
        
    }    
    fputs("]}", fp);
    fclose(fp);
    
    if (runMode == RUN_MODE_SIM) {
        if (access(AST_FILENAME, F_OK) != -1) {
            remove(AST_FILENAME);
        }
        symlink(filename, AST_FILENAME);
    }
}

void benchMarksToFile(benchmark* BENCHS, int nBenchMarks) {
    printf("Writing benchmark to File: %s\n", BENCH_FILENAME);
    fflush(stdout);
    
    FILE *fp;
    fp = fopen(BENCH_FILENAME, "w+");
    
    fputs("{\"benchmarks\":[", fp);
    for (int i = 0; i < nBenchMarks; i++) { 
        fputs("{", fp);
        fprintf(fp, "\"name\": \"%s\",", BENCHS[i].name);
        fprintf(fp, "\"number\": %d,",   BENCHS[i].number);
        fprintf(fp, "\"type\": %d,",     BENCHS[i].type);
        fprintf(fp, "\"config\": %d,",   BENCHS[i].config);
        fprintf(fp, "\"time\": %ld,",    BENCHS[i].time);
        fprintf(fp, "\"steps\": %d",     BENCHS[i].steps);
        fputs("}", fp);
        
        if (i+1 < nBenchMarks) {
           fprintf(fp, ",");
        }
    }    
    fputs("]}", fp);
    fclose(fp);
}

///////////////
// CPU Runtime
///////////////

void freeBlackHoles() {
    if (blackHoles != NULL) {
        hipFree(blackHoles);
        blackHoles = NULL;
    }
}

void initBlackHoles() { 
    freeBlackHoles();
    
    bhSize = nBlackHoles*sizeof(blackHole);
    checkCudaError(hipMallocManaged(&blackHoles, bhSize));
    
    for (int i = 0 ; i < nBlackHoles ; i++) {
        blackHoles[i].x = getRandonLimits(left, right);
        blackHoles[i].y = getRandonLimits(bottom, top);
        blackHoles[i].g = 500.0f;
    }
}

void generateBlackHoles() { 
    nBlackHoles = (int) getRandonLimits(1, MAX_BLACK_HOLES) % MAX_BLACK_HOLES;
    initBlackHoles();
}

void initSpaceTime() {
    rows = abs(right-left) / spStep;
    cols = abs(top-bottom) / spStep;
    nelems = cols*rows;

    spSize = sizeof(spacePoint) * nelems;
    checkCudaError(hipMallocManaged(&SPBox, spSize));
    memset(SPBox, 0, spSize);
}

void freeSpaceTime() {
    if (SPBox != NULL) {
        hipFree(SPBox);
        SPBox = NULL;
    }
}

void calculateSpaceTime(spacePoint* SPBox, int nRows, int nCols) { 
    for (int i = 0; i < nRows; i++) {
        for (int j = 0; j < nCols; j++) {
            float x = (i / (float) nRows * (right-left)) + left;
            float y = (j / (float) nCols * (top-bottom)) + bottom;
            
            int idx = i*nRows+j;
            
            float g = 0.0f;
            for (int b = 0; b < nBlackHoles; b++){
                float dx = x - blackHoles[b].x;
                float dy = y - blackHoles[b].y;
                float distSqr = sqrt(dx*dx + dy*dy);
                if (distSqr == 0.0f) {
                    distSqr = 0.000000001;
                }  
                
                float invDist = 1 / (pow(distSqr, 0.05));
                g += (blackHoles[b].g * invDist);                                
            }
            SPBox[idx].x = x;
            SPBox[idx].y = y;
            SPBox[idx].g = g;
        }
    }
}

void freeAsteroids() {
    if (asteroids != NULL) {
        hipFree(asteroids);
        asteroids = NULL;
    }
}

void initAsteroids() {
    freeAsteroids();
    astSize = nAsteroids*sizeof(asteroid);
    checkCudaError(hipMallocManaged(&asteroids, astSize));
    memset(asteroids, 0, astSize);

    for (int i = 0; i < nAsteroids; i++) {
        asteroids[i].x = getRandonLimits(left, right);
        asteroids[i].y = getRandonLimits(bottom, top); 
    }
}

void calculateAsteroids(asteroid* AST, int nAsteroids, blackHole* BH, int nBlackHoles, float dt) {
    for (int i = 0; i < nAsteroids; i++) {
        float Fx = 0.0f; float Fy = 0.0f;

        for (int j = 0; j < nBlackHoles; j++) {
            float dx = AST[i].x - BH[j].x;
            float dy = AST[i].y - BH[j].y;
            
            if (dx == 0) break;
            if (dy == 0) break;
            
            float distSqr = dx*dx + dy*dy;
            //float invDist = rsqrtf(distSqr);
            float invDist = 1 / sqrt(distSqr*distSqr);

            Fx += dx * invDist; Fy += dy * invDist;
        }
        
        float modF = sqrt(Fx*Fx + Fy*Fy);
        Fx = Fx / modF;
        Fy = Fy / modF;
        
        AST[i].vx += dt*-Fx; 
        AST[i].vy += dt*-Fy;
        AST[i].x  += AST[i].vx*0.01;
        AST[i].y  += AST[i].vy*0.01;
    }
}

void runSimulationCPU() {
    printf("Running Simulation CPU ...\n");
    printf("SpaceTime Params: rows: %d, cols: %d, size: %d\n", rows, cols, nelems);
    
    long initSimulation = currentTimeMillis();
    int elapsedSimulation = 0;
    long lastBlackHoleRegen = 0;
    
    initSpaceTime();
    initAsteroids();
    
    while (elapsedSimulation < MAX_TIME_SIMULATION_SEC) {   
        
        long current = currentTimeMillis();
        
        if (blackHoles == NULL || (current - lastBlackHoleRegen) / 1000 > REGEN_BLACK_HOLES_SEC) {
            generateBlackHoles();
            calculateSpaceTime(SPBox, rows, cols);
            spaceTimeToFile(SPBox, rows, cols);
            lastBlackHoleRegen = current;
        }
    
        calculateAsteroids(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
        asteroidsToFile(asteroids, nAsteroids);
        
        nsleep(250);
        elapsedSimulation = (currentTimeMillis() - initSimulation) / 1000;
    }
    
    freeAsteroids();
}

////////////////////
// GPU CUDA Runtime
////////////////////

__global__ void calculateSpaceTimeK(spacePoint* SPBox, int nRows, int nCols, float left, float right, float top, float bottom, blackHole* BH, int nBlackHoles) { 
    int i = threadIdx.x + blockIdx.x * blockDim.x;
    int j = threadIdx.y + blockIdx.y * blockDim.y;
    
    if (i < nRows && j < nCols) {
        float x = (i / (float) nRows * (right-left)) + left;
        float y = (j / (float) nCols * (top-bottom)) + bottom;
            
        int idx = i*nRows+j;
            
        float g = 0.0f;
        for (int b = 0; b < nBlackHoles; b++){
            float dx = x - BH[b].x;
            float dy = y - BH[b].y;
            float distSqr = sqrt(dx*dx + dy*dy);
            if (distSqr == 0.0f) {
                distSqr = 0.000000001;
            }  
                
            float invDist = 1 / (pow((float)distSqr, (float)0.05));
            g += (BH[b].g * invDist);                                
        }
        
        SPBox[idx].x = x;
        SPBox[idx].y = y;
        SPBox[idx].g = g;
    }
}

__global__ void calculateSpaceTimeKSHM(spacePoint* SPBox, int nRows, int nCols, float left, float right, float top, float bottom, blackHole* BH, int nBlackHoles, int bhSize) { 

    extern __shared__ float s[];
    blackHole* bhCache = (blackHole*) s;

    int i = threadIdx.x + blockIdx.x * blockDim.x;
    int j = threadIdx.y + blockIdx.y * blockDim.y;
    
    if (i == 0 && j == 0)
        memcpy(bhCache, BH, bhSize);
    __syncthreads();
    
    if (i < nRows && j < nCols) {
        float x = (i / (float) nRows * (right-left)) + left;
        float y = (j / (float) nCols * (top-bottom)) + bottom;
            
        int idx = i*nRows+j;
            
        float g = 0.0f;
        for (int b = 0; b < nBlackHoles; b++){
            float dx = x - bhCache[b].x;
            float dy = y - bhCache[b].y;
            float distSqr = sqrt(dx*dx + dy*dy);
            if (distSqr == 0.0f) {
                distSqr = 0.000000001;
            }  
                
            float invDist = 1 / (pow((float)distSqr, (float)0.05));
            g += (bhCache[b].g * invDist);                                
        }
        
        SPBox[idx].x = x;
        SPBox[idx].y = y;
        SPBox[idx].g = g;
    }
}

__global__ void calculateAsteroidsK(asteroid* AST, int nAsteroids, blackHole* BH, int nBlackHoles, float dt) {

    int idx    = (blockIdx.x * blockDim.x) + threadIdx.x;
    int stride = gridDim.x * blockDim.x;

    for (int i = idx; i < nAsteroids; i += stride) {
        float Fx = 0.0f; float Fy = 0.0f;

        for (int j = 0; j < nBlackHoles; j++) {
            float dx = AST[i].x - BH[j].x;
            float dy = AST[i].y - BH[j].y;
            
            if (dx == 0) break;
            if (dy == 0) break;
            
            float distSqr = dx*dx + dy*dy; //+ SOFTENING;
            //float invDist = rsqrtf(distSqr);
            float invDist = 1 / sqrt(distSqr*distSqr);
            //float invDist3 = invDist * invDist * invDist;

            Fx += dx * invDist; Fy += dy * invDist;
        }
        
        float modF = sqrt(Fx*Fx + Fy*Fy);
        Fx = Fx / modF;
        Fy = Fy / modF;
        
        AST[i].vx += dt*-Fx; 
        AST[i].vy += dt*-Fy;
        AST[i].x  += AST[i].vx*0.01;
        AST[i].y  += AST[i].vy*0.01;
    }
}

__global__ void calculateAsteroidsKSHM(asteroid* AST, int nAsteroids, blackHole* BH, int nBlackHoles, float dt, int bhSize) {

    extern __shared__ float s[];
    blackHole* bhCache = (blackHole*) s;
    
    int idx    = (blockIdx.x * blockDim.x) + threadIdx.x;
    int stride = gridDim.x * blockDim.x;
    
    if (idx == 0) 
        memcpy(bhCache, BH, bhSize);
    __syncthreads();

    for (int i = idx; i < nAsteroids; i += stride) {
        float Fx = 0.0f; float Fy = 0.0f;

        for (int j = 0; j < nBlackHoles; j++) {
            float dx = AST[i].x - bhCache[j].x;
            float dy = AST[i].y - bhCache[j].y;
            
            if (dx == 0) break;
            if (dy == 0) break;
            
            float distSqr = dx*dx + dy*dy;
            float invDist = 1 / sqrt(distSqr*distSqr);

            Fx += dx * invDist; Fy += dy * invDist;
        }
        
        float modF = sqrt(Fx*Fx + Fy*Fy);
        Fx = Fx / modF;
        Fy = Fy / modF;
        
        AST[i].vx += dt*-Fx; 
        AST[i].vy += dt*-Fy;
        AST[i].x  += AST[i].vx*0.01;
        AST[i].y  += AST[i].vy*0.01;
    }
}

void runSimulationGPU() {
    printf("Running Simulation GPU ...\n");
    
    long initSimulation = currentTimeMillis();
    int elapsedSimulation = 0;
    long lastBlackHoleRegen = 0;
    
    int multiProcessorCount = 32;
    initSpaceTime();
    initAsteroids();
    
    printf("SpaceTime Params: rows: %d, cols: %d, size: %d\n", rows, cols, nelems);
    
    dim3 threads_per_block_K1(32, 32, 1);
    dim3 total_blocks_K1((rows / threads_per_block_K1.x) + 1, (cols / threads_per_block_K1.y) + 1, 1);
        
    int threads_per_block_K2 = 1024;
    int number_of_blocks_K2 = ceil(((nAsteroids / (float) threads_per_block_K2) + 1) / multiProcessorCount) * multiProcessorCount;
    
    
    while (elapsedSimulation < MAX_TIME_SIMULATION_SEC) {   
        
        long current = currentTimeMillis();
        
        if (blackHoles == NULL || (current - lastBlackHoleRegen) / 1000 > REGEN_BLACK_HOLES_SEC) {
            generateBlackHoles();
            
            calculateSpaceTimeK<<<total_blocks_K1, threads_per_block_K1>>>(SPBox, rows, cols, left, right, top, bottom, blackHoles, nBlackHoles);
            checkCudaError(hipGetLastError());
            calculateAsteroidsK<<<number_of_blocks_K2, threads_per_block_K2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
            checkCudaError(hipGetLastError());
            checkCudaError(hipDeviceSynchronize());
            
            spaceTimeToFile(SPBox, rows, cols);
            
            lastBlackHoleRegen = current;
        }
    
        calculateAsteroidsK<<<number_of_blocks_K2, threads_per_block_K2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
        checkCudaError(hipGetLastError());
        
        
        checkCudaError(hipDeviceSynchronize());
        asteroidsToFile(asteroids, nAsteroids);
        
        nsleep(250);
        elapsedSimulation = (currentTimeMillis() - initSimulation) / 1000;
    }
    
    freeAsteroids();
}


//////////////
// Benchmarks
//////////////

void recordBenchmark(int i, char* name, int num, int type, int config, long time, int steps) {
    if (i < MAX_BENCHMARKS) {
        strcpy(BENCHS[i].name, name);
        BENCHS[i].number = num;
        BENCHS[i].type = type;
        BENCHS[i].config = config;
        BENCHS[i].time = time;
        BENCHS[i].steps = steps;
    }
}

void accessSPBenchCPU(spacePoint* SPBox, int nRows, int nCols) {
    float x, y, g;

    for (int i = 0; i < nRows; i++) {
        for (int j = 0; j < nCols; j++) {
            int idx = i*nRows+j; 
            x = SPBox[idx].x; y = SPBox[idx].y; g = SPBox[idx].g;
            x++; y++; g++;
        }
    }
}

void accessBHBenchCPU(){
    float x, y, g;
    for (int i = 0; i < nBlackHoles; i++) {
        x = blackHoles[i].x; y = blackHoles[i].y; g = blackHoles[i].g;
        x++; y++; g++;
    }
}

void accessAstBenchCPU(asteroid* AST, int nAsteroids){
    float x, y;
    for (int i = 0; i < nAsteroids; i++) { 
        x = AST[i].x; y = AST[i].y;
        x++; y++; 
    }    
}

void runBenchMarkCPU() {
    printf("\nBenchmark CPU %d_%d - Config %d\n", benchNum, benchConfig, benchConfig);
    printf("  top: %0.2f, bottom: %0.2f, left: %0.2f, right: %0.2f\n", top, bottom, left, right);
    printf("  spStep : %f, nBlackHoles :%d, nAsteroids: %d\n", spStep, nBlackHoles, nAsteroids);
    printf("  Matrix Space Resolution [%d, %d]\n", (int) (abs(right-left) / spStep), (int) (abs(top-bottom) / spStep));
    fflush(stdout);
    
    
    initSpaceTime();
    initAsteroids();
    initBlackHoles();
    
    long startTime = currentTimeMillis();
    int step = 0;    
    while (((currentTimeMillis() - startTime) / 1000) < BENCH_TIME_SECS) {
        if (step % bechmarkRegenBHSteps == 0) {
            initBlackHoles();
        }
        
        if (step % bechmarkRegenWriteFileSteps == 0) {
            accessSPBenchCPU(SPBox, rows, cols);
            accessAstBenchCPU(asteroids, nAsteroids);
        }
        
        calculateSpaceTime(SPBox, rows, cols);
        calculateAsteroids(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
        step++;
    }
    
    accessSPBenchCPU(SPBox, rows, cols);
    accessAstBenchCPU(asteroids, nAsteroids);
    
    long elapsedTime = currentTimeMillis() - startTime;
    
    freeSpaceTime();
    freeAsteroids();
    freeBlackHoles();
    
    sprintf(benchName, "Benchmark %d_%d", benchNum, benchConfig);
    recordBenchmark(nBenchmark, benchName, benchNum, benchType, benchConfig, elapsedTime, step);
    printf("\n  Benchmark %d - Time: %ld millis, steps : %d\n", nBenchmark, elapsedTime, step);
    printf("    Steps Per Second : %ld\n\n", step / (elapsedTime / 1000));
}

void runBenchMarkGPU() {

    printf("\n Benchmark GPU %d_%d - Config %d\n", benchNum, benchConfig, benchConfig);
    printf("  top: %0.2f, bottom: %0.2f, left: %0.2f, right: %0.2f\n", top, bottom, left, right);
    printf("  spStep: %f, nBlackHoles: %d, nAsteroids: %d\n", spStep, nBlackHoles, nAsteroids);
    printf("  Matrix Space Resolution [%d, %d]\n", (int) (abs(right-left) / spStep), (int) (abs(top-bottom) / spStep));
    fflush(stdout);
    
    int deviceId;
    int multiProcessorCount = 32;
    int computePreemptionSupported;
    hipDeviceProp_t deviceProp;
    
    hipGetDevice(&deviceId);
    hipGetDeviceProperties(&deviceProp, deviceId);
    
    multiProcessorCount = deviceProp.multiProcessorCount;
    computePreemptionSupported = deviceProp.computePreemptionSupported;
    printf("  Device supports Compute Preemption: %s\n", computePreemptionSupported ? "Yes" : "No");

    initSpaceTime();
    initAsteroids();
    initBlackHoles();
    

    dim3 threads_per_block_K1(32, 32, 1);
    dim3 total_blocks_K1((rows / threads_per_block_K1.x) + 1, (cols / threads_per_block_K1.y) + 1, 1);
    //printf("    K1 -> Threads Per Block: [%d,%d], Total BLocks: [%d, %d]\n", threads_per_block_K1.x, threads_per_block_K1.y, total_blocks_K1.x, total_blocks_K1.y);
        
    //int threads_per_block_K2 = 64;
    int threads_per_block_K2 = 1024;
    int number_of_blocks_K2 = ceil(((nAsteroids / (float) threads_per_block_K2) + 1) / multiProcessorCount) * multiProcessorCount;
    //printf("    K2 -> Threads Per Block: [%d], Total BLocks: [%d]\n", threads_per_block_K2, number_of_blocks_K2);

    
    long startTime = currentTimeMillis();
    int step = 0;    
    while (((currentTimeMillis() - startTime) / 1000) < BENCH_TIME_SECS) {
        if (step % bechmarkRegenBHSteps == 0) {
            checkCudaError(hipDeviceSynchronize());
            
            if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported)
                hipMemPrefetchAsync(blackHoles, bhSize, hipCpuDeviceId);
            
            initBlackHoles();
            
            if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported)
                hipMemPrefetchAsync(blackHoles, bhSize, deviceId);
        }
        
        if (step % bechmarkRegenWriteFileSteps == 0) {
            if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported) {
                hipMemPrefetchAsync(SPBox, spSize, hipCpuDeviceId);
                hipMemPrefetchAsync(asteroids, astSize, hipCpuDeviceId);
            }
        
            //nsleep(150L); // CPU Ocupancy
            checkCudaError(hipDeviceSynchronize());
            accessSPBenchCPU(SPBox, rows, cols);
            accessAstBenchCPU(asteroids, nAsteroids);
            
            if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported) {
                hipMemPrefetchAsync(SPBox, spSize, deviceId);
                hipMemPrefetchAsync(asteroids, astSize, deviceId);
            }
        } 
       
        if (cudaOptLevel >= CUDA_OPT_LEVEL_1) {
            hipStream_t stream1, stream2;
            checkCudaError(hipStreamCreate(&stream1));
            checkCudaError(hipStreamCreate(&stream2));
            
            if (cudaOptLevel >= CUDA_OPT_LEVEL_3) {
                calculateSpaceTimeKSHM<<<total_blocks_K1, threads_per_block_K1, bhSize, stream1>>>(SPBox, rows, cols, left, right, top, bottom, blackHoles, nBlackHoles, bhSize);
                calculateAsteroidsKSHM<<<number_of_blocks_K2, threads_per_block_K2, bhSize, stream2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT, bhSize);
            } else {
                calculateSpaceTimeK<<<total_blocks_K1, threads_per_block_K1, 0, stream1>>>(SPBox, rows, cols, left, right, top, bottom, blackHoles, nBlackHoles);
                calculateAsteroidsK<<<number_of_blocks_K2, threads_per_block_K2, 0, stream2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
            }
            
            checkCudaError(hipGetLastError());
            hipStreamDestroy(stream1);
            hipStreamDestroy(stream2);
        } else {
            calculateSpaceTimeK<<<total_blocks_K1, threads_per_block_K1>>>(SPBox, rows, cols, left, right, top, bottom, blackHoles, nBlackHoles);
            checkCudaError(hipGetLastError());
            calculateAsteroidsK<<<number_of_blocks_K2, threads_per_block_K2>>>(asteroids, nAsteroids, blackHoles, nBlackHoles, DT);
            checkCudaError(hipGetLastError());
        }
        
        step++;
    }
    
    if (cudaOptLevel >= CUDA_OPT_LEVEL_2 && computePreemptionSupported) {
        hipMemPrefetchAsync(SPBox, spSize, hipCpuDeviceId);
        hipMemPrefetchAsync(asteroids, astSize, hipCpuDeviceId);
    }
    
    checkCudaError(hipDeviceSynchronize());
    accessSPBenchCPU(SPBox, rows, cols);
    accessAstBenchCPU(asteroids, nAsteroids);

    long elapsedTime = currentTimeMillis() - startTime + 1;
  
    freeSpaceTime();
    freeAsteroids();
    freeBlackHoles();

    sprintf(benchName, "Benchmark %d_%d", benchNum, benchConfig);
    recordBenchmark(nBenchmark, benchName, benchNum, benchType, benchConfig, elapsedTime, step);
    printf("\n  Benchmark %d - Time: %ld millis, steps : %d\n", nBenchmark, elapsedTime, step);
    printf("    Steps Per Second : %ld\n\n", step / (elapsedTime / 1000));
}

void runBenchmarks() {
    benchType = BENCH_GPU;
    
    for (int opLevel =  0; opLevel < CUDA_OPT_NLEVELS; opLevel++) {
        // Start on BENCH_CPU for include CPU execution. 
        for (int cp = BENCH_GPU ; cp <= BENCH_GPU; cp++) {
            benchType = cp;
            benchConfig = cudaOptLevel = opLevel;

            // Benchmark 0
            benchNum = 0;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.01;
            nBlackHoles = 100; nAsteroids = 100;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;

            // Benchmark 1
            benchNum = 1;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.01;
            nBlackHoles = 500; nAsteroids = 500;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();  
            nBenchmark++;
            
            // Benchmark 2
            benchNum = 2;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.01;
            nBlackHoles = 1000; nAsteroids = 1000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();  
            nBenchmark++;
            
            // Benchmark 3
            benchNum = 3;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.01;
            nBlackHoles = 1000; nAsteroids = 5000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();  
            nBenchmark++;

            // Benchmark 4
            benchNum = 4;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.001;
            nBlackHoles = 100; nAsteroids = 100;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;

            // Benchmark 5
            benchNum = 5;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.001;
            nBlackHoles = 500; nAsteroids = 500;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            
            // Benchmark 6
            benchNum = 6;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.001;
            nBlackHoles = 1000; nAsteroids = 1000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            
            // Benchmark 7
            /*
            benchNum = 7;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.001;
            nBlackHoles = 5000; nAsteroids = 5000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            */
            
            // Benchmark 8
            benchNum = 8;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.0005;
            nBlackHoles = 100; nAsteroids = 100;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            
            /*
            // Benchmark 9
            benchNum = 9;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.0005;
            nBlackHoles = 500; nAsteroids = 500;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            */
            
            /*
            // Benchmark 10
            benchNum = 10;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.0005;
            nBlackHoles = 1000; nAsteroids = 1000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            
            // Benchmark 11
            benchNum = 11;
            top = 2, left = -2, bottom = -2, right = 2; spStep = 0.0005;
            nBlackHoles = 1000; nAsteroids = 1000;
            if(cp == BENCH_CPU) runBenchMarkCPU();
            else runBenchMarkGPU();
            nBenchmark++;
            */
        }
    }
    fflush(stdout);
}

void runAllBechmarks() {
    printf("Running All Benchmarks ...\n");
    long startTime = currentTimeMillis();
    nBenchmark = 0;
    runBenchmarks();
    benchMarksToFile(BENCHS, nBenchmark);
    printf("Benchmarks in : %ld seconds\n", (currentTimeMillis() - startTime) / 1000);
}

// Device Query code extracted from https://github.com/NVIDIA/cuda-samples
inline int _ConvertSMVer2Cores(int major, int minor) {
  // Defines for GPU Architecture types (using the SM version to determine
  // the # of cores per SM
  typedef struct {
    int SM;  // 0xMm (hexidecimal notation), M = SM Major version,
    // and m = SM minor version
    int Cores;
  } sSMtoCores;

  sSMtoCores nGpuArchCoresPerSM[] = {
      {0x30, 192},
      {0x32, 192},
      {0x35, 192},
      {0x37, 192},
      {0x50, 128},
      {0x52, 128},
      {0x53, 128},
      {0x60,  64},
      {0x61, 128},
      {0x62, 128},
      {0x70,  64},
      {0x72,  64},
      {0x75,  64},
      {-1, -1}};

  int index = 0;

  while (nGpuArchCoresPerSM[index].SM != -1) {
    if (nGpuArchCoresPerSM[index].SM == ((major << 4) + minor)) {
      return nGpuArchCoresPerSM[index].Cores;
    }

    index++;
  }

  // If we don't find the values, we default use the previous one
  // to run properly
  printf(
      "MapSMtoCores for SM %d.%d is undefined."
      "  Default to use %d Cores/SM\n",
      major, minor, nGpuArchCoresPerSM[index - 1].Cores);
  return nGpuArchCoresPerSM[index - 1].Cores;
}


void printfGPUDeviceInfo(){
    int deviceId;
    hipDeviceProp_t deviceProp;
    int driverVersion = 0, runtimeVersion = 0;
    char msg[256];
    
    hipGetDevice(&deviceId);
    hipGetDeviceProperties(&deviceProp, deviceId);
    
    printf("GPU Info\n");
    printf(" Device: \"%s\"\n", deviceProp.name);
    hipDriverGetVersion(&driverVersion);
    hipRuntimeGetVersion(&runtimeVersion);
    printf("  CUDA Driver Version / Runtime Version          %d.%d / %d.%d\n",
           driverVersion / 1000, (driverVersion % 100) / 10,
           runtimeVersion / 1000, (runtimeVersion % 100) / 10);
    printf("  CUDA Capability Major/Minor version number:    %d.%d\n",
           deviceProp.major, deviceProp.minor);
    snprintf(msg, sizeof(msg),
             "  Total amount of global memory:                 %.0f MBytes "
             "(%llu bytes)\n",
             static_cast<float>(deviceProp.totalGlobalMem / 1048576.0f),
             (unsigned long long)deviceProp.totalGlobalMem);
    printf("%s", msg);

    printf("  (%2d) Multiprocessors, (%3d) CUDA Cores/MP:     %d CUDA Cores\n",
           deviceProp.multiProcessorCount,
           _ConvertSMVer2Cores(deviceProp.major, deviceProp.minor),
           _ConvertSMVer2Cores(deviceProp.major, deviceProp.minor) *
               deviceProp.multiProcessorCount);
    printf(
        "  GPU Max Clock rate:                            %.0f MHz (%0.2f "
        "GHz)\n",
        deviceProp.clockRate * 1e-3f, deviceProp.clockRate * 1e-6f);
        printf(
        "  Maximum Texture Dimension Size (x,y,z)         1D=(%d), 2D=(%d, "
        "%d), 3D=(%d, %d, %d)\n",
        deviceProp.maxTexture1D, deviceProp.maxTexture2D[0],
        deviceProp.maxTexture2D[1], deviceProp.maxTexture3D[0],
        deviceProp.maxTexture3D[1], deviceProp.maxTexture3D[2]);
    printf(
        "  Maximum Layered 1D Texture Size, (num) layers  1D=(%d), %d layers\n",
        deviceProp.maxTexture1DLayered[0], deviceProp.maxTexture1DLayered[1]);
    printf(
        "  Maximum Layered 2D Texture Size, (num) layers  2D=(%d, %d), %d "
        "layers\n",
        deviceProp.maxTexture2DLayered[0], deviceProp.maxTexture2DLayered[1],
        deviceProp.maxTexture2DLayered[2]);

    printf("  Total amount of constant memory:               %zu bytes\n",
           deviceProp.totalConstMem);
    printf("  Total amount of shared memory per block:       %zu bytes\n",
           deviceProp.sharedMemPerBlock);
    printf("  Total number of registers available per block: %d\n",
           deviceProp.regsPerBlock);
    printf("  Warp size:                                     %d\n",
           deviceProp.warpSize);
    printf("  Maximum number of threads per multiprocessor:  %d\n",
           deviceProp.maxThreadsPerMultiProcessor);
    printf("  Maximum number of threads per block:           %d\n",
           deviceProp.maxThreadsPerBlock);
    printf("  Max dimension size of a thread block (x,y,z): (%d, %d, %d)\n",
           deviceProp.maxThreadsDim[0], deviceProp.maxThreadsDim[1],
           deviceProp.maxThreadsDim[2]);
    printf("  Max dimension size of a grid size    (x,y,z): (%d, %d, %d)\n",
           deviceProp.maxGridSize[0], deviceProp.maxGridSize[1],
           deviceProp.maxGridSize[2]);
    printf("  Maximum memory pitch:                          %zu bytes\n",
           deviceProp.memPitch);
    printf("  Texture alignment:                             %zu bytes\n",
           deviceProp.textureAlignment);
    printf(
        "  Concurrent copy and kernel execution:          %s with %d copy "
        "engine(s)\n",
        (deviceProp.deviceOverlap ? "Yes" : "No"), deviceProp.asyncEngineCount);
    printf("  Run time limit on kernels:                     %s\n",
           deviceProp.kernelExecTimeoutEnabled ? "Yes" : "No");
    printf("  Integrated GPU sharing Host Memory:            %s\n",
           deviceProp.integrated ? "Yes" : "No");
    printf("  Support host page-locked memory mapping:       %s\n",
           deviceProp.canMapHostMemory ? "Yes" : "No");
    printf("  Alignment requirement for Surfaces:            %s\n",
           deviceProp.surfaceAlignment ? "Yes" : "No");
    printf("  Device has ECC support:                        %s\n",
           deviceProp.ECCEnabled ? "Enabled" : "Disabled");
    printf("  Device supports Unified Addressing (UVA):      %s\n",
           deviceProp.unifiedAddressing ? "Yes" : "No");
    printf("  Device supports Compute Preemption:            %s\n",
           deviceProp.computePreemptionSupported ? "Yes" : "No");
    printf("  Supports Cooperative Kernel Launch:            %s\n",
           deviceProp.cooperativeLaunch ? "Yes" : "No");
    printf("  Supports MultiDevice Co-op Kernel Launch:      %s\n",
           deviceProp.cooperativeMultiDeviceLaunch ? "Yes" : "No");
    printf("  Device PCI Domain ID / Bus ID / location ID:   %d / %d / %d\n",
           deviceProp.pciDomainID, deviceProp.pciBusID, deviceProp.pciDeviceID);

}

int main(const int argc, const char** argv) {
    runMode = RUN_MODE_SIM; // RUN_MODE_SIM | RUN_MODE_BENCH

    printf("Cuda Space Time Simulator - 2020\n\n");
    printf("  Author: Oscar Noel Amaya Garcia. email: dbanshee@gmail.com\n");
    printf("  nVidia DLI - Volunteer practice\n");
    printf("\n\n");
    
    printfGPUDeviceInfo();
    printf("\n\n");
    
    if (argc > 2) {
        printf("Invalid args.\n");
        printf("cudaspsim [benchmark]\n");
        exit(-1);
    } else if(argc == 2 && strcmp(argv[1], "benchmark") == 0) {
        runMode = RUN_MODE_BENCH;
    }
    
    if (runMode == RUN_MODE_SIM) {
        runSimulationGPU();
    } else {
        runAllBechmarks();
        printf("\n");
    }
}


	.text
	.file	"cudaspsim.hip"
	.globl	_Z14checkCudaError10hipError_t  # -- Begin function _Z14checkCudaError10hipError_t
	.type	_Z14checkCudaError10hipError_t,@function
_Z14checkCudaError10hipError_t:         # @_Z14checkCudaError10hipError_t
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jne	.LBB0_2
# %bb.1:
	retq
.LBB0_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	hipGetErrorString
	movl	$.L.str, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$-1, %edi
	callq	exit
.Lfunc_end0:
	.size	_Z14checkCudaError10hipError_t, .Lfunc_end0-_Z14checkCudaError10hipError_t
	.cfi_endproc
                                        # -- End function
	.globl	_Z17currentTimeMillisv          # -- Begin function _Z17currentTimeMillisv
	.type	_Z17currentTimeMillisv,@function
_Z17currentTimeMillisv:                 # @_Z17currentTimeMillisv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	imulq	$1000, (%rbx), %rcx             # imm = 0x3E8
	movabsq	$2361183241434822607, %rax      # imm = 0x20C49BA5E353F7CF
	imulq	8(%rbx)
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z17currentTimeMillisv, .Lfunc_end1-_Z17currentTimeMillisv
	.cfi_endproc
                                        # -- End function
	.globl	_Z10initRandomv                 # -- Begin function _Z10initRandomv
	.type	_Z10initRandomv,@function
_Z10initRandomv:                        # @_Z10initRandomv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	srand                           # TAILCALL
.Lfunc_end2:
	.size	_Z10initRandomv, .Lfunc_end2-_Z10initRandomv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z9getRandomv
.LCPI3_0:
	.quad	0x41dfffffffc00000              # double 2147483647
	.text
	.globl	_Z9getRandomv
	.type	_Z9getRandomv,@function
_Z9getRandomv:                          # @_Z9getRandomv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	rand
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI3_0(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z9getRandomv, .Lfunc_end3-_Z9getRandomv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z15getRandonLimitsff
.LCPI4_0:
	.long	0x30000000                      # float 4.65661287E-10
	.text
	.globl	_Z15getRandonLimitsff
	.type	_Z15getRandonLimitsff,@function
_Z15getRandonLimitsff:                  # @_Z15getRandonLimitsff
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movss	%xmm1, 4(%rsp)                  # 4-byte Spill
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	callq	rand
	xorps	%xmm1, %xmm1
	cvtsi2ss	%eax, %xmm1
	mulss	.LCPI4_0(%rip), %xmm1
	movss	4(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	(%rsp), %xmm2                   # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm0
	mulss	%xmm1, %xmm0
	addss	%xmm2, %xmm0
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z15getRandonLimitsff, .Lfunc_end4-_Z15getRandonLimitsff
	.cfi_endproc
                                        # -- End function
	.globl	_Z6nsleepl                      # -- Begin function _Z6nsleepl
	.type	_Z6nsleepl,@function
_Z6nsleepl:                             # @_Z6nsleepl
	.cfi_startproc
# %bb.0:
	cmpq	$1000, %rdi                     # imm = 0x3E8
	jl	.LBB5_1
# %bb.2:
	movq	%rdi, %rax
	shrq	$3, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	shrq	$4, %rdx
	movslq	%edx, %rax
	imulq	$-1000, %rax, %rcx              # imm = 0xFC18
	addq	%rcx, %rdi
	jmp	.LBB5_3
.LBB5_1:
	xorl	%eax, %eax
.LBB5_3:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	imulq	$1000000, %rdi, %rcx            # imm = 0xF4240
	leaq	24(%rsp), %rdi
	movq	%rax, (%rdi)
	movq	%rcx, 8(%rdi)
	leaq	8(%rsp), %rsi
	callq	nanosleep
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z6nsleepl, .Lfunc_end5-_Z6nsleepl
	.cfi_endproc
                                        # -- End function
	.globl	_Z15spaceTimeToFileP10spacePointii # -- Begin function _Z15spaceTimeToFileP10spacePointii
	.type	_Z15spaceTimeToFileP10spacePointii,@function
_Z15spaceTimeToFileP10spacePointii:     # @_Z15spaceTimeToFileP10spacePointii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, 12(%rsp)                  # 4-byte Spill
	movl	%esi, 8(%rsp)                   # 4-byte Spill
	movq	%rdi, 40(%rsp)                  # 8-byte Spill
	cmpl	$0, runMode(%rip)
	je	.LBB6_2
# %bb.1:
	movabsq	$31084788931520611, %rax        # imm = 0x6E6F736A2E6863
	movq	%rax, 22(%rsp)
	movabsq	$7521977184360034419, %rax      # imm = 0x68636E65625F7073
	movq	%rax, 16(%rsp)
	jmp	.LBB6_5
.LBB6_2:
	cmpl	$0, spCurrentBuff(%rip)
	je	.LBB6_3
# %bb.4:
	movabsq	$8030879307161104499, %rax      # imm = 0x6F736A2E315F7073
	movq	%rax, 16(%rsp)
	movw	$110, 24(%rsp)
	movl	$0, spCurrentBuff(%rip)
	jmp	.LBB6_5
.LBB6_3:
	movabsq	$8030879307144327283, %rax      # imm = 0x6F736A2E305F7073
	movq	%rax, 16(%rsp)
	movw	$110, 24(%rsp)
	movl	$1, spCurrentBuff(%rip)
.LBB6_5:
	leaq	16(%rsp), %rdi
	movl	$.L.str.4, %esi
	callq	fopen
	movq	%rax, %rbx
	movl	$.L.str.5, %edi
	movq	%rax, %rsi
	callq	fputs
	cmpl	$0, 8(%rsp)                     # 4-byte Folded Reload
	jle	.LBB6_14
# %bb.6:                                # %.preheader.lr.ph
	movslq	12(%rsp), %rax                  # 4-byte Folded Reload
	movl	8(%rsp), %r13d                  # 4-byte Reload
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movl	%eax, %r15d
	addq	$8, 40(%rsp)                    # 8-byte Folded Spill
	negq	%r15
	xorl	%eax, %eax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	xorl	%r14d, %r14d
.LBB6_7:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_9 Depth 2
	incq	%r14
	cmpl	$0, 12(%rsp)                    # 4-byte Folded Reload
	jle	.LBB6_13
# %bb.8:                                # %.lr.ph
                                        #   in Loop: Header=BB6_7 Depth=1
	movl	32(%rsp), %eax                  # 4-byte Reload
	leaq	(%rax,%rax,2), %rax
	movq	40(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %rbp
	movl	$1, %r12d
.LBB6_9:                                #   Parent Loop BB6_7 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	-8(%rbp), %xmm0
	xorps	%xmm1, %xmm1
	cvtss2sd	-4(%rbp), %xmm1
	xorps	%xmm2, %xmm2
	cvtss2sd	(%rbp), %xmm2
	movl	$.L.str.6, %esi
	movq	%rbx, %rdi
	movb	$3, %al
	callq	fprintf
	cmpq	%r13, %r14
	jb	.LBB6_11
# %bb.10:                               #   in Loop: Header=BB6_9 Depth=2
	cmpq	48(%rsp), %r12                  # 8-byte Folded Reload
	jge	.LBB6_12
.LBB6_11:                               #   in Loop: Header=BB6_9 Depth=2
	movl	$44, %edi
	movq	%rbx, %rsi
	callq	fputc@PLT
.LBB6_12:                               #   in Loop: Header=BB6_9 Depth=2
	addq	$12, %rbp
	leaq	(%r15,%r12), %rax
	incq	%rax
	incq	%r12
	cmpq	$1, %rax
	jne	.LBB6_9
.LBB6_13:                               # %._crit_edge
                                        #   in Loop: Header=BB6_7 Depth=1
	movq	32(%rsp), %rax                  # 8-byte Reload
	addl	8(%rsp), %eax                   # 4-byte Folded Reload
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	cmpq	%r13, %r14
	jne	.LBB6_7
.LBB6_14:                               # %._crit_edge42
	movl	$.L.str.8, %edi
	movq	%rbx, %rsi
	callq	fputs
	movl	$.L.str.9, %edi
	movq	%rbx, %rsi
	callq	fputs
	cmpl	$0, nBlackHoles(%rip)
	jle	.LBB6_19
# %bb.15:                               # %.lr.ph45.preheader
	movl	$8, %r14d
	xorl	%r15d, %r15d
.LBB6_16:                               # %.lr.ph45
                                        # =>This Inner Loop Header: Depth=1
	movq	blackHoles(%rip), %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	-8(%rax,%r14), %xmm0
	xorps	%xmm1, %xmm1
	cvtss2sd	-4(%rax,%r14), %xmm1
	xorps	%xmm2, %xmm2
	cvtss2sd	(%rax,%r14), %xmm2
	movl	$.L.str.6, %esi
	movq	%rbx, %rdi
	movb	$3, %al
	callq	fprintf
	incq	%r15
	movslq	nBlackHoles(%rip), %rax
	cmpq	%rax, %r15
	jge	.LBB6_18
# %bb.17:                               #   in Loop: Header=BB6_16 Depth=1
	movl	$44, %edi
	movq	%rbx, %rsi
	callq	fputc@PLT
	movslq	nBlackHoles(%rip), %rax
.LBB6_18:                               #   in Loop: Header=BB6_16 Depth=1
	addq	$12, %r14
	cmpq	%rax, %r15
	jl	.LBB6_16
.LBB6_19:                               # %._crit_edge46
	movl	$.L.str.10, %edi
	movq	%rbx, %rsi
	callq	fputs
	movq	%rbx, %rdi
	callq	fclose
	cmpl	$0, runMode(%rip)
	jne	.LBB6_23
# %bb.20:
	movl	$.L.str.11, %edi
	xorl	%esi, %esi
	callq	access
	cmpl	$-1, %eax
	je	.LBB6_22
# %bb.21:
	movl	$.L.str.11, %edi
	callq	remove
.LBB6_22:
	leaq	16(%rsp), %rdi
	movl	$.L.str.11, %esi
	callq	symlink
.LBB6_23:
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_Z15spaceTimeToFileP10spacePointii, .Lfunc_end6-_Z15spaceTimeToFileP10spacePointii
	.cfi_endproc
                                        # -- End function
	.globl	_Z15asteroidsToFileP8asteroidi  # -- Begin function _Z15asteroidsToFileP8asteroidi
	.type	_Z15asteroidsToFileP8asteroidi,@function
_Z15asteroidsToFileP8asteroidi:         # @_Z15asteroidsToFileP8asteroidi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebp
	movq	%rdi, %rbx
	cmpl	$0, runMode(%rip)
	je	.LBB7_2
# %bb.1:
	movabsq	$31084788931520611, %rax        # imm = 0x6E6F736A2E6863
	movq	%rax, 7(%rsp)
	movabsq	$7164775530375705441, %rax      # imm = 0x636E65625F747361
	movq	%rax, (%rsp)
	jmp	.LBB7_5
.LBB7_2:
	cmpl	$0, astCurrentBuff(%rip)
	je	.LBB7_3
# %bb.4:
	movabsq	$8316510451482784609, %rax      # imm = 0x736A2E315F747361
	movq	%rax, (%rsp)
	movl	$7237491, 7(%rsp)               # imm = 0x6E6F73
	movl	$0, astCurrentBuff(%rip)
	jmp	.LBB7_5
.LBB7_3:
	movabsq	$8316510447187817313, %rax      # imm = 0x736A2E305F747361
	movq	%rax, (%rsp)
	movl	$7237491, 7(%rsp)               # imm = 0x6E6F73
	movl	$1, astCurrentBuff(%rip)
.LBB7_5:
	movq	%rsp, %rdi
	movl	$.L.str.4, %esi
	callq	fopen
	movq	%rax, %r14
	movl	$.L.str.15, %edi
	movq	%rax, %rsi
	callq	fputs
	testl	%ebp, %ebp
	jle	.LBB7_10
# %bb.6:                                # %.lr.ph.preheader
	movl	%ebp, %r15d
	addq	$4, %rbx
	movq	%r15, %r12
	negq	%r12
	movl	$1, %r13d
.LBB7_7:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	-4(%rbx), %xmm0
	xorps	%xmm1, %xmm1
	cvtss2sd	(%rbx), %xmm1
	movl	$.L.str.16, %esi
	movq	%r14, %rdi
	movb	$2, %al
	callq	fprintf
	cmpq	%r15, %r13
	jae	.LBB7_9
# %bb.8:                                #   in Loop: Header=BB7_7 Depth=1
	movl	$44, %edi
	movq	%r14, %rsi
	callq	fputc@PLT
.LBB7_9:                                #   in Loop: Header=BB7_7 Depth=1
	addq	$16, %rbx
	leaq	(%r12,%r13), %rax
	incq	%rax
	incq	%r13
	cmpq	$1, %rax
	jne	.LBB7_7
.LBB7_10:                               # %._crit_edge
	movl	$.L.str.10, %edi
	movq	%r14, %rsi
	callq	fputs
	movq	%r14, %rdi
	callq	fclose
	cmpl	$0, runMode(%rip)
	jne	.LBB7_14
# %bb.11:
	movl	$.L.str.17, %edi
	xorl	%esi, %esi
	callq	access
	cmpl	$-1, %eax
	je	.LBB7_13
# %bb.12:
	movl	$.L.str.17, %edi
	callq	remove
.LBB7_13:
	movq	%rsp, %rdi
	movl	$.L.str.17, %esi
	callq	symlink
.LBB7_14:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z15asteroidsToFileP8asteroidi, .Lfunc_end7-_Z15asteroidsToFileP8asteroidi
	.cfi_endproc
                                        # -- End function
	.globl	_Z16benchMarksToFileP9benchmarki # -- Begin function _Z16benchMarksToFileP9benchmarki
	.type	_Z16benchMarksToFileP9benchmarki,@function
_Z16benchMarksToFileP9benchmarki:       # @_Z16benchMarksToFileP9benchmarki
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.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	%esi, %ebp
	movq	%rdi, %rbx
	movl	$.L.str.18, %edi
	movl	$.L.str.19, %esi
	xorl	%eax, %eax
	callq	printf
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.19, %edi
	movl	$.L.str.4, %esi
	callq	fopen
	movq	%rax, %r14
	movl	$.L.str.20, %edi
	movq	%rax, %rsi
	callq	fputs
	testl	%ebp, %ebp
	jle	.LBB8_5
# %bb.1:                                # %.lr.ph.preheader
	movl	%ebp, %r15d
	movq	%r15, %r12
	negq	%r12
	movl	$1, %r13d
.LBB8_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$.L.str.21, %edi
	movq	%r14, %rsi
	callq	fputs
	movl	$.L.str.22, %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movl	1024(%rbx), %edx
	movl	$.L.str.23, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movl	1032(%rbx), %edx
	movl	$.L.str.24, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movl	1028(%rbx), %edx
	movl	$.L.str.25, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	1040(%rbx), %rdx
	movl	$.L.str.26, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movl	1048(%rbx), %edx
	movl	$.L.str.27, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movl	$.L.str.28, %edi
	movq	%r14, %rsi
	callq	fputs
	cmpq	%r15, %r13
	jae	.LBB8_4
# %bb.3:                                #   in Loop: Header=BB8_2 Depth=1
	movl	$44, %edi
	movq	%r14, %rsi
	callq	fputc@PLT
.LBB8_4:                                #   in Loop: Header=BB8_2 Depth=1
	addq	$1056, %rbx                     # imm = 0x420
	leaq	(%r12,%r13), %rax
	incq	%rax
	incq	%r13
	cmpq	$1, %rax
	jne	.LBB8_2
.LBB8_5:                                # %._crit_edge
	movl	$.L.str.10, %edi
	movq	%r14, %rsi
	callq	fputs
	movq	%r14, %rdi
	addq	$8, %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
	jmp	fclose                          # TAILCALL
.Lfunc_end8:
	.size	_Z16benchMarksToFileP9benchmarki, .Lfunc_end8-_Z16benchMarksToFileP9benchmarki
	.cfi_endproc
                                        # -- End function
	.globl	_Z14freeBlackHolesv             # -- Begin function _Z14freeBlackHolesv
	.type	_Z14freeBlackHolesv,@function
_Z14freeBlackHolesv:                    # @_Z14freeBlackHolesv
	.cfi_startproc
# %bb.0:
	movq	blackHoles(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB9_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	hipFree
	movq	$0, blackHoles(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB9_2:
	retq
.Lfunc_end9:
	.size	_Z14freeBlackHolesv, .Lfunc_end9-_Z14freeBlackHolesv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z14initBlackHolesv
.LCPI10_0:
	.long	0x30000000                      # float 4.65661287E-10
	.text
	.globl	_Z14initBlackHolesv
	.type	_Z14initBlackHolesv,@function
_Z14initBlackHolesv:                    # @_Z14initBlackHolesv
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	blackHoles(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB10_2
# %bb.1:
	callq	hipFree
	movq	$0, blackHoles(%rip)
.LBB10_2:                               # %_Z14freeBlackHolesv.exit
	movl	nBlackHoles(%rip), %eax
	shll	$2, %eax
	leal	(%rax,%rax,2), %eax
	movl	%eax, bhSize(%rip)
	movslq	%eax, %rsi
	movl	$blackHoles, %edi
	movl	$1, %edx
	callq	hipMallocManaged
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	cmpl	$0, nBlackHoles(%rip)
	jle	.LBB10_5
# %bb.3:                                # %.lr.ph.preheader
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
.LBB10_4:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	left(%rip), %xmm0               # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movss	right(%rip), %xmm0              # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	.LCPI10_0(%rip), %xmm1          # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	movss	(%rsp), %xmm1                   # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movss	4(%rsp), %xmm2                  # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm1
	mulss	%xmm0, %xmm1
	addss	%xmm2, %xmm1
	movq	blackHoles(%rip), %rax
	movss	%xmm1, (%rax,%rbx)
	movss	bottom(%rip), %xmm0             # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movss	top(%rip), %xmm0                # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI10_0(%rip), %xmm0
	movss	(%rsp), %xmm1                   # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movss	4(%rsp), %xmm2                  # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm1
	mulss	%xmm0, %xmm1
	addss	%xmm2, %xmm1
	movq	blackHoles(%rip), %rax
	movss	%xmm1, 4(%rax,%rbx)
	movl	$1140457472, 8(%rax,%rbx)       # imm = 0x43FA0000
	incq	%r14
	movslq	nBlackHoles(%rip), %rax
	addq	$12, %rbx
	cmpq	%rax, %r14
	jl	.LBB10_4
.LBB10_5:                               # %._crit_edge
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end10:
	.size	_Z14initBlackHolesv, .Lfunc_end10-_Z14initBlackHolesv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z18generateBlackHolesv
.LCPI11_0:
	.long	0x30000000                      # float 4.65661287E-10
.LCPI11_1:
	.long	0x41100000                      # float 9
.LCPI11_2:
	.long	0x3f800000                      # float 1
	.text
	.globl	_Z18generateBlackHolesv
	.type	_Z18generateBlackHolesv,@function
_Z18generateBlackHolesv:                # @_Z18generateBlackHolesv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	rand
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI11_0(%rip), %xmm0
	mulss	.LCPI11_1(%rip), %xmm0
	addss	.LCPI11_2(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	movl	%eax, nBlackHoles(%rip)
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Z14initBlackHolesv             # TAILCALL
.Lfunc_end11:
	.size	_Z18generateBlackHolesv, .Lfunc_end11-_Z18generateBlackHolesv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z13initSpaceTimev
.LCPI12_0:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.text
	.globl	_Z13initSpaceTimev
	.type	_Z13initSpaceTimev,@function
_Z13initSpaceTimev:                     # @_Z13initSpaceTimev
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movss	right(%rip), %xmm0              # xmm0 = mem[0],zero,zero,zero
	subss	left(%rip), %xmm0
	movaps	.LCPI12_0(%rip), %xmm1          # xmm1 = [NaN,NaN,NaN,NaN]
	andps	%xmm1, %xmm0
	movss	spStep(%rip), %xmm2             # xmm2 = mem[0],zero,zero,zero
	divss	%xmm2, %xmm0
	cvttss2si	%xmm0, %eax
	movss	top(%rip), %xmm0                # xmm0 = mem[0],zero,zero,zero
	subss	bottom(%rip), %xmm0
	andps	%xmm1, %xmm0
	divss	%xmm2, %xmm0
	cvttss2si	%xmm0, %ecx
	movl	%eax, rows(%rip)
	movl	%ecx, cols(%rip)
	imull	%eax, %ecx
	movl	%ecx, nelems(%rip)
	shll	$2, %ecx
	leal	(%rcx,%rcx,2), %eax
	movl	%eax, spSize(%rip)
	movslq	%eax, %rsi
	movl	$SPBox, %edi
	movl	$1, %edx
	callq	hipMallocManaged
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	movq	SPBox(%rip), %rdi
	movslq	spSize(%rip), %rdx
	xorl	%esi, %esi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	memset@PLT                      # TAILCALL
.Lfunc_end12:
	.size	_Z13initSpaceTimev, .Lfunc_end12-_Z13initSpaceTimev
	.cfi_endproc
                                        # -- End function
	.globl	_Z13freeSpaceTimev              # -- Begin function _Z13freeSpaceTimev
	.type	_Z13freeSpaceTimev,@function
_Z13freeSpaceTimev:                     # @_Z13freeSpaceTimev
	.cfi_startproc
# %bb.0:
	movq	SPBox(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB13_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	hipFree
	movq	$0, SPBox(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB13_2:
	retq
.Lfunc_end13:
	.size	_Z13freeSpaceTimev, .Lfunc_end13-_Z13freeSpaceTimev
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z18calculateSpaceTimeP10spacePointii
.LCPI14_0:
	.long	0x3089705f                      # float 9.99999971E-10
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI14_1:
	.quad	0x3fa999999999999a              # double 0.050000000000000003
.LCPI14_2:
	.quad	0x3ff0000000000000              # double 1
	.text
	.globl	_Z18calculateSpaceTimeP10spacePointii
	.type	_Z18calculateSpaceTimeP10spacePointii,@function
_Z18calculateSpaceTimeP10spacePointii:  # @_Z18calculateSpaceTimeP10spacePointii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, 12(%rsp)                  # 4-byte Spill
	movl	%esi, 8(%rsp)                   # 4-byte Spill
	testl	%esi, %esi
	jle	.LBB14_7
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdi, %r14
	movl	8(%rsp), %ecx                   # 4-byte Reload
	cvtsi2ss	%ecx, %xmm0
	movss	%xmm0, 28(%rsp)                 # 4-byte Spill
	movl	12(%rsp), %eax                  # 4-byte Reload
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, 32(%rsp)                 # 4-byte Spill
	movl	%ecx, %ecx
	movq	%rcx, 48(%rsp)                  # 8-byte Spill
	movl	%eax, %r12d
	xorl	%eax, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	xorps	%xmm2, %xmm2
	movss	.LCPI14_0(%rip), %xmm3          # xmm3 = mem[0],zero,zero,zero
	movsd	.LCPI14_1(%rip), %xmm1          # xmm1 = mem[0],zero
.LBB14_2:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB14_4 Depth 2
                                        #       Child Loop BB14_9 Depth 3
	cmpl	$0, 12(%rsp)                    # 4-byte Folded Reload
	jle	.LBB14_6
# %bb.3:                                # %.lr.ph46
                                        #   in Loop: Header=BB14_2 Depth=1
	movq	16(%rsp), %r13                  # 8-byte Reload
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r13d, %xmm0
	divss	28(%rsp), %xmm0                 # 4-byte Folded Reload
	movss	%xmm0, 36(%rsp)                 # 4-byte Spill
                                        # kill: def $r13d killed $r13d killed $r13 def $r13
	imull	8(%rsp), %r13d                  # 4-byte Folded Reload
	movl	nBlackHoles(%rip), %eax
	xorl	%r15d, %r15d
.LBB14_4:                               #   Parent Loop BB14_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB14_9 Depth 3
	movss	right(%rip), %xmm5              # xmm5 = mem[0],zero,zero,zero
	movss	left(%rip), %xmm0               # xmm0 = mem[0],zero,zero,zero
	subss	%xmm0, %xmm5
	mulss	36(%rsp), %xmm5                 # 4-byte Folded Reload
	xorps	%xmm4, %xmm4
	cvtsi2ss	%r15d, %xmm4
	addss	%xmm0, %xmm5
	divss	32(%rsp), %xmm4                 # 4-byte Folded Reload
	movss	top(%rip), %xmm6                # xmm6 = mem[0],zero,zero,zero
	movss	bottom(%rip), %xmm0             # xmm0 = mem[0],zero,zero,zero
	subss	%xmm0, %xmm6
	mulss	%xmm4, %xmm6
	addss	%xmm0, %xmm6
	xorps	%xmm0, %xmm0
	testl	%eax, %eax
	jle	.LBB14_5
# %bb.8:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB14_4 Depth=2
	movq	blackHoles(%rip), %rcx
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	movss	%xmm5, 44(%rsp)                 # 4-byte Spill
	movss	%xmm6, 40(%rsp)                 # 4-byte Spill
.LBB14_9:                               # %.lr.ph
                                        #   Parent Loop BB14_2 Depth=1
                                        #     Parent Loop BB14_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movaps	%xmm5, %xmm0
	subss	(%rcx,%rbx), %xmm0
	movaps	%xmm6, %xmm4
	subss	4(%rcx,%rbx), %xmm4
	mulss	%xmm0, %xmm0
	mulss	%xmm4, %xmm4
	addss	%xmm0, %xmm4
	xorps	%xmm0, %xmm0
	sqrtss	%xmm4, %xmm0
	movaps	%xmm0, %xmm4
	cmpeqss	%xmm2, %xmm4
	movaps	%xmm4, %xmm2
	andnps	%xmm0, %xmm2
	andps	%xmm3, %xmm4
	orps	%xmm2, %xmm4
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm4, %xmm0
	callq	pow
	movss	40(%rsp), %xmm6                 # 4-byte Reload
                                        # xmm6 = mem[0],zero,zero,zero
	movss	44(%rsp), %xmm5                 # 4-byte Reload
                                        # xmm5 = mem[0],zero,zero,zero
	movsd	.LCPI14_2(%rip), %xmm4          # xmm4 = mem[0],zero
	movsd	.LCPI14_1(%rip), %xmm1          # xmm1 = mem[0],zero
	movss	.LCPI14_0(%rip), %xmm3          # xmm3 = mem[0],zero,zero,zero
	xorps	%xmm2, %xmm2
	divsd	%xmm0, %xmm4
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm4, %xmm0
	movq	blackHoles(%rip), %rcx
	mulss	8(%rcx,%rbx), %xmm0
	movss	4(%rsp), %xmm4                  # 4-byte Reload
                                        # xmm4 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm4
	movss	%xmm4, 4(%rsp)                  # 4-byte Spill
	movss	4(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	incq	%rbp
	movslq	nBlackHoles(%rip), %rax
	addq	$12, %rbx
	cmpq	%rax, %rbp
	jl	.LBB14_9
.LBB14_5:                               # %._crit_edge
                                        #   in Loop: Header=BB14_4 Depth=2
	leaq	(%r15,%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movss	%xmm5, (%r14,%rcx,4)
	movss	%xmm6, 4(%r14,%rcx,4)
	movss	%xmm0, 8(%r14,%rcx,4)
	incq	%r15
	cmpq	%r12, %r15
	jne	.LBB14_4
.LBB14_6:                               # %._crit_edge47
                                        #   in Loop: Header=BB14_2 Depth=1
	movq	16(%rsp), %rcx                  # 8-byte Reload
	incq	%rcx
	movq	%rcx, %rax
	movq	%rcx, 16(%rsp)                  # 8-byte Spill
	cmpq	48(%rsp), %rcx                  # 8-byte Folded Reload
	jne	.LBB14_2
.LBB14_7:                               # %._crit_edge49
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end14:
	.size	_Z18calculateSpaceTimeP10spacePointii, .Lfunc_end14-_Z18calculateSpaceTimeP10spacePointii
	.cfi_endproc
                                        # -- End function
	.globl	_Z13freeAsteroidsv              # -- Begin function _Z13freeAsteroidsv
	.type	_Z13freeAsteroidsv,@function
_Z13freeAsteroidsv:                     # @_Z13freeAsteroidsv
	.cfi_startproc
# %bb.0:
	movq	asteroids(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB15_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	hipFree
	movq	$0, asteroids(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB15_2:
	retq
.Lfunc_end15:
	.size	_Z13freeAsteroidsv, .Lfunc_end15-_Z13freeAsteroidsv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z13initAsteroidsv
.LCPI16_0:
	.long	0x30000000                      # float 4.65661287E-10
	.text
	.globl	_Z13initAsteroidsv
	.type	_Z13initAsteroidsv,@function
_Z13initAsteroidsv:                     # @_Z13initAsteroidsv
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	asteroids(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB16_2
# %bb.1:
	callq	hipFree
	movq	$0, asteroids(%rip)
.LBB16_2:                               # %_Z13freeAsteroidsv.exit
	movl	nAsteroids(%rip), %eax
	shll	$4, %eax
	movl	%eax, astSize(%rip)
	movslq	%eax, %rsi
	movl	$asteroids, %edi
	movl	$1, %edx
	callq	hipMallocManaged
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	movq	asteroids(%rip), %rdi
	movslq	astSize(%rip), %rdx
	xorl	%esi, %esi
	callq	memset@PLT
	cmpl	$0, nAsteroids(%rip)
	jle	.LBB16_5
# %bb.3:                                # %.lr.ph.preheader
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
.LBB16_4:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	left(%rip), %xmm0               # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movss	right(%rip), %xmm0              # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	.LCPI16_0(%rip), %xmm1          # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	movss	(%rsp), %xmm1                   # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movss	4(%rsp), %xmm2                  # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm1
	mulss	%xmm0, %xmm1
	addss	%xmm2, %xmm1
	movq	asteroids(%rip), %rax
	movss	%xmm1, (%rax,%rbx)
	movss	bottom(%rip), %xmm0             # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movss	top(%rip), %xmm0                # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI16_0(%rip), %xmm0
	movss	(%rsp), %xmm1                   # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movss	4(%rsp), %xmm2                  # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm1
	mulss	%xmm0, %xmm1
	addss	%xmm2, %xmm1
	movq	asteroids(%rip), %rax
	movss	%xmm1, 4(%rax,%rbx)
	incq	%r14
	movslq	nAsteroids(%rip), %rax
	addq	$16, %rbx
	cmpq	%rax, %r14
	jl	.LBB16_4
.LBB16_5:                               # %._crit_edge
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end16:
	.size	_Z13initAsteroidsv, .Lfunc_end16-_Z13initAsteroidsv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z18calculateAsteroidsP8asteroidiP9blackHoleif
.LCPI17_0:
	.long	0x3f800000                      # float 1
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI17_1:
	.quad	0x3f847ae147ae147b              # double 0.01
	.text
	.globl	_Z18calculateAsteroidsP8asteroidiP9blackHoleif
	.type	_Z18calculateAsteroidsP8asteroidiP9blackHoleif,@function
_Z18calculateAsteroidsP8asteroidiP9blackHoleif: # @_Z18calculateAsteroidsP8asteroidiP9blackHoleif
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB17_8
# %bb.1:                                # %.preheader.lr.ph
	movl	%esi, %eax
	movl	%ecx, %esi
	shlq	$2, %rsi
	leaq	(%rsi,%rsi,2), %rsi
	xorl	%r8d, %r8d
	xorps	%xmm1, %xmm1
	movss	.LCPI17_0(%rip), %xmm2          # xmm2 = mem[0],zero,zero,zero
	movsd	.LCPI17_1(%rip), %xmm3          # xmm3 = mem[0],zero
.LBB17_2:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB17_4 Depth 2
	movq	%r8, %r9
	shlq	$4, %r9
	movss	(%rdi,%r9), %xmm5               # xmm5 = mem[0],zero,zero,zero
	movss	4(%rdi,%r9), %xmm4              # xmm4 = mem[0],zero,zero,zero
	xorps	%xmm6, %xmm6
	xorps	%xmm7, %xmm7
	testl	%ecx, %ecx
	jle	.LBB17_7
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB17_2 Depth=1
	xorl	%r10d, %r10d
.LBB17_4:                               # %.lr.ph
                                        #   Parent Loop BB17_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movaps	%xmm5, %xmm8
	subss	(%rdx,%r10), %xmm8
	ucomiss	%xmm1, %xmm8
	jne	.LBB17_5
	jnp	.LBB17_7
.LBB17_5:                               # %.lr.ph
                                        #   in Loop: Header=BB17_4 Depth=2
	movaps	%xmm4, %xmm9
	subss	4(%rdx,%r10), %xmm9
	ucomiss	%xmm1, %xmm9
	jne	.LBB17_6
	jnp	.LBB17_7
.LBB17_6:                               #   in Loop: Header=BB17_4 Depth=2
	movaps	%xmm8, %xmm10
	mulss	%xmm8, %xmm10
	movaps	%xmm9, %xmm11
	mulss	%xmm9, %xmm11
	addss	%xmm10, %xmm11
	mulss	%xmm11, %xmm11
	xorps	%xmm10, %xmm10
	sqrtss	%xmm11, %xmm10
	movaps	%xmm2, %xmm11
	divss	%xmm10, %xmm11
	mulss	%xmm11, %xmm8
	addss	%xmm8, %xmm7
	mulss	%xmm9, %xmm11
	addss	%xmm11, %xmm6
	addq	$12, %r10
	cmpq	%r10, %rsi
	jne	.LBB17_4
.LBB17_7:                               # %._crit_edge
                                        #   in Loop: Header=BB17_2 Depth=1
	movaps	%xmm7, %xmm8
	mulss	%xmm7, %xmm8
	movaps	%xmm6, %xmm9
	mulss	%xmm6, %xmm9
	addss	%xmm8, %xmm9
	xorps	%xmm8, %xmm8
	sqrtss	%xmm9, %xmm8
	divss	%xmm8, %xmm7
	mulss	%xmm0, %xmm7
	movss	8(%rdi,%r9), %xmm9              # xmm9 = mem[0],zero,zero,zero
	subss	%xmm7, %xmm9
	movss	12(%rdi,%r9), %xmm7             # xmm7 = mem[0],zero,zero,zero
	movss	%xmm9, 8(%rdi,%r9)
	divss	%xmm8, %xmm6
	mulss	%xmm0, %xmm6
	subss	%xmm6, %xmm7
	movss	%xmm7, 12(%rdi,%r9)
	xorps	%xmm6, %xmm6
	cvtss2sd	%xmm9, %xmm6
	mulsd	%xmm3, %xmm6
	cvtss2sd	%xmm5, %xmm5
	addsd	%xmm6, %xmm5
	cvtsd2ss	%xmm5, %xmm5
	xorps	%xmm6, %xmm6
	cvtss2sd	%xmm7, %xmm6
	mulsd	%xmm3, %xmm6
	cvtss2sd	%xmm4, %xmm4
	addsd	%xmm6, %xmm4
	cvtsd2ss	%xmm4, %xmm4
	movss	%xmm5, (%rdi,%r9)
	movss	%xmm4, 4(%rdi,%r9)
	incq	%r8
	cmpq	%rax, %r8
	jne	.LBB17_2
.LBB17_8:                               # %._crit_edge74
	retq
.Lfunc_end17:
	.size	_Z18calculateAsteroidsP8asteroidiP9blackHoleif, .Lfunc_end17-_Z18calculateAsteroidsP8asteroidiP9blackHoleif
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z16runSimulationCPUv
.LCPI18_0:
	.long	0x30000000                      # float 4.65661287E-10
.LCPI18_1:
	.long	0x41100000                      # float 9
.LCPI18_2:
	.long	0x3f800000                      # float 1
.LCPI18_3:
	.long	0x3d4ccccd                      # float 0.0500000007
	.text
	.globl	_Z16runSimulationCPUv
	.type	_Z16runSimulationCPUv,@function
_Z16runSimulationCPUv:                  # @_Z16runSimulationCPUv
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.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	$.Lstr, %edi
	callq	puts@PLT
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	movl	nelems(%rip), %ecx
	xorl	%r12d, %r12d
	movl	$.L.str.30, %edi
	xorl	%eax, %eax
	callq	printf
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rbp
	movabsq	$-2361183241434822607, %rax     # imm = 0xDF3B645A1CAC0831
	imulq	8(%rbx)
	movq	%rdx, %r14
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %r14
	addq	%rax, %r14
	callq	_Z13initSpaceTimev
	callq	_Z13initAsteroidsv
	movabsq	$2361183241434822607, %r15      # imm = 0x20C49BA5E353F7CF
.LBB18_1:                               # =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	imulq	$1000, 8(%rsp), %rcx            # imm = 0x3E8
	movq	%r15, %rax
	imulq	16(%rsp)
	movq	%rdx, %r13
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %r13
	addq	%rax, %r13
	addq	%rcx, %r13
	movq	blackHoles(%rip), %rdx
	testq	%rdx, %rdx
	je	.LBB18_3
# %bb.2:                                #   in Loop: Header=BB18_1 Depth=1
	movq	%r13, %rax
	subq	%r12, %rax
	cmpq	$21000, %rax                    # imm = 0x5208
	jl	.LBB18_4
.LBB18_3:                               #   in Loop: Header=BB18_1 Depth=1
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI18_0(%rip), %xmm0
	mulss	.LCPI18_1(%rip), %xmm0
	addss	.LCPI18_2(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	movl	%eax, nBlackHoles(%rip)
	callq	_Z14initBlackHolesv
	movq	SPBox(%rip), %rdi
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	callq	_Z18calculateSpaceTimeP10spacePointii
	movq	SPBox(%rip), %rdi
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	callq	_Z15spaceTimeToFileP10spacePointii
	movq	blackHoles(%rip), %rdx
	movq	%r13, %r12
.LBB18_4:                               #   in Loop: Header=BB18_1 Depth=1
	movq	asteroids(%rip), %rdi
	movl	nAsteroids(%rip), %esi
	movl	nBlackHoles(%rip), %ecx
	movss	.LCPI18_3(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	callq	_Z18calculateAsteroidsP8asteroidiP9blackHoleif
	movq	asteroids(%rip), %rdi
	movl	nAsteroids(%rip), %esi
	callq	_Z15asteroidsToFileP8asteroidi
	movq	$0, 8(%rsp)
	movq	$250000000, 16(%rsp)            # imm = 0xEE6B280
	movq	%rbx, %rdi
	leaq	24(%rsp), %rsi
	callq	nanosleep
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	8(%rsp), %rcx
	subq	%rbp, %rcx
	movq	%r15, %rax
	imulq	16(%rsp)
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$7, %rdx
	addq	%rdx, %rsi
	addq	%r14, %rsi
	imulq	$1000, %rcx, %rax               # imm = 0x3E8
	addq	%rsi, %rax
	imulq	%r15
	movq	%rdx, %rax
	shrq	$63, %rax
	shrq	$7, %rdx
	addl	%eax, %edx
	cmpl	$360, %edx                      # imm = 0x168
	jl	.LBB18_1
# %bb.5:
	movq	asteroids(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB18_7
# %bb.6:
	callq	hipFree
	movq	$0, asteroids(%rip)
.LBB18_7:                               # %_Z13freeAsteroidsv.exit
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end18:
	.size	_Z16runSimulationCPUv, .Lfunc_end18-_Z16runSimulationCPUv
	.cfi_endproc
                                        # -- End function
	.globl	_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei # -- Begin function _Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.type	_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei,@function
_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei: # @_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.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	$176, %rsp
	.cfi_def_cfa_offset 224
	.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	28(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	24(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	20(%rsp), %rdx
	movss	%xmm0, (%rdx)
	leaq	16(%rsp), %r9
	movss	%xmm1, (%r9)
	leaq	12(%rsp), %r10
	movss	%xmm2, (%r10)
	leaq	8(%rsp), %r11
	movss	%xmm3, (%r11)
	leaq	48(%rsp), %r14
	movq	%rcx, (%r14)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%r9, 32(%rbx)
	movq	%r10, 40(%rbx)
	movq	%r11, 48(%rbx)
	movq	%r14, 56(%rbx)
	movq	%rcx, 64(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%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	$_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$192, %rsp
	.cfi_adjust_cfa_offset -192
	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_end19:
	.size	_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei, .Lfunc_end19-_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.cfi_endproc
                                        # -- End function
	.globl	_Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii # -- Begin function _Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.type	_Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii,@function
_Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii: # @_Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.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	$176, %rsp
	.cfi_def_cfa_offset 224
	.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	28(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	24(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	20(%rsp), %rdx
	movss	%xmm0, (%rdx)
	leaq	16(%rsp), %r10
	movss	%xmm1, (%r10)
	leaq	12(%rsp), %r11
	movss	%xmm2, (%r11)
	leaq	8(%rsp), %r14
	movss	%xmm3, (%r14)
	leaq	48(%rsp), %r15
	movq	%rcx, (%r15)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	movq	%rsp, %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%r10, 32(%rbx)
	movq	%r11, 40(%rbx)
	movq	%r14, 48(%rbx)
	movq	%r15, 56(%rbx)
	movq	%rcx, 64(%rbx)
	movq	%r8, 72(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%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	$_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$192, %rsp
	.cfi_adjust_cfa_offset -192
	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_end20:
	.size	_Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii, .Lfunc_end20-_Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.cfi_endproc
                                        # -- End function
	.globl	_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif # -- Begin function _Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif
	.type	_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif,@function
_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif: # @_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.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	12(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	32(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	4(%rsp), %rcx
	movss	%xmm0, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z19calculateAsteroidsKP8asteroidiP9blackHoleif, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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_end21:
	.size	_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif, .Lfunc_end21-_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif
	.cfi_endproc
                                        # -- End function
	.globl	_Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi # -- Begin function _Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.type	_Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi,@function
_Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi: # @_Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.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	12(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	32(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	4(%rsp), %rcx
	movss	%xmm0, (%rcx)
	movq	%rsp, %r9
	movl	%r8d, (%r9)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r9, 40(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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_end22:
	.size	_Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi, .Lfunc_end22-_Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z16runSimulationGPUv
.LCPI23_0:
	.long	0x3a800000                      # float 9.765625E-4
.LCPI23_1:
	.long	0x3f800000                      # float 1
.LCPI23_2:
	.long	0x3d000000                      # float 0.03125
.LCPI23_3:
	.long	0x42000000                      # float 32
.LCPI23_4:
	.long	0x30000000                      # float 4.65661287E-10
.LCPI23_5:
	.long	0x41100000                      # float 9
.LCPI23_6:
	.long	0x3d4ccccd                      # float 0.0500000007
	.text
	.globl	_Z16runSimulationGPUv
	.type	_Z16runSimulationGPUv,@function
_Z16runSimulationGPUv:                  # @_Z16runSimulationGPUv
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$4294968320, %r12               # imm = 0x100000400
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	xorl	%ebx, %ebx
	leaq	8(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r14), %rax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movabsq	$-2361183241434822607, %rax     # imm = 0xDF3B645A1CAC0831
	imulq	8(%r14)
	movq	%rdx, %r15
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %r15
	addq	%rax, %r15
	callq	_Z13initSpaceTimev
	callq	_Z13initAsteroidsv
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	movl	nelems(%rip), %ecx
	movl	$.L.str.30, %edi
	xorl	%eax, %eax
	callq	printf
	movl	rows(%rip), %eax
	shrl	$5, %eax
	movl	cols(%rip), %ecx
	shrl	$5, %ecx
	incl	%ecx
	cvtsi2ssl	nAsteroids(%rip), %xmm0
	shlq	$32, %rcx
	addq	%rcx, %rax
	incq	%rax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	mulss	.LCPI23_0(%rip), %xmm0
	addss	.LCPI23_1(%rip), %xmm0
	mulss	.LCPI23_2(%rip), %xmm0
	callq	ceilf@PLT
	mulss	.LCPI23_3(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	leaq	(%rax,%r12), %r13
	addq	$-1024, %r13                    # imm = 0xFC00
	movabsq	$2361183241434822607, %rbp      # imm = 0x20C49BA5E353F7CF
.LBB23_1:                               # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	imulq	$1000, 8(%rsp), %rcx            # imm = 0x3E8
	movq	%rbp, %rax
	imulq	16(%rsp)
	movq	%rdx, %r12
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %r12
	addq	%rax, %r12
	addq	%rcx, %r12
	cmpq	$0, blackHoles(%rip)
	je	.LBB23_3
# %bb.2:                                #   in Loop: Header=BB23_1 Depth=1
	movq	%r12, %rax
	subq	%rbx, %rax
	cmpq	$21000, %rax                    # imm = 0x5208
	jl	.LBB23_8
.LBB23_3:                               #   in Loop: Header=BB23_1 Depth=1
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI23_4(%rip), %xmm0
	mulss	.LCPI23_5(%rip), %xmm0
	addss	.LCPI23_1(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	movl	%eax, nBlackHoles(%rip)
	callq	_Z14initBlackHolesv
	movq	24(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB23_5
# %bb.4:                                #   in Loop: Header=BB23_1 Depth=1
	movq	SPBox(%rip), %rdi
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	movss	left(%rip), %xmm0               # xmm0 = mem[0],zero,zero,zero
	movss	right(%rip), %xmm1              # xmm1 = mem[0],zero,zero,zero
	movss	top(%rip), %xmm2                # xmm2 = mem[0],zero,zero,zero
	movss	bottom(%rip), %xmm3             # xmm3 = mem[0],zero,zero,zero
	movq	blackHoles(%rip), %rcx
	movl	nBlackHoles(%rip), %r8d
	callq	_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei
.LBB23_5:                               #   in Loop: Header=BB23_1 Depth=1
	callq	hipGetLastError
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	movq	%r13, %rdi
	movl	$1, %esi
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB23_7
# %bb.6:                                #   in Loop: Header=BB23_1 Depth=1
	movq	asteroids(%rip), %rdi
	movl	nAsteroids(%rip), %esi
	movq	blackHoles(%rip), %rdx
	movl	nBlackHoles(%rip), %ecx
	movss	.LCPI23_6(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	callq	_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif
.LBB23_7:                               #   in Loop: Header=BB23_1 Depth=1
	callq	hipGetLastError
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	callq	hipDeviceSynchronize
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	movq	SPBox(%rip), %rdi
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	callq	_Z15spaceTimeToFileP10spacePointii
	movq	%r12, %rbx
.LBB23_8:                               #   in Loop: Header=BB23_1 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB23_10
# %bb.9:                                #   in Loop: Header=BB23_1 Depth=1
	movq	asteroids(%rip), %rdi
	movl	nAsteroids(%rip), %esi
	movq	blackHoles(%rip), %rdx
	movl	nBlackHoles(%rip), %ecx
	movss	.LCPI23_6(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	callq	_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif
.LBB23_10:                              #   in Loop: Header=BB23_1 Depth=1
	callq	hipGetLastError
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	callq	hipDeviceSynchronize
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	movq	asteroids(%rip), %rdi
	movl	nAsteroids(%rip), %esi
	callq	_Z15asteroidsToFileP8asteroidi
	movq	$0, 8(%rsp)
	movq	$250000000, 16(%rsp)            # imm = 0xEE6B280
	movq	%r14, %rdi
	leaq	40(%rsp), %rsi
	callq	nanosleep
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	8(%rsp), %rcx
	subq	32(%rsp), %rcx                  # 8-byte Folded Reload
	movq	%rbp, %rax
	imulq	16(%rsp)
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$7, %rdx
	addq	%rdx, %rsi
	addq	%r15, %rsi
	imulq	$1000, %rcx, %rax               # imm = 0x3E8
	addq	%rsi, %rax
	imulq	%rbp
	movq	%rdx, %rax
	shrq	$63, %rax
	shrq	$7, %rdx
	addl	%eax, %edx
	cmpl	$360, %edx                      # imm = 0x168
	jl	.LBB23_1
# %bb.11:
	movq	asteroids(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB23_13
# %bb.12:
	callq	hipFree
	movq	$0, asteroids(%rip)
.LBB23_13:                              # %_Z13freeAsteroidsv.exit
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end23:
	.size	_Z16runSimulationGPUv, .Lfunc_end23-_Z16runSimulationGPUv
	.cfi_endproc
                                        # -- End function
	.globl	_Z15recordBenchmarkiPciiili     # -- Begin function _Z15recordBenchmarkiPciiili
	.type	_Z15recordBenchmarkiPciiili,@function
_Z15recordBenchmarkiPciiili:            # @_Z15recordBenchmarkiPciiili
	.cfi_startproc
# %bb.0:
	cmpl	$127, %edi
	jg	.LBB24_2
# %bb.1:
	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
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, %rbx
	movl	%r8d, %ebp
	movl	%ecx, %r14d
	movl	%edx, %r15d
	movl	64(%rsp), %r13d
	movslq	%edi, %rax
	imulq	$1056, %rax, %rax               # imm = 0x420
	leaq	BENCHS(%rax), %r12
	movq	%r12, %rdi
	callq	strcpy
	movl	%r15d, 1024(%r12)
	movl	%r14d, 1032(%r12)
	movl	%ebp, 1028(%r12)
	movq	%rbx, 1040(%r12)
	movl	%r13d, 1048(%r12)
	addq	$8, %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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB24_2:
	retq
.Lfunc_end24:
	.size	_Z15recordBenchmarkiPciiili, .Lfunc_end24-_Z15recordBenchmarkiPciiili
	.cfi_endproc
                                        # -- End function
	.globl	_Z16accessSPBenchCPUP10spacePointii # -- Begin function _Z16accessSPBenchCPUP10spacePointii
	.type	_Z16accessSPBenchCPUP10spacePointii,@function
_Z16accessSPBenchCPUP10spacePointii:    # @_Z16accessSPBenchCPUP10spacePointii
	.cfi_startproc
# %bb.0:                                # %._crit_edge
	retq
.Lfunc_end25:
	.size	_Z16accessSPBenchCPUP10spacePointii, .Lfunc_end25-_Z16accessSPBenchCPUP10spacePointii
	.cfi_endproc
                                        # -- End function
	.globl	_Z16accessBHBenchCPUv           # -- Begin function _Z16accessBHBenchCPUv
	.type	_Z16accessBHBenchCPUv,@function
_Z16accessBHBenchCPUv:                  # @_Z16accessBHBenchCPUv
	.cfi_startproc
# %bb.0:
	retq
.Lfunc_end26:
	.size	_Z16accessBHBenchCPUv, .Lfunc_end26-_Z16accessBHBenchCPUv
	.cfi_endproc
                                        # -- End function
	.globl	_Z17accessAstBenchCPUP8asteroidi # -- Begin function _Z17accessAstBenchCPUP8asteroidi
	.type	_Z17accessAstBenchCPUP8asteroidi,@function
_Z17accessAstBenchCPUP8asteroidi:       # @_Z17accessAstBenchCPUP8asteroidi
	.cfi_startproc
# %bb.0:
	retq
.Lfunc_end27:
	.size	_Z17accessAstBenchCPUP8asteroidi, .Lfunc_end27-_Z17accessAstBenchCPUP8asteroidi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z15runBenchMarkCPUv
.LCPI28_0:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI28_1:
	.long	0x3d4ccccd                      # float 0.0500000007
	.text
	.globl	_Z15runBenchMarkCPUv
	.type	_Z15runBenchMarkCPUv,@function
_Z15runBenchMarkCPUv:                   # @_Z15runBenchMarkCPUv
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	benchNum(%rip), %esi
	movl	benchConfig(%rip), %ecx
	xorl	%ebx, %ebx
	movl	$.L.str.32, %edi
	movl	%ecx, %edx
	xorl	%eax, %eax
	callq	printf
	cvtss2sd	top(%rip), %xmm0
	cvtss2sd	bottom(%rip), %xmm1
	cvtss2sd	left(%rip), %xmm2
	cvtss2sd	right(%rip), %xmm3
	movl	$.L.str.33, %edi
	movb	$4, %al
	callq	printf
	xorps	%xmm0, %xmm0
	cvtss2sd	spStep(%rip), %xmm0
	movl	nBlackHoles(%rip), %esi
	movl	nAsteroids(%rip), %edx
	movl	$.L.str.34, %edi
	movb	$1, %al
	callq	printf
	movss	right(%rip), %xmm0              # xmm0 = mem[0],zero,zero,zero
	subss	left(%rip), %xmm0
	movaps	.LCPI28_0(%rip), %xmm1          # xmm1 = [NaN,NaN,NaN,NaN]
	andps	%xmm1, %xmm0
	movss	spStep(%rip), %xmm2             # xmm2 = mem[0],zero,zero,zero
	divss	%xmm2, %xmm0
	cvttss2si	%xmm0, %esi
	movss	top(%rip), %xmm0                # xmm0 = mem[0],zero,zero,zero
	subss	bottom(%rip), %xmm0
	andps	%xmm1, %xmm0
	divss	%xmm2, %xmm0
	cvttss2si	%xmm0, %edx
	movl	$.L.str.35, %edi
	xorl	%eax, %eax
	callq	printf
	movq	stdout(%rip), %rdi
	callq	fflush
	callq	_Z13initSpaceTimev
	callq	_Z13initAsteroidsv
	callq	_Z14initBlackHolesv
	leaq	8(%rsp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movabsq	$-2361183241434822607, %rax     # imm = 0xDF3B645A1CAC0831
	imulq	8(%r15)
	movq	%rdx, %r14
	imulq	$-1000, (%r15), %rax            # imm = 0xFC18
	movq	%rdx, %rcx
	shrq	$63, %rcx
	sarq	$7, %r14
	addq	%rcx, %r14
	addq	%rax, %r14
	leaq	8(%rsp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	imulq	$1000, (%r15), %rcx             # imm = 0x3E8
	movabsq	$2361183241434822607, %rax      # imm = 0x20C49BA5E353F7CF
	imulq	8(%r15)
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rdx
	addq	%rax, %rdx
	addq	%rcx, %rdx
	addq	%r14, %rdx
	cmpq	$9999, %rdx                     # imm = 0x270F
	jg	.LBB28_5
# %bb.1:                                # %.lr.ph.preheader
	xorl	%ebx, %ebx
	leaq	8(%rsp), %r15
	movabsq	$2361183241434822607, %r12      # imm = 0x20C49BA5E353F7CF
.LBB28_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	%ebx, %eax
	cltd
	idivl	bechmarkRegenBHSteps(%rip)
	testl	%edx, %edx
	jne	.LBB28_4
# %bb.3:                                #   in Loop: Header=BB28_2 Depth=1
	callq	_Z14initBlackHolesv
.LBB28_4:                               #   in Loop: Header=BB28_2 Depth=1
	movq	SPBox(%rip), %rdi
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	callq	_Z18calculateSpaceTimeP10spacePointii
	movq	asteroids(%rip), %rdi
	movl	nAsteroids(%rip), %esi
	movq	blackHoles(%rip), %rdx
	movl	nBlackHoles(%rip), %ecx
	movss	.LCPI28_1(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	callq	_Z18calculateAsteroidsP8asteroidiP9blackHoleif
	incl	%ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	imulq	$1000, 8(%rsp), %rcx            # imm = 0x3E8
	movq	%r12, %rax
	imulq	16(%rsp)
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rdx
	addq	%rax, %rdx
	addq	%r14, %rcx
	addq	%rdx, %rcx
	cmpq	$10000, %rcx                    # imm = 0x2710
	jl	.LBB28_2
.LBB28_5:                               # %._crit_edge
	leaq	8(%rsp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movabsq	$2361183241434822607, %r15      # imm = 0x20C49BA5E353F7CF
	movq	%r15, %rax
	imulq	8(%r12)
	movq	%rdx, %r13
	imulq	$1000, (%r12), %r12             # imm = 0x3E8
	movq	%rdx, %rbp
	shrq	$63, %rbp
	sarq	$7, %r13
	movq	SPBox(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB28_7
# %bb.6:
	callq	hipFree
	movq	$0, SPBox(%rip)
.LBB28_7:                               # %_Z13freeSpaceTimev.exit
	addq	%rbp, %r13
	movq	asteroids(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB28_9
# %bb.8:
	callq	hipFree
	movq	$0, asteroids(%rip)
.LBB28_9:                               # %_Z13freeAsteroidsv.exit
	addq	%r13, %r12
	movq	blackHoles(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB28_11
# %bb.10:
	callq	hipFree
	movq	$0, blackHoles(%rip)
.LBB28_11:                              # %_Z14freeBlackHolesv.exit
	addq	%r14, %r12
	movl	benchNum(%rip), %edx
	movl	benchConfig(%rip), %ecx
	movl	$benchName, %edi
	movl	$.L.str.36, %esi
	xorl	%eax, %eax
	callq	sprintf
	movslq	nBenchmark(%rip), %r14
	cmpq	$127, %r14
	jg	.LBB28_13
# %bb.12:
	movl	benchConfig(%rip), %eax
	movl	%eax, 4(%rsp)                   # 4-byte Spill
	movl	benchType(%rip), %r15d
	movl	benchNum(%rip), %ebp
	imulq	$1056, %r14, %rax               # imm = 0x420
	leaq	BENCHS(%rax), %r13
	movl	$benchName, %esi
	movq	%r13, %rdi
	callq	strcpy
	movl	%ebp, 1024(%r13)
	movl	%r15d, 1032(%r13)
	movabsq	$2361183241434822607, %r15      # imm = 0x20C49BA5E353F7CF
	movl	4(%rsp), %eax                   # 4-byte Reload
	movl	%eax, 1028(%r13)
	movq	%r12, 1040(%r13)
	movl	%ebx, 1048(%r13)
.LBB28_13:                              # %_Z15recordBenchmarkiPciiili.exit
	movl	$.L.str.37, %edi
	movl	%r14d, %esi
	movq	%r12, %rdx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	printf
	movl	%ebx, %ecx
	movq	%r12, %rax
	imulq	%r15
	movq	%rdx, %rsi
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rsi
	addq	%rax, %rsi
	movq	%rcx, %rax
	xorl	%edx, %edx
	idivq	%rsi
	movl	$.L.str.38, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.Lfunc_end28:
	.size	_Z15runBenchMarkCPUv, .Lfunc_end28-_Z15runBenchMarkCPUv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z15runBenchMarkGPUv
.LCPI29_0:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI29_1:
	.long	0x3a800000                      # float 9.765625E-4
.LCPI29_2:
	.long	0x3f800000                      # float 1
.LCPI29_3:
	.long	0x3d4ccccd                      # float 0.0500000007
	.text
	.globl	_Z15runBenchMarkGPUv
	.type	_Z15runBenchMarkGPUv,@function
_Z15runBenchMarkGPUv:                   # @_Z15runBenchMarkGPUv
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$1512, %rsp                     # imm = 0x5E8
	.cfi_def_cfa_offset 1568
	.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	benchNum(%rip), %esi
	movl	benchConfig(%rip), %ecx
	xorl	%ebx, %ebx
	movl	$.L.str.39, %edi
	movl	%ecx, %edx
	xorl	%eax, %eax
	callq	printf
	cvtss2sd	top(%rip), %xmm0
	cvtss2sd	bottom(%rip), %xmm1
	cvtss2sd	left(%rip), %xmm2
	cvtss2sd	right(%rip), %xmm3
	movl	$.L.str.33, %edi
	movb	$4, %al
	callq	printf
	xorps	%xmm0, %xmm0
	cvtss2sd	spStep(%rip), %xmm0
	movl	nBlackHoles(%rip), %esi
	movl	nAsteroids(%rip), %edx
	movl	$.L.str.40, %edi
	movb	$1, %al
	callq	printf
	movss	right(%rip), %xmm0              # xmm0 = mem[0],zero,zero,zero
	subss	left(%rip), %xmm0
	movaps	.LCPI29_0(%rip), %xmm1          # xmm1 = [NaN,NaN,NaN,NaN]
	andps	%xmm1, %xmm0
	movss	spStep(%rip), %xmm2             # xmm2 = mem[0],zero,zero,zero
	divss	%xmm2, %xmm0
	cvttss2si	%xmm0, %esi
	movss	top(%rip), %xmm0                # xmm0 = mem[0],zero,zero,zero
	subss	bottom(%rip), %xmm0
	andps	%xmm1, %xmm0
	divss	%xmm2, %xmm0
	cvttss2si	%xmm0, %edx
	movl	$.L.str.35, %edi
	xorl	%eax, %eax
	callq	printf
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	4(%rsp), %r14
	movq	%r14, %rdi
	callq	hipGetDevice
	movl	(%r14), %esi
	leaq	40(%rsp), %r14
	movq	%r14, %rdi
	callq	hipGetDevicePropertiesR0600
	movl	388(%r14), %eax
	movl	%eax, (%rsp)                    # 4-byte Spill
	movl	680(%r14), %r13d
	testl	%r13d, %r13d
	movl	$.L.str.42, %eax
	movl	$.L.str.43, %esi
	cmovneq	%rax, %rsi
	movl	$.L.str.41, %edi
	xorl	%eax, %eax
	callq	printf
	callq	_Z13initSpaceTimev
	callq	_Z13initAsteroidsv
	callq	_Z14initBlackHolesv
	movl	rows(%rip), %ebp
	movl	cols(%rip), %r12d
	movl	nAsteroids(%rip), %eax
	movl	%eax, 36(%rsp)                  # 4-byte Spill
	leaq	8(%rsp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movabsq	$-2361183241434822607, %rax     # imm = 0xDF3B645A1CAC0831
	imulq	8(%r15)
	movq	%rdx, %r14
	imulq	$-1000, (%r15), %rax            # imm = 0xFC18
	movq	%rdx, %rcx
	shrq	$63, %rcx
	sarq	$7, %r14
	addq	%rcx, %r14
	addq	%rax, %r14
	leaq	8(%rsp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	imulq	$1000, (%r15), %rcx             # imm = 0x3E8
	movabsq	$2361183241434822607, %rax      # imm = 0x20C49BA5E353F7CF
	imulq	8(%r15)
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rdx
	addq	%rax, %rdx
	addq	%rcx, %rdx
	addq	%r14, %rdx
	cmpq	$9999, %rdx                     # imm = 0x270F
	jg	.LBB29_33
# %bb.1:                                # %.lr.ph
	shrl	$5, %ebp
	shrl	$5, %r12d
	incl	%r12d
	shlq	$32, %r12
	leaq	(%r12,%rbp), %r15
	incq	%r15
	movabsq	$4294968320, %rbx               # imm = 0x100000400
	cvtsi2ssl	36(%rsp), %xmm0         # 4-byte Folded Reload
	mulss	.LCPI29_1(%rip), %xmm0
	addss	.LCPI29_2(%rip), %xmm0
	cvtsi2ssl	(%rsp), %xmm1           # 4-byte Folded Reload
	movss	%xmm1, (%rsp)                   # 4-byte Spill
	divss	%xmm1, %xmm0
	callq	ceilf@PLT
	mulss	(%rsp), %xmm0                   # 4-byte Folded Reload
	cvttss2si	%xmm0, %eax
	leaq	(%rax,%rbx), %rbp
	addq	$-1024, %rbp                    # imm = 0xFC00
	xorl	%ebx, %ebx
	leaq	8(%rsp), %r12
.LBB29_2:                               # =>This Inner Loop Header: Depth=1
	movl	%ebx, %eax
	cltd
	idivl	bechmarkRegenBHSteps(%rip)
	testl	%edx, %edx
	jne	.LBB29_9
# %bb.3:                                #   in Loop: Header=BB29_2 Depth=1
	callq	hipDeviceSynchronize
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	testl	%r13d, %r13d
	je	.LBB29_6
# %bb.4:                                #   in Loop: Header=BB29_2 Depth=1
	cmpl	$2, cudaOptLevel(%rip)
	jl	.LBB29_6
# %bb.5:                                #   in Loop: Header=BB29_2 Depth=1
	movq	blackHoles(%rip), %rdi
	movslq	bhSize(%rip), %rsi
	movl	$-1, %edx
	xorl	%ecx, %ecx
	callq	hipMemPrefetchAsync
.LBB29_6:                               #   in Loop: Header=BB29_2 Depth=1
	callq	_Z14initBlackHolesv
	testl	%r13d, %r13d
	je	.LBB29_9
# %bb.7:                                #   in Loop: Header=BB29_2 Depth=1
	cmpl	$2, cudaOptLevel(%rip)
	jl	.LBB29_9
# %bb.8:                                #   in Loop: Header=BB29_2 Depth=1
	movq	blackHoles(%rip), %rdi
	movslq	bhSize(%rip), %rsi
	movl	4(%rsp), %edx
	xorl	%ecx, %ecx
	callq	hipMemPrefetchAsync
.LBB29_9:                               #   in Loop: Header=BB29_2 Depth=1
	movl	%ebx, %eax
	cltd
	idivl	bechmarkRegenWriteFileSteps(%rip)
	movl	cudaOptLevel(%rip), %eax
	testl	%edx, %edx
	jne	.LBB29_16
# %bb.10:                               #   in Loop: Header=BB29_2 Depth=1
	testl	%r13d, %r13d
	je	.LBB29_13
# %bb.11:                               #   in Loop: Header=BB29_2 Depth=1
	cmpl	$2, %eax
	jl	.LBB29_13
# %bb.12:                               #   in Loop: Header=BB29_2 Depth=1
	movq	SPBox(%rip), %rdi
	movslq	spSize(%rip), %rsi
	movl	$-1, %edx
	xorl	%ecx, %ecx
	callq	hipMemPrefetchAsync
	movq	asteroids(%rip), %rdi
	movslq	astSize(%rip), %rsi
	movl	$-1, %edx
	xorl	%ecx, %ecx
	callq	hipMemPrefetchAsync
.LBB29_13:                              #   in Loop: Header=BB29_2 Depth=1
	callq	hipDeviceSynchronize
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	movl	cudaOptLevel(%rip), %eax
	testl	%r13d, %r13d
	je	.LBB29_16
# %bb.14:                               #   in Loop: Header=BB29_2 Depth=1
	cmpl	$2, %eax
	jl	.LBB29_16
# %bb.15:                               #   in Loop: Header=BB29_2 Depth=1
	movq	SPBox(%rip), %rdi
	movslq	spSize(%rip), %rsi
	movl	4(%rsp), %edx
	xorl	%ecx, %ecx
	callq	hipMemPrefetchAsync
	movq	asteroids(%rip), %rdi
	movslq	astSize(%rip), %rsi
	movl	4(%rsp), %edx
	xorl	%ecx, %ecx
	callq	hipMemPrefetchAsync
	movl	cudaOptLevel(%rip), %eax
.LBB29_16:                              # %thread-pre-split
                                        #   in Loop: Header=BB29_2 Depth=1
	testl	%eax, %eax
	jle	.LBB29_27
# %bb.17:                               #   in Loop: Header=BB29_2 Depth=1
	movq	%r12, %rdi
	callq	hipStreamCreate
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	leaq	24(%rsp), %rdi
	callq	hipStreamCreate
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	cmpl	$3, cudaOptLevel(%rip)
	jl	.LBB29_22
# %bb.18:                               #   in Loop: Header=BB29_2 Depth=1
	movslq	bhSize(%rip), %r8
	movq	8(%rsp), %r9
	movq	%r15, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB29_20
# %bb.19:                               #   in Loop: Header=BB29_2 Depth=1
	movq	SPBox(%rip), %rdi
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	movss	left(%rip), %xmm0               # xmm0 = mem[0],zero,zero,zero
	movss	right(%rip), %xmm1              # xmm1 = mem[0],zero,zero,zero
	movss	top(%rip), %xmm2                # xmm2 = mem[0],zero,zero,zero
	movss	bottom(%rip), %xmm3             # xmm3 = mem[0],zero,zero,zero
	movq	blackHoles(%rip), %rcx
	movl	nBlackHoles(%rip), %r8d
	movl	bhSize(%rip), %r9d
	callq	_Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
.LBB29_20:                              #   in Loop: Header=BB29_2 Depth=1
	movslq	bhSize(%rip), %r8
	movq	24(%rsp), %r9
	movq	%rbp, %rdi
	movl	$1, %esi
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %ecx
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB29_26
# %bb.21:                               #   in Loop: Header=BB29_2 Depth=1
	movq	asteroids(%rip), %rdi
	movl	nAsteroids(%rip), %esi
	movq	blackHoles(%rip), %rdx
	movl	nBlackHoles(%rip), %ecx
	movl	bhSize(%rip), %r8d
	movss	.LCPI29_3(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	callq	_Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	jmp	.LBB29_26
.LBB29_27:                              #   in Loop: Header=BB29_2 Depth=1
	movq	%r15, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB29_29
# %bb.28:                               #   in Loop: Header=BB29_2 Depth=1
	movq	SPBox(%rip), %rdi
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	movss	left(%rip), %xmm0               # xmm0 = mem[0],zero,zero,zero
	movss	right(%rip), %xmm1              # xmm1 = mem[0],zero,zero,zero
	movss	top(%rip), %xmm2                # xmm2 = mem[0],zero,zero,zero
	movss	bottom(%rip), %xmm3             # xmm3 = mem[0],zero,zero,zero
	movq	blackHoles(%rip), %rcx
	movl	nBlackHoles(%rip), %r8d
	callq	_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei
.LBB29_29:                              #   in Loop: Header=BB29_2 Depth=1
	callq	hipGetLastError
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	movq	%rbp, %rdi
	movl	$1, %esi
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB29_31
# %bb.30:                               #   in Loop: Header=BB29_2 Depth=1
	movq	asteroids(%rip), %rdi
	movl	nAsteroids(%rip), %esi
	movq	blackHoles(%rip), %rdx
	movl	nBlackHoles(%rip), %ecx
	movss	.LCPI29_3(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	callq	_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif
.LBB29_31:                              #   in Loop: Header=BB29_2 Depth=1
	callq	hipGetLastError
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	jmp	.LBB29_32
.LBB29_22:                              #   in Loop: Header=BB29_2 Depth=1
	movq	8(%rsp), %r9
	movq	%r15, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB29_24
# %bb.23:                               #   in Loop: Header=BB29_2 Depth=1
	movq	SPBox(%rip), %rdi
	movl	rows(%rip), %esi
	movl	cols(%rip), %edx
	movss	left(%rip), %xmm0               # xmm0 = mem[0],zero,zero,zero
	movss	right(%rip), %xmm1              # xmm1 = mem[0],zero,zero,zero
	movss	top(%rip), %xmm2                # xmm2 = mem[0],zero,zero,zero
	movss	bottom(%rip), %xmm3             # xmm3 = mem[0],zero,zero,zero
	movq	blackHoles(%rip), %rcx
	movl	nBlackHoles(%rip), %r8d
	callq	_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei
.LBB29_24:                              #   in Loop: Header=BB29_2 Depth=1
	movq	24(%rsp), %r9
	movq	%rbp, %rdi
	movl	$1, %esi
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB29_26
# %bb.25:                               #   in Loop: Header=BB29_2 Depth=1
	movq	asteroids(%rip), %rdi
	movl	nAsteroids(%rip), %esi
	movq	blackHoles(%rip), %rdx
	movl	nBlackHoles(%rip), %ecx
	movss	.LCPI29_3(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	callq	_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif
.LBB29_26:                              #   in Loop: Header=BB29_2 Depth=1
	callq	hipGetLastError
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	movq	8(%rsp), %rdi
	callq	hipStreamDestroy
	movq	24(%rsp), %rdi
	callq	hipStreamDestroy
.LBB29_32:                              #   in Loop: Header=BB29_2 Depth=1
	incl	%ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	imulq	$1000, 8(%rsp), %rcx            # imm = 0x3E8
	movabsq	$2361183241434822607, %rax      # imm = 0x20C49BA5E353F7CF
	imulq	16(%rsp)
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rdx
	addq	%rax, %rdx
	addq	%r14, %rcx
	addq	%rdx, %rcx
	cmpq	$10000, %rcx                    # imm = 0x2710
	jl	.LBB29_2
.LBB29_33:                              # %._crit_edge
	testl	%r13d, %r13d
	je	.LBB29_36
# %bb.34:                               # %._crit_edge
	cmpl	$2, cudaOptLevel(%rip)
	jl	.LBB29_36
# %bb.35:
	movq	SPBox(%rip), %rdi
	movslq	spSize(%rip), %rsi
	movl	$-1, %edx
	xorl	%ecx, %ecx
	callq	hipMemPrefetchAsync
	movq	asteroids(%rip), %rdi
	movslq	astSize(%rip), %rsi
	movl	$-1, %edx
	xorl	%ecx, %ecx
	callq	hipMemPrefetchAsync
.LBB29_36:
	callq	hipDeviceSynchronize
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_t
	leaq	8(%rsp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	imulq	$1000, (%r12), %r13             # imm = 0x3E8
	movabsq	$2361183241434822607, %r15      # imm = 0x20C49BA5E353F7CF
	movq	%r15, %rax
	imulq	8(%r12)
	movq	%rdx, %r12
	movq	SPBox(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB29_38
# %bb.37:
	callq	hipFree
	movq	$0, SPBox(%rip)
.LBB29_38:                              # %_Z13freeSpaceTimev.exit
	movq	%r12, %rbp
	shrq	$63, %rbp
	sarq	$7, %r12
	movq	asteroids(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB29_40
# %bb.39:
	callq	hipFree
	movq	$0, asteroids(%rip)
.LBB29_40:                              # %_Z13freeAsteroidsv.exit
	addq	%rbp, %r12
	addq	%r13, %r14
	movq	blackHoles(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB29_42
# %bb.41:
	callq	hipFree
	movq	$0, blackHoles(%rip)
.LBB29_42:                              # %_Z14freeBlackHolesv.exit
	addq	%r12, %r14
	incq	%r14
	movl	benchNum(%rip), %edx
	movl	benchConfig(%rip), %ecx
	movl	$benchName, %edi
	movl	$.L.str.36, %esi
	xorl	%eax, %eax
	callq	sprintf
	movslq	nBenchmark(%rip), %r12
	cmpq	$127, %r12
	jg	.LBB29_44
# %bb.43:
	movl	benchConfig(%rip), %eax
	movl	%eax, (%rsp)                    # 4-byte Spill
	movl	benchType(%rip), %r15d
	movl	benchNum(%rip), %ebp
	imulq	$1056, %r12, %rax               # imm = 0x420
	leaq	BENCHS(%rax), %r13
	movl	$benchName, %esi
	movq	%r13, %rdi
	callq	strcpy
	movl	%ebp, 1024(%r13)
	movl	%r15d, 1032(%r13)
	movabsq	$2361183241434822607, %r15      # imm = 0x20C49BA5E353F7CF
	movl	(%rsp), %eax                    # 4-byte Reload
	movl	%eax, 1028(%r13)
	movq	%r14, 1040(%r13)
	movl	%ebx, 1048(%r13)
.LBB29_44:                              # %_Z15recordBenchmarkiPciiili.exit
	movl	$.L.str.37, %edi
	movl	%r12d, %esi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	printf
	movl	%ebx, %ecx
	movq	%r14, %rax
	imulq	%r15
	movq	%rdx, %rsi
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rsi
	addq	%rax, %rsi
	movq	%rcx, %rax
	xorl	%edx, %edx
	idivq	%rsi
	movl	$.L.str.38, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	addq	$1512, %rsp                     # imm = 0x5E8
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end29:
	.size	_Z15runBenchMarkGPUv, .Lfunc_end29-_Z15runBenchMarkGPUv
	.cfi_endproc
                                        # -- End function
	.globl	_Z13runBenchmarksv              # -- Begin function _Z13runBenchmarksv
	.type	_Z13runBenchmarksv,@function
_Z13runBenchmarksv:                     # @_Z13runBenchmarksv
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	xorl	%ebx, %ebx
	movl	$1073741824, %r14d              # imm = 0x40000000
	movl	$-1073741824, %r15d             # imm = 0xC0000000
	movl	$1000, %r13d                    # imm = 0x3E8
.LBB30_1:                               # %.critedge
                                        # =>This Inner Loop Header: Depth=1
	movl	$1, %ebp
	movl	%ebp, benchType(%rip)
	movl	%ebx, cudaOptLevel(%rip)
	movl	%ebx, benchConfig(%rip)
	movl	$0, benchNum(%rip)
	movl	%r14d, top(%rip)
	movl	%r15d, left(%rip)
	movl	%r15d, bottom(%rip)
	movl	%r14d, right(%rip)
	movl	$1008981770, %r12d              # imm = 0x3C23D70A
	movl	%r12d, spStep(%rip)
	movl	$100, %eax
	movl	%eax, nBlackHoles(%rip)
	movl	%eax, nAsteroids(%rip)
	callq	_Z15runBenchMarkGPUv
	incl	nBenchmark(%rip)
	movl	%ebp, benchNum(%rip)
	movl	%r14d, top(%rip)
	movl	%r15d, left(%rip)
	movl	%r15d, bottom(%rip)
	movl	%r14d, right(%rip)
	movl	%r12d, spStep(%rip)
	movl	$500, %ebp                      # imm = 0x1F4
	movl	%ebp, nBlackHoles(%rip)
	movl	%ebp, nAsteroids(%rip)
	callq	_Z15runBenchMarkGPUv
	incl	nBenchmark(%rip)
	movl	$2, benchNum(%rip)
	movl	%r14d, top(%rip)
	movl	%r15d, left(%rip)
	movl	%r15d, bottom(%rip)
	movl	%r14d, right(%rip)
	movl	%r12d, spStep(%rip)
	movl	%r13d, nBlackHoles(%rip)
	movl	%r13d, nAsteroids(%rip)
	callq	_Z15runBenchMarkGPUv
	incl	nBenchmark(%rip)
	movl	$3, benchNum(%rip)
	movl	%r14d, top(%rip)
	movl	%r15d, left(%rip)
	movl	%r15d, bottom(%rip)
	movl	%r14d, right(%rip)
	movl	%r12d, spStep(%rip)
	movl	%r13d, nBlackHoles(%rip)
	movl	$5000, nAsteroids(%rip)         # imm = 0x1388
	callq	_Z15runBenchMarkGPUv
	incl	nBenchmark(%rip)
	movl	$4, benchNum(%rip)
	movl	%r14d, top(%rip)
	movl	%r15d, left(%rip)
	movl	%r15d, bottom(%rip)
	movl	%r14d, right(%rip)
	movl	$981668463, %r12d               # imm = 0x3A83126F
	movl	%r12d, spStep(%rip)
	movl	$100, %eax
	movl	%eax, nBlackHoles(%rip)
	movl	%eax, nAsteroids(%rip)
	callq	_Z15runBenchMarkGPUv
	incl	nBenchmark(%rip)
	movl	$5, benchNum(%rip)
	movl	%r14d, top(%rip)
	movl	%r15d, left(%rip)
	movl	%r15d, bottom(%rip)
	movl	%r14d, right(%rip)
	movl	%r12d, spStep(%rip)
	movl	%ebp, nBlackHoles(%rip)
	movl	%ebp, nAsteroids(%rip)
	callq	_Z15runBenchMarkGPUv
	incl	nBenchmark(%rip)
	movl	$6, benchNum(%rip)
	movl	%r14d, top(%rip)
	movl	%r15d, left(%rip)
	movl	%r15d, bottom(%rip)
	movl	%r14d, right(%rip)
	movl	%r12d, spStep(%rip)
	movl	%r13d, nBlackHoles(%rip)
	movl	%r13d, nAsteroids(%rip)
	callq	_Z15runBenchMarkGPUv
	incl	nBenchmark(%rip)
	movl	$8, benchNum(%rip)
	movl	%r14d, top(%rip)
	movl	%r15d, left(%rip)
	movl	%r15d, bottom(%rip)
	movl	%r14d, right(%rip)
	movl	$973279855, spStep(%rip)        # imm = 0x3A03126F
	movl	$100, %eax
	movl	%eax, nBlackHoles(%rip)
	movl	%eax, nAsteroids(%rip)
	callq	_Z15runBenchMarkGPUv
	incl	nBenchmark(%rip)
	incl	%ebx
	cmpl	$4, %ebx
	jne	.LBB30_1
# %bb.2:
	movq	stdout(%rip), %rdi
	addq	$8, %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
	jmp	fflush                          # TAILCALL
.Lfunc_end30:
	.size	_Z13runBenchmarksv, .Lfunc_end30-_Z13runBenchmarksv
	.cfi_endproc
                                        # -- End function
	.globl	_Z15runAllBechmarksv            # -- Begin function _Z15runAllBechmarksv
	.type	_Z15runAllBechmarksv,@function
_Z15runAllBechmarksv:                   # @_Z15runAllBechmarksv
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movabsq	$-2361183241434822607, %rax     # imm = 0xDF3B645A1CAC0831
	imulq	8(%rbx)
	movq	(%rbx), %r15
	movq	%rdx, %r14
	shrq	$63, %r14
	sarq	$7, %rdx
	addq	%rdx, %r14
	movl	$0, nBenchmark(%rip)
	callq	_Z13runBenchmarksv
	movl	nBenchmark(%rip), %esi
	movl	$BENCHS, %edi
	callq	_Z16benchMarksToFileP9benchmarki
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	movq	%rcx, %rax
	imulq	8(%rbx)
	movq	(%rbx), %rax
	subq	%r15, %rax
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$7, %rdx
	addq	%rdx, %rsi
	addq	%r14, %rsi
	imulq	$1000, %rax, %rax               # imm = 0x3E8
	addq	%rsi, %rax
	imulq	%rcx
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$7, %rdx
	addq	%rdx, %rsi
	movl	$.L.str.45, %edi
	xorl	%eax, %eax
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.Lfunc_end31:
	.size	_Z15runAllBechmarksv, .Lfunc_end31-_Z15runAllBechmarksv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z19printfGPUDeviceInfov
.LCPI32_0:
	.long	0x35800000                      # float 9.53674316E-7
.LCPI32_1:
	.long	0x3a83126f                      # float 0.00100000005
.LCPI32_2:
	.long	0x358637bd                      # float 9.99999997E-7
	.text
	.globl	_Z19printfGPUDeviceInfov
	.type	_Z19printfGPUDeviceInfov,@function
_Z19printfGPUDeviceInfov:               # @_Z19printfGPUDeviceInfov
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$1768, %rsp                     # imm = 0x6E8
	.cfi_def_cfa_offset 1808
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	xorl	%eax, %eax
	leaq	24(%rsp), %r15
	movl	%eax, (%r15)
	leaq	20(%rsp), %r14
	movl	%eax, (%r14)
	leaq	28(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDevice
	movl	(%rbx), %esi
	leaq	32(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDevicePropertiesR0600
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movl	$.L.str.47, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	printf
	movq	%r15, %rdi
	callq	hipDriverGetVersion
	movq	%r14, %rdi
	callq	hipRuntimeGetVersion
	movslq	(%r15), %rax
	imulq	$274877907, %rax, %rsi          # imm = 0x10624DD3
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$38, %rsi
	addl	%ecx, %esi
	imulq	$1374389535, %rax, %rcx         # imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$37, %rcx
	addl	%edx, %ecx
	imull	$100, %ecx, %ecx
	subl	%ecx, %eax
	movsbl	%al, %eax
	imull	$103, %eax, %ecx
	movl	$65535, %eax                    # imm = 0xFFFF
	movswl	%cx, %edx
	andl	%eax, %ecx
	shrl	$15, %ecx
	shrl	$10, %edx
	addb	%cl, %dl
	movsbl	%dl, %edx
	movslq	(%r14), %rdi
	imulq	$274877907, %rdi, %rcx          # imm = 0x10624DD3
	movq	%rcx, %r8
	shrq	$63, %r8
	sarq	$38, %rcx
	addl	%r8d, %ecx
	imulq	$1374389535, %rdi, %r8          # imm = 0x51EB851F
	movq	%r8, %r9
	shrq	$63, %r9
	shrq	$37, %r8
	addl	%r9d, %r8d
	imull	$100, %r8d, %r8d
	subl	%r8d, %edi
	movsbl	%dil, %edi
	imull	$103, %edi, %edi
	andl	%edi, %eax
	shrl	$15, %eax
	movswl	%di, %edi
	shrl	$10, %edi
	addb	%al, %dil
	movsbl	%dil, %r8d
	movl	$.L.str.48, %edi
                                        # kill: def $esi killed $esi killed $rsi
                                        # kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	printf
	movl	360(%rbx), %esi
	movl	364(%rbx), %edx
	movl	$.L.str.49, %edi
	xorl	%eax, %eax
	callq	printf
	movq	288(%rbx), %rcx
	testq	%rcx, %rcx
	js	.LBB32_1
# %bb.2:
	cvtsi2ss	%rcx, %xmm0
	jmp	.LBB32_3
.LBB32_1:
	movq	%rcx, %rax
	shrq	%rax
	movl	%ecx, %edx
	andl	$1, %edx
	orq	%rax, %rdx
	cvtsi2ss	%rdx, %xmm0
	addss	%xmm0, %xmm0
.LBB32_3:
	mulss	.LCPI32_0(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	leaq	1504(%rsp), %rbx
	movl	$256, %esi                      # imm = 0x100
	movl	$.L.str.50, %edx
	movq	%rbx, %rdi
	movb	$1, %al
	callq	snprintf
	movl	$.L.str.51, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	420(%rsp), %ebx
	movl	392(%rsp), %esi
	movl	396(%rsp), %edx
	movl	%esi, %eax
	shll	$4, %eax
	addl	%edx, %eax
	movl	$48, %edi
	movq	$-104, %rcx
.LBB32_4:                               # =>This Inner Loop Header: Depth=1
	cmpl	%eax, %edi
	je	.LBB32_5
# %bb.6:                                #   in Loop: Header=BB32_4 Depth=1
	movl	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM+112(%rcx), %edi
	addq	$8, %rcx
	jne	.LBB32_4
# %bb.7:
	movl	$64, %ebp
	movl	$.L.str.88, %edi
	movl	$64, %ecx
	xorl	%eax, %eax
	callq	printf
	movl	392(%rsp), %esi
	movl	396(%rsp), %edx
	movl	%esi, %eax
	shll	$4, %eax
	addl	%edx, %eax
	jmp	.LBB32_8
.LBB32_5:
	movl	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM+108(%rcx), %ebp
.LBB32_8:                               # %_Z19_ConvertSMVer2Coresii.exit
	movl	$48, %edi
	movq	$-104, %rcx
.LBB32_9:                               # =>This Inner Loop Header: Depth=1
	cmpl	%eax, %edi
	je	.LBB32_10
# %bb.11:                               #   in Loop: Header=BB32_9 Depth=1
	movl	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM+112(%rcx), %edi
	addq	$8, %rcx
	jne	.LBB32_9
# %bb.12:
	movl	$64, %r14d
	movl	$.L.str.88, %edi
	movl	$64, %ecx
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB32_13
.LBB32_10:
	movl	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM+108(%rcx), %r14d
.LBB32_13:                              # %_Z19_ConvertSMVer2Coresii.exit14
	imull	420(%rsp), %r14d
	movl	$.L.str.52, %edi
	movl	%ebx, %esi
	movl	%ebp, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	printf
	cvtsi2ssl	380(%rsp), %xmm1
	movss	.LCPI32_1(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	mulss	.LCPI32_2(%rip), %xmm1
	cvtss2sd	%xmm1, %xmm1
	movl	$.L.str.53, %edi
	movb	$2, %al
	callq	printf
	movl	440(%rsp), %esi
	movl	452(%rsp), %edx
	movl	456(%rsp), %ecx
	movl	488(%rsp), %r8d
	movl	492(%rsp), %r9d
	movl	496(%rsp), %eax
	movl	%eax, (%rsp)
	movl	$.L.str.54, %edi
	xorl	%eax, %eax
	callq	printf
	movl	516(%rsp), %esi
	movl	520(%rsp), %edx
	movl	$.L.str.55, %edi
	xorl	%eax, %eax
	callq	printf
	movl	524(%rsp), %esi
	movl	528(%rsp), %edx
	movl	532(%rsp), %ecx
	movl	$.L.str.56, %edi
	xorl	%eax, %eax
	callq	printf
	movq	384(%rsp), %rsi
	movl	$.L.str.57, %edi
	xorl	%eax, %eax
	callq	printf
	movq	328(%rsp), %rsi
	movl	$.L.str.58, %edi
	xorl	%eax, %eax
	callq	printf
	movl	336(%rsp), %esi
	movl	$.L.str.59, %edi
	xorl	%eax, %eax
	callq	printf
	movl	340(%rsp), %esi
	movl	$.L.str.60, %edi
	xorl	%eax, %eax
	callq	printf
	movl	656(%rsp), %esi
	movl	$.L.str.61, %edi
	xorl	%eax, %eax
	callq	printf
	movl	352(%rsp), %esi
	movl	$.L.str.62, %edi
	xorl	%eax, %eax
	callq	printf
	movl	356(%rsp), %esi
	movl	360(%rsp), %edx
	movl	364(%rsp), %ecx
	movl	$.L.str.63, %edi
	xorl	%eax, %eax
	callq	printf
	movl	368(%rsp), %esi
	movl	372(%rsp), %edx
	movl	376(%rsp), %ecx
	movl	$.L.str.64, %edi
	xorl	%eax, %eax
	callq	printf
	movq	344(%rsp), %rsi
	movl	$.L.str.65, %edi
	xorl	%eax, %eax
	callq	printf
	movq	400(%rsp), %rsi
	movl	$.L.str.66, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 416(%rsp)
	movl	$.L.str.43, %r14d
	movl	$.L.str.42, %ebx
	movl	$.L.str.42, %esi
	cmoveq	%r14, %rsi
	movl	632(%rsp), %edx
	movl	$.L.str.67, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 424(%rsp)
	movl	$.L.str.42, %esi
	cmoveq	%r14, %rsi
	movl	$.L.str.68, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 428(%rsp)
	movl	$.L.str.42, %esi
	cmoveq	%r14, %rsi
	movl	$.L.str.69, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 432(%rsp)
	movl	$.L.str.42, %esi
	cmoveq	%r14, %rsi
	movl	$.L.str.70, %edi
	xorl	%eax, %eax
	callq	printf
	cmpq	$0, 600(%rsp)
	movl	$.L.str.42, %esi
	cmoveq	%r14, %rsi
	movl	$.L.str.71, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 612(%rsp)
	movl	$.L.str.74, %eax
	movl	$.L.str.73, %esi
	cmoveq	%rax, %rsi
	movl	$.L.str.72, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 636(%rsp)
	movl	$.L.str.42, %esi
	cmoveq	%r14, %rsi
	movl	$.L.str.75, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 712(%rsp)
	movl	$.L.str.42, %esi
	cmoveq	%r14, %rsi
	movl	$.L.str.76, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 720(%rsp)
	movl	$.L.str.42, %esi
	cmoveq	%r14, %rsi
	movl	$.L.str.77, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 724(%rsp)
	cmoveq	%r14, %rbx
	movl	$.L.str.78, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	624(%rsp), %esi
	movl	616(%rsp), %edx
	movl	620(%rsp), %ecx
	movl	$.L.str.79, %edi
	xorl	%eax, %eax
	callq	printf
	addq	$1768, %rsp                     # imm = 0x6E8
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end32:
	.size	_Z19printfGPUDeviceInfov, .Lfunc_end32-_Z19printfGPUDeviceInfov
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	movl	%edi, %ebp
	movl	$0, runMode(%rip)
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	movl	$.Lstr.6, %edi
	callq	puts@PLT
	movl	$.Lstr.8, %edi
	callq	puts@PLT
	callq	_Z19printfGPUDeviceInfov
	movl	$.Lstr.8, %edi
	callq	puts@PLT
	cmpl	$3, %ebp
	jge	.LBB33_8
# %bb.1:
	cmpl	$2, %ebp
	jne	.LBB33_5
# %bb.2:
	movq	8(%rbx), %rdi
	movl	$.L.str.86, %esi
	callq	strcmp
	testl	%eax, %eax
	je	.LBB33_3
.LBB33_5:
	cmpl	$0, runMode(%rip)
	jne	.LBB33_4
# %bb.6:
	callq	_Z16runSimulationGPUv
	jmp	.LBB33_7
.LBB33_3:                               # %.thread
	movl	$1, runMode(%rip)
.LBB33_4:
	callq	_Z15runAllBechmarksv
	movl	$10, %edi
	callq	putchar@PLT
.LBB33_7:
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB33_8:
	.cfi_def_cfa_offset 32
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	movl	$.Lstr.10, %edi
	callq	puts@PLT
	movl	$-1, %edi
	callq	exit
.Lfunc_end33:
	.size	main, .Lfunc_end33-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB34_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB34_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei, %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	$_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii, %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	$_Z19calculateAsteroidsKP8asteroidiP9blackHoleif, %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	$_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi, %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_end34:
	.size	__hip_module_ctor, .Lfunc_end34-__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	.LBB35_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
.LBB35_2:
	retq
.Lfunc_end35:
	.size	__hip_module_dtor, .Lfunc_end35-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	runMode,@object                 # @runMode
	.bss
	.globl	runMode
	.p2align	2, 0x0
runMode:
	.long	0                               # 0x0
	.size	runMode, 4

	.type	spCurrentBuff,@object           # @spCurrentBuff
	.globl	spCurrentBuff
	.p2align	2, 0x0
spCurrentBuff:
	.long	0                               # 0x0
	.size	spCurrentBuff, 4

	.type	astCurrentBuff,@object          # @astCurrentBuff
	.globl	astCurrentBuff
	.p2align	2, 0x0
astCurrentBuff:
	.long	0                               # 0x0
	.size	astCurrentBuff, 4

	.type	nBlackHoles,@object             # @nBlackHoles
	.globl	nBlackHoles
	.p2align	2, 0x0
nBlackHoles:
	.long	0                               # 0x0
	.size	nBlackHoles, 4

	.type	nAsteroids,@object              # @nAsteroids
	.data
	.globl	nAsteroids
	.p2align	2, 0x0
nAsteroids:
	.long	30                              # 0x1e
	.size	nAsteroids, 4

	.type	blackHoles,@object              # @blackHoles
	.bss
	.globl	blackHoles
	.p2align	3, 0x0
blackHoles:
	.quad	0
	.size	blackHoles, 8

	.type	bhSize,@object                  # @bhSize
	.globl	bhSize
	.p2align	2, 0x0
bhSize:
	.long	0                               # 0x0
	.size	bhSize, 4

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

	.type	astSize,@object                 # @astSize
	.globl	astSize
	.p2align	2, 0x0
astSize:
	.long	0                               # 0x0
	.size	astSize, 4

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

	.type	spSize,@object                  # @spSize
	.globl	spSize
	.p2align	2, 0x0
spSize:
	.long	0                               # 0x0
	.size	spSize, 4

	.type	top,@object                     # @top
	.data
	.globl	top
	.p2align	2, 0x0
top:
	.long	0x40000000                      # float 2
	.size	top, 4

	.type	left,@object                    # @left
	.globl	left
	.p2align	2, 0x0
left:
	.long	0xc0000000                      # float -2
	.size	left, 4

	.type	bottom,@object                  # @bottom
	.globl	bottom
	.p2align	2, 0x0
bottom:
	.long	0xc0000000                      # float -2
	.size	bottom, 4

	.type	right,@object                   # @right
	.globl	right
	.p2align	2, 0x0
right:
	.long	0x40000000                      # float 2
	.size	right, 4

	.type	spStep,@object                  # @spStep
	.globl	spStep
	.p2align	2, 0x0
spStep:
	.long	0x3dcccccd                      # float 0.100000001
	.size	spStep, 4

	.type	nelems,@object                  # @nelems
	.bss
	.globl	nelems
	.p2align	2, 0x0
nelems:
	.long	0                               # 0x0
	.size	nelems, 4

	.type	rows,@object                    # @rows
	.globl	rows
	.p2align	2, 0x0
rows:
	.long	0                               # 0x0
	.size	rows, 4

	.type	cols,@object                    # @cols
	.globl	cols
	.p2align	2, 0x0
cols:
	.long	0                               # 0x0
	.size	cols, 4

	.type	cudaOptLevel,@object            # @cudaOptLevel
	.data
	.globl	cudaOptLevel
	.p2align	2, 0x0
cudaOptLevel:
	.long	3                               # 0x3
	.size	cudaOptLevel, 4

	.type	nBenchmark,@object              # @nBenchmark
	.bss
	.globl	nBenchmark
	.p2align	2, 0x0
nBenchmark:
	.long	0                               # 0x0
	.size	nBenchmark, 4

	.type	bechmarkRegenBHSteps,@object    # @bechmarkRegenBHSteps
	.data
	.globl	bechmarkRegenBHSteps
	.p2align	2, 0x0
bechmarkRegenBHSteps:
	.long	360                             # 0x168
	.size	bechmarkRegenBHSteps, 4

	.type	bechmarkRegenWriteFileSteps,@object # @bechmarkRegenWriteFileSteps
	.globl	bechmarkRegenWriteFileSteps
	.p2align	2, 0x0
bechmarkRegenWriteFileSteps:
	.long	20                              # 0x14
	.size	bechmarkRegenWriteFileSteps, 4

	.type	BENCHS,@object                  # @BENCHS
	.bss
	.globl	BENCHS
	.p2align	4, 0x0
BENCHS:
	.zero	135168
	.size	BENCHS, 135168

	.type	benchName,@object               # @benchName
	.globl	benchName
	.p2align	4, 0x0
benchName:
	.zero	1024
	.size	benchName, 1024

	.type	benchNum,@object                # @benchNum
	.globl	benchNum
	.p2align	2, 0x0
benchNum:
	.long	0                               # 0x0
	.size	benchNum, 4

	.type	benchConfig,@object             # @benchConfig
	.globl	benchConfig
	.p2align	2, 0x0
benchConfig:
	.long	0                               # 0x0
	.size	benchConfig, 4

	.type	benchType,@object               # @benchType
	.globl	benchType
	.p2align	2, 0x0
benchType:
	.long	0                               # 0x0
	.size	benchType, 4

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Error: %s"
	.size	.L.str, 10

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"sp_bench.json"
	.size	.L.str.1, 14

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"sp_0.json"
	.size	.L.str.2, 10

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"sp_1.json"
	.size	.L.str.3, 10

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"w+"
	.size	.L.str.4, 3

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"{\"space\":["
	.size	.L.str.5, 11

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"[%0.2f,%0.2f,%0.2f]"
	.size	.L.str.6, 20

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"]"
	.size	.L.str.8, 2

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	",\"blackHoles\":["
	.size	.L.str.9, 16

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"]}"
	.size	.L.str.10, 3

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"sp.json"
	.size	.L.str.11, 8

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"ast_bench.json"
	.size	.L.str.12, 15

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"ast_0.json"
	.size	.L.str.13, 11

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"ast_1.json"
	.size	.L.str.14, 11

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"{\"asteroids\":["
	.size	.L.str.15, 15

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"[%0.2f,%0.2f]"
	.size	.L.str.16, 14

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"ast.json"
	.size	.L.str.17, 9

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"Writing benchmark to File: %s\n"
	.size	.L.str.18, 31

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"benchmark.json"
	.size	.L.str.19, 15

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"{\"benchmarks\":["
	.size	.L.str.20, 16

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"{"
	.size	.L.str.21, 2

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"\"name\": \"%s\","
	.size	.L.str.22, 14

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"\"number\": %d,"
	.size	.L.str.23, 14

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"\"type\": %d,"
	.size	.L.str.24, 12

	.type	.L.str.25,@object               # @.str.25
.L.str.25:
	.asciz	"\"config\": %d,"
	.size	.L.str.25, 14

	.type	.L.str.26,@object               # @.str.26
.L.str.26:
	.asciz	"\"time\": %ld,"
	.size	.L.str.26, 13

	.type	.L.str.27,@object               # @.str.27
.L.str.27:
	.asciz	"\"steps\": %d"
	.size	.L.str.27, 12

	.type	.L.str.28,@object               # @.str.28
.L.str.28:
	.asciz	"}"
	.size	.L.str.28, 2

	.type	.L.str.30,@object               # @.str.30
.L.str.30:
	.asciz	"SpaceTime Params: rows: %d, cols: %d, size: %d\n"
	.size	.L.str.30, 48

	.type	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei,@object # @_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.section	.rodata,"a",@progbits
	.globl	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.p2align	3, 0x0
_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei:
	.quad	_Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.size	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei, 8

	.type	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii,@object # @_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.globl	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.p2align	3, 0x0
_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii:
	.quad	_Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.size	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii, 8

	.type	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif,@object # @_Z19calculateAsteroidsKP8asteroidiP9blackHoleif
	.globl	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif
	.p2align	3, 0x0
_Z19calculateAsteroidsKP8asteroidiP9blackHoleif:
	.quad	_Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif
	.size	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif, 8

	.type	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi,@object # @_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.globl	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.p2align	3, 0x0
_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi:
	.quad	_Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.size	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi, 8

	.type	.L.str.32,@object               # @.str.32
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.32:
	.asciz	"\nBenchmark CPU %d_%d - Config %d\n"
	.size	.L.str.32, 34

	.type	.L.str.33,@object               # @.str.33
.L.str.33:
	.asciz	"  top: %0.2f, bottom: %0.2f, left: %0.2f, right: %0.2f\n"
	.size	.L.str.33, 56

	.type	.L.str.34,@object               # @.str.34
.L.str.34:
	.asciz	"  spStep : %f, nBlackHoles :%d, nAsteroids: %d\n"
	.size	.L.str.34, 48

	.type	.L.str.35,@object               # @.str.35
.L.str.35:
	.asciz	"  Matrix Space Resolution [%d, %d]\n"
	.size	.L.str.35, 36

	.type	.L.str.36,@object               # @.str.36
.L.str.36:
	.asciz	"Benchmark %d_%d"
	.size	.L.str.36, 16

	.type	.L.str.37,@object               # @.str.37
.L.str.37:
	.asciz	"\n  Benchmark %d - Time: %ld millis, steps : %d\n"
	.size	.L.str.37, 48

	.type	.L.str.38,@object               # @.str.38
.L.str.38:
	.asciz	"    Steps Per Second : %ld\n\n"
	.size	.L.str.38, 29

	.type	.L.str.39,@object               # @.str.39
.L.str.39:
	.asciz	"\n Benchmark GPU %d_%d - Config %d\n"
	.size	.L.str.39, 35

	.type	.L.str.40,@object               # @.str.40
.L.str.40:
	.asciz	"  spStep: %f, nBlackHoles: %d, nAsteroids: %d\n"
	.size	.L.str.40, 47

	.type	.L.str.41,@object               # @.str.41
.L.str.41:
	.asciz	"  Device supports Compute Preemption: %s\n"
	.size	.L.str.41, 42

	.type	.L.str.42,@object               # @.str.42
.L.str.42:
	.asciz	"Yes"
	.size	.L.str.42, 4

	.type	.L.str.43,@object               # @.str.43
.L.str.43:
	.asciz	"No"
	.size	.L.str.43, 3

	.type	.L.str.45,@object               # @.str.45
.L.str.45:
	.asciz	"Benchmarks in : %ld seconds\n"
	.size	.L.str.45, 29

	.type	.L.str.47,@object               # @.str.47
.L.str.47:
	.asciz	" Device: \"%s\"\n"
	.size	.L.str.47, 15

	.type	.L.str.48,@object               # @.str.48
.L.str.48:
	.asciz	"  CUDA Driver Version / Runtime Version          %d.%d / %d.%d\n"
	.size	.L.str.48, 64

	.type	.L.str.49,@object               # @.str.49
.L.str.49:
	.asciz	"  CUDA Capability Major/Minor version number:    %d.%d\n"
	.size	.L.str.49, 56

	.type	.L.str.50,@object               # @.str.50
.L.str.50:
	.asciz	"  Total amount of global memory:                 %.0f MBytes (%llu bytes)\n"
	.size	.L.str.50, 75

	.type	.L.str.51,@object               # @.str.51
.L.str.51:
	.asciz	"%s"
	.size	.L.str.51, 3

	.type	.L.str.52,@object               # @.str.52
.L.str.52:
	.asciz	"  (%2d) Multiprocessors, (%3d) CUDA Cores/MP:     %d CUDA Cores\n"
	.size	.L.str.52, 65

	.type	.L.str.53,@object               # @.str.53
.L.str.53:
	.asciz	"  GPU Max Clock rate:                            %.0f MHz (%0.2f GHz)\n"
	.size	.L.str.53, 71

	.type	.L.str.54,@object               # @.str.54
.L.str.54:
	.asciz	"  Maximum Texture Dimension Size (x,y,z)         1D=(%d), 2D=(%d, %d), 3D=(%d, %d, %d)\n"
	.size	.L.str.54, 88

	.type	.L.str.55,@object               # @.str.55
.L.str.55:
	.asciz	"  Maximum Layered 1D Texture Size, (num) layers  1D=(%d), %d layers\n"
	.size	.L.str.55, 69

	.type	.L.str.56,@object               # @.str.56
.L.str.56:
	.asciz	"  Maximum Layered 2D Texture Size, (num) layers  2D=(%d, %d), %d layers\n"
	.size	.L.str.56, 73

	.type	.L.str.57,@object               # @.str.57
.L.str.57:
	.asciz	"  Total amount of constant memory:               %zu bytes\n"
	.size	.L.str.57, 60

	.type	.L.str.58,@object               # @.str.58
.L.str.58:
	.asciz	"  Total amount of shared memory per block:       %zu bytes\n"
	.size	.L.str.58, 60

	.type	.L.str.59,@object               # @.str.59
.L.str.59:
	.asciz	"  Total number of registers available per block: %d\n"
	.size	.L.str.59, 53

	.type	.L.str.60,@object               # @.str.60
.L.str.60:
	.asciz	"  Warp size:                                     %d\n"
	.size	.L.str.60, 53

	.type	.L.str.61,@object               # @.str.61
.L.str.61:
	.asciz	"  Maximum number of threads per multiprocessor:  %d\n"
	.size	.L.str.61, 53

	.type	.L.str.62,@object               # @.str.62
.L.str.62:
	.asciz	"  Maximum number of threads per block:           %d\n"
	.size	.L.str.62, 53

	.type	.L.str.63,@object               # @.str.63
.L.str.63:
	.asciz	"  Max dimension size of a thread block (x,y,z): (%d, %d, %d)\n"
	.size	.L.str.63, 62

	.type	.L.str.64,@object               # @.str.64
.L.str.64:
	.asciz	"  Max dimension size of a grid size    (x,y,z): (%d, %d, %d)\n"
	.size	.L.str.64, 62

	.type	.L.str.65,@object               # @.str.65
.L.str.65:
	.asciz	"  Maximum memory pitch:                          %zu bytes\n"
	.size	.L.str.65, 60

	.type	.L.str.66,@object               # @.str.66
.L.str.66:
	.asciz	"  Texture alignment:                             %zu bytes\n"
	.size	.L.str.66, 60

	.type	.L.str.67,@object               # @.str.67
.L.str.67:
	.asciz	"  Concurrent copy and kernel execution:          %s with %d copy engine(s)\n"
	.size	.L.str.67, 76

	.type	.L.str.68,@object               # @.str.68
.L.str.68:
	.asciz	"  Run time limit on kernels:                     %s\n"
	.size	.L.str.68, 53

	.type	.L.str.69,@object               # @.str.69
.L.str.69:
	.asciz	"  Integrated GPU sharing Host Memory:            %s\n"
	.size	.L.str.69, 53

	.type	.L.str.70,@object               # @.str.70
.L.str.70:
	.asciz	"  Support host page-locked memory mapping:       %s\n"
	.size	.L.str.70, 53

	.type	.L.str.71,@object               # @.str.71
.L.str.71:
	.asciz	"  Alignment requirement for Surfaces:            %s\n"
	.size	.L.str.71, 53

	.type	.L.str.72,@object               # @.str.72
.L.str.72:
	.asciz	"  Device has ECC support:                        %s\n"
	.size	.L.str.72, 53

	.type	.L.str.73,@object               # @.str.73
.L.str.73:
	.asciz	"Enabled"
	.size	.L.str.73, 8

	.type	.L.str.74,@object               # @.str.74
.L.str.74:
	.asciz	"Disabled"
	.size	.L.str.74, 9

	.type	.L.str.75,@object               # @.str.75
.L.str.75:
	.asciz	"  Device supports Unified Addressing (UVA):      %s\n"
	.size	.L.str.75, 53

	.type	.L.str.76,@object               # @.str.76
.L.str.76:
	.asciz	"  Device supports Compute Preemption:            %s\n"
	.size	.L.str.76, 53

	.type	.L.str.77,@object               # @.str.77
.L.str.77:
	.asciz	"  Supports Cooperative Kernel Launch:            %s\n"
	.size	.L.str.77, 53

	.type	.L.str.78,@object               # @.str.78
.L.str.78:
	.asciz	"  Supports MultiDevice Co-op Kernel Launch:      %s\n"
	.size	.L.str.78, 53

	.type	.L.str.79,@object               # @.str.79
.L.str.79:
	.asciz	"  Device PCI Domain ID / Bus ID / location ID:   %d / %d / %d\n"
	.size	.L.str.79, 63

	.type	.L.str.86,@object               # @.str.86
.L.str.86:
	.asciz	"benchmark"
	.size	.L.str.86, 10

	.type	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM,@object # @__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM
	.section	.rodata,"a",@progbits
	.p2align	4, 0x0
.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM:
	.long	48                              # 0x30
	.long	192                             # 0xc0
	.long	50                              # 0x32
	.long	192                             # 0xc0
	.long	53                              # 0x35
	.long	192                             # 0xc0
	.long	55                              # 0x37
	.long	192                             # 0xc0
	.long	80                              # 0x50
	.long	128                             # 0x80
	.long	82                              # 0x52
	.long	128                             # 0x80
	.long	83                              # 0x53
	.long	128                             # 0x80
	.long	96                              # 0x60
	.long	64                              # 0x40
	.long	97                              # 0x61
	.long	128                             # 0x80
	.long	98                              # 0x62
	.long	128                             # 0x80
	.long	112                             # 0x70
	.long	64                              # 0x40
	.long	114                             # 0x72
	.long	64                              # 0x40
	.long	117                             # 0x75
	.long	64                              # 0x40
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.size	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM, 112

	.type	.L.str.88,@object               # @.str.88
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.88:
	.asciz	"MapSMtoCores for SM %d.%d is undefined.  Default to use %d Cores/SM\n"
	.size	.L.str.88, 69

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei"
	.size	.L__unnamed_1, 55

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii"
	.size	.L__unnamed_2, 59

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z19calculateAsteroidsKP8asteroidiP9blackHoleif"
	.size	.L__unnamed_3, 48

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi"
	.size	.L__unnamed_4, 52

	.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	"Running Simulation CPU ..."
	.size	.Lstr, 27

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Running Simulation GPU ..."
	.size	.Lstr.1, 27

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"Running All Benchmarks ..."
	.size	.Lstr.2, 27

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"GPU Info"
	.size	.Lstr.3, 9

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"Cuda Space Time Simulator - 2020\n"
	.size	.Lstr.4, 34

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"  Author: Oscar Noel Amaya Garcia. email: dbanshee@gmail.com"
	.size	.Lstr.5, 61

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"  nVidia DLI - Volunteer practice"
	.size	.Lstr.6, 34

	.type	.Lstr.8,@object                 # @str.8
.Lstr.8:
	.asciz	"\n"
	.size	.Lstr.8, 2

	.type	.Lstr.9,@object                 # @str.9
.Lstr.9:
	.asciz	"Invalid args."
	.size	.Lstr.9, 14

	.type	.Lstr.10,@object                # @str.10
.Lstr.10:
	.asciz	"cudaspsim [benchmark]"
	.size	.Lstr.10, 22

	.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 _Z34__device_stub__calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.addrsig_sym _Z37__device_stub__calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.addrsig_sym _Z34__device_stub__calculateAsteroidsKP8asteroidiP9blackHoleif
	.addrsig_sym _Z37__device_stub__calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym blackHoles
	.addrsig_sym asteroids
	.addrsig_sym SPBox
	.addrsig_sym BENCHS
	.addrsig_sym benchName
	.addrsig_sym _Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.addrsig_sym _Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.addrsig_sym _Z19calculateAsteroidsKP8asteroidiP9blackHoleif
	.addrsig_sym _Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei ; -- Begin function _Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.globl	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
	.p2align	8
	.type	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei,@function
_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei: ; @_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b128 s[4:7], s[0:1], 0x8
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v0, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[3:4], null, s14, s2, v[1:2]
	v_mad_u64_u32 v[4:5], null, s15, s3, v[0:1]
	v_cmp_gt_i32_e32 vcc_lo, s4, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e64 s2, s5, v4
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_6
; %bb.1:
	v_cvt_f32_i32_e32 v0, v3
	v_cvt_f32_i32_e32 v1, s4
	v_cvt_f32_i32_e32 v2, v4
	v_cvt_f32_i32_e32 v5, s5
	s_clause 0x1
	s_load_b64 s[8:9], s[0:1], 0x18
	s_load_b32 s3, s[0:1], 0x28
	v_div_scale_f32 v6, null, v1, v1, v0
	v_div_scale_f32 v7, null, v5, v5, v2
	v_div_scale_f32 v12, vcc_lo, v0, v1, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v8, v6
	v_rcp_f32_e32 v9, v7
	s_waitcnt_depctr 0xfff
	v_fma_f32 v10, -v6, v8, 1.0
	v_fma_f32 v11, -v7, v9, 1.0
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s3, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v8, v10, v8 :: v_dual_fmac_f32 v9, v11, v9
	v_div_scale_f32 v10, s2, v2, v5, v2
	v_mul_f32_e32 v11, v12, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v13, v10, v9
	v_fma_f32 v14, -v6, v11, v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v15, -v7, v13, v10
	v_fmac_f32_e32 v11, v14, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v13, v15, v9
	v_fma_f32 v6, -v6, v11, v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v7, -v7, v13, v10
	v_div_fmas_f32 v6, v6, v8, v11
	s_mov_b32 vcc_lo, s2
	v_sub_f32_e64 v8, s7, s6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_fmas_f32 v7, v7, v9, v13
	v_div_fixup_f32 v0, v6, v1, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_div_fixup_f32 v1, v7, v5, v2
	v_sub_f32_e64 v2, s8, s9
	v_fma_f32 v0, v8, v0, s6
	s_delay_alu instid0(VALU_DEP_2)
	v_fma_f32 v1, v2, v1, s9
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %.lr.ph.preheader
	s_load_b64 s[6:7], s[0:1], 0x20
	v_mov_b32_e32 v2, 0
	s_mov_b32 s5, 0x3e76c4e1
	s_brev_b32 s8, -2
	s_waitcnt lgkmcnt(0)
	s_add_u32 s6, s6, 4
	s_addc_u32 s7, s7, 0
.LBB0_3:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_add_u32 s10, s6, -4
	s_addc_u32 s11, s7, -1
	s_add_i32 s3, s3, -1
	s_clause 0x1
	s_load_b64 s[10:11], s[10:11], 0x0
	s_load_b32 s9, s[6:7], 0x4
	s_waitcnt lgkmcnt(0)
	v_dual_subrev_f32 v5, s11, v1 :: v_dual_subrev_f32 v6, s10, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v5, v5, v5
	v_fmac_f32_e32 v5, v6, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v6, 0x4f800000, v5
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v5
	v_cndmask_b32_e32 v5, v5, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_sqrt_f32_e32 v6, v5
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v7, -1, v6
	v_add_nc_u32_e32 v8, 1, v6
	v_fma_f32 v9, -v7, v6, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v10, -v8, v6, v5
	v_cmp_ge_f32_e64 s2, 0, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v6, v6, v7, s2
	v_cmp_lt_f32_e64 s2, 0, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v6, v6, v8, s2
	v_mul_f32_e32 v7, 0x37800000, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v6, v6, v7, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v5, 0x260
	v_cndmask_b32_e32 v5, v6, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_neq_f32_e32 vcc_lo, 0, v5
	v_cndmask_b32_e32 v5, 0x3089705f, v5, vcc_lo
	v_frexp_mant_f32_e64 v6, |v5|
	v_frexp_exp_i32_f32_e32 v7, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cmp_gt_f32_e32 vcc_lo, 0x3f2aaaab, v6
	v_cndmask_b32_e64 v8, 0, 1, vcc_lo
	v_subrev_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ldexp_f32 v6, v6, v8
	v_cvt_f32_i32_e32 v7, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f32_e32 v8, 1.0, v6
	v_dual_add_f32 v9, -1.0, v6 :: v_dual_mul_f32 v12, 0x3f317218, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v10, v8
	v_add_f32_e32 v11, -1.0, v8
	v_sub_f32_e32 v6, v6, v11
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_fma_f32 v11, 0x3f317218, v7, -v12
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v13, v9, v10
	v_fmac_f32_e32 v11, 0xb102e308, v7
	v_mul_f32_e32 v7, v8, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v8, v13, v8, -v7
	v_fmac_f32_e32 v8, v13, v6
	v_cmp_eq_f32_e32 vcc_lo, 1.0, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v7, v8
	v_dual_sub_f32 v14, v9, v6 :: v_dual_sub_f32 v7, v6, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v9, v9, v14
	v_dual_sub_f32 v7, v7, v8 :: v_dual_sub_f32 v6, v9, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v7, v6
	v_add_f32_e32 v6, v14, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v6, v10, v6
	v_add_f32_e32 v7, v13, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v8, v7, v13
	v_dual_mul_f32 v9, v7, v7 :: v_dual_sub_f32 v6, v6, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v8, v7, v7, -v9
	v_add_f32_e32 v13, v6, v6
	v_ldexp_f32 v14, v6, 1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v8, v7, v13
	v_add_f32_e32 v13, v9, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmaak_f32 v15, s5, v13, 0x3e91f4c4
	v_sub_f32_e32 v9, v13, v9
	v_dual_fmaak_f32 v15, v13, v15, 0x3ecccdef :: v_dual_mul_f32 v16, v7, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_sub_f32 v8, v8, v9 :: v_dual_mul_f32 v17, v13, v15
	v_fma_f32 v9, v13, v7, -v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v9, v13, v6
	v_fma_f32 v6, v13, v15, -v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v6, v8, v15
	v_fmac_f32_e32 v9, v8, v7
	v_ldexp_f32 v10, v7, 1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v8, v17, v6
	v_sub_f32_e32 v15, v8, v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v6, v6, v15
	v_dual_add_f32 v6, 0x31739010, v6 :: v_dual_add_f32 v7, v16, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v13, v7, v16
	v_dual_add_f32 v16, 0x3f2aaaaa, v8 :: v_dual_sub_f32 v9, v9, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v13, 0xbf2aaaaa, v16
	v_sub_f32_e32 v8, v8, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v6, v8
	v_add_f32_e32 v8, v16, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v13, v16, v8
	v_dual_mul_f32 v15, v7, v8 :: v_dual_add_f32 v6, v6, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v13, v7, v8, -v15
	v_fmac_f32_e32 v13, v7, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v13, v9, v8
	v_add_f32_e32 v6, v15, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v7, v10, v6
	v_dual_sub_f32 v8, v6, v15 :: v_dual_sub_f32 v9, v7, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v8, v13, v8
	v_sub_f32_e32 v6, v6, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_add_f32 v8, v14, v8 :: v_dual_add_f32 v9, v12, v11
	v_add_f32_e32 v6, v8, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v8, v9, v12
	v_sub_f32_e32 v8, v11, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v10, v7, v6
	v_add_f32_e32 v11, v9, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v7, v10, v7 :: v_dual_sub_f32 v12, v11, v9
	v_sub_f32_e32 v6, v6, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v10, v10, v12
	v_dual_sub_f32 v7, v11, v12 :: v_dual_add_f32 v12, v8, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v7, v9, v7
	v_sub_f32_e32 v9, v12, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_add_f32 v7, v10, v7 :: v_dual_sub_f32 v10, v12, v9
	v_sub_f32_e32 v6, v6, v9
	v_sub_f32_e32 v8, v8, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_add_f32 v7, v12, v7 :: v_dual_add_f32 v6, v6, v8
	v_add_f32_e32 v9, v11, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v10, v9, v11
	v_sub_f32_e32 v7, v7, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v6, v6, v7
	v_cndmask_b32_e64 v7, 0x3d4ccccd, 1.0, vcc_lo
	v_add_f32_e32 v8, v9, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v9, v8, v9 :: v_dual_mul_f32 v10, v7, v8
	v_sub_f32_e32 v6, v6, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f32 v8, v7, v8, -v10
	v_cmp_class_f32_e64 vcc_lo, v10, 0x204
	v_fmac_f32_e32 v8, v7, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v10, v8
	v_cndmask_b32_e32 v9, v6, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_eq_f32_e32 vcc_lo, 0x42b17218, v9
	v_cndmask_b32_e64 v11, 0, 0x37000000, vcc_lo
	v_sub_f32_e32 v12, v9, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v13, 0x3fb8aa3b, v12
	v_cmp_nlt_f32_e64 s2, 0x42b17218, v12
	v_fma_f32 v14, 0x3fb8aa3b, v12, -v13
	v_rndne_f32_e32 v15, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v14, 0x32a5705f, v12 :: v_dual_sub_f32 v13, v13, v15
	v_cmp_neq_f32_e64 vcc_lo, 0x7f800000, |v9|
	v_add_f32_e32 v13, v13, v14
	v_sub_f32_e32 v6, v6, v10
	v_cvt_i32_f32_e32 v10, v15
	v_trunc_f32_e32 v14, v7
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_exp_f32_e32 v13, v13
	v_sub_f32_e32 v6, v8, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_cndmask_b32_e32 v6, 0, v6, vcc_lo
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v12
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v8, v13, v10
	v_mul_f32_e32 v10, 0.5, v7
	v_add_f32_e32 v6, v11, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v8, 0, v8, vcc_lo
	v_trunc_f32_e32 v9, v10
	v_cmp_eq_f32_e32 vcc_lo, v14, v7
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v7, 0x7f800000, v8, s2
	v_cmp_neq_f32_e64 s2, v9, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v6, v7, v6, v7
	s_and_b32 vcc_lo, vcc_lo, s2
	s_add_u32 s6, s6, 12
	v_cndmask_b32_e32 v8, 1.0, v5, vcc_lo
	v_cndmask_b32_e32 v9, 0, v5, vcc_lo
	v_cmp_eq_f32_e32 vcc_lo, 0x7f800000, v7
	s_addc_u32 s7, s7, 0
	s_cmp_eq_u32 s3, 0
	v_cndmask_b32_e32 v6, v6, v7, vcc_lo
	v_bfi_b32 v7, s8, 0x7f800000, v9
	v_cmp_class_f32_e64 vcc_lo, v5, 0x204
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_bfi_b32 v6, 0x7fffffff, v6, v8
	v_cndmask_b32_e32 v6, v6, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f32 v7, null, v6, v6, 1.0
	v_div_scale_f32 v10, vcc_lo, 1.0, v6, 1.0
	v_rcp_f32_e32 v8, v7
	s_waitcnt_depctr 0xfff
	v_fma_f32 v9, -v7, v8, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v8, v9, v8
	v_mul_f32_e32 v9, v10, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v11, -v7, v9, v10
	v_fmac_f32_e32 v9, v11, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v7, -v7, v9, v10
	v_div_fmas_f32 v7, v7, v8, v9
	v_cmp_o_f32_e32 vcc_lo, v5, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f32 v6, v7, v6, 1.0
	v_cndmask_b32_e32 v5, 0x7fc00000, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_fmac_f32_e32 v2, s9, v5
	s_cbranch_scc0 .LBB0_3
	s_branch .LBB0_5
.LBB0_4:
	v_mov_b32_e32 v2, 0
.LBB0_5:                                ; %Flow85
	s_load_b64 s[0:1], s[0:1], 0x0
	v_mad_u64_u32 v[5:6], null, v3, s4, v[4:5]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_i64_i32 v[3:4], null, v5, 12, s[0:1]
	global_store_b96 v[3:4], v[0:2], off
.LBB0_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 1
		.amdhsa_next_free_vgpr 18
		.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_end0:
	.size	_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei, .Lfunc_end0-_Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1788
; NumSgprs: 18
; NumVgprs: 18
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 18
; 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: 1
	.text
	.protected	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii ; -- Begin function _Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.globl	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
	.p2align	8
	.type	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii,@function
_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii: ; @_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b64 s[8:9], s[0:1], 0x28
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v0, v0, 10, 10
	s_mov_b32 s7, 0
	s_mov_b32 s6, exec_lo
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[3:4], null, s14, s2, v[1:2]
	v_mad_u64_u32 v[4:5], null, s15, s3, v[0:1]
	v_or_b32_e32 v0, v4, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB1_15
; %bb.1:
	s_load_b64 s[2:3], s[0:1], 0x20
	s_ashr_i32 s5, s9, 31
	s_cmp_lt_u32 s9, 4
	s_mov_b32 s4, s9
	s_cbranch_scc1 .LBB1_4
; %bb.2:                                ; %.lr.ph.i.i.preheader
	v_mov_b32_e32 v0, 0
.LBB1_3:                                ; %.lr.ph.i.i
                                        ; =>This Inner Loop Header: Depth=1
	s_waitcnt lgkmcnt(0)
	global_load_b32 v1, v0, s[2:3]
	s_add_u32 s4, s4, -4
	s_addc_u32 s5, s5, -1
	v_mov_b32_e32 v2, s7
	v_cmp_gt_u64_e64 s9, s[4:5], 3
	s_add_u32 s2, s2, 4
	s_addc_u32 s3, s3, 0
	s_add_i32 s7, s7, 4
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s9
	s_waitcnt vmcnt(0)
	v_lshrrev_b32_e32 v5, 8, v1
	v_lshrrev_b32_e32 v6, 24, v1
	ds_store_b8 v2, v1
	ds_store_b8 v2, v5 offset:1
	ds_store_b8_d16_hi v2, v1 offset:2
	ds_store_b8 v2, v6 offset:3
	s_cbranch_vccnz .LBB1_3
.LBB1_4:                                ; %NodeBlock117
	v_cmp_lt_i64_e64 s9, s[4:5], 2
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s9
	s_cbranch_vccnz .LBB1_10
; %bb.5:                                ; %NodeBlock
	v_cmp_gt_i64_e64 s9, s[4:5], 2
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s9
	s_mov_b32 s9, -1
	s_cbranch_vccz .LBB1_8
; %bb.6:                                ; %LeafBlock115
	s_cmp_eq_u64 s[4:5], 3
	s_mov_b32 s9, 0
	s_cbranch_scc0 .LBB1_8
; %bb.7:
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s7
	s_mov_b32 s9, -1
	s_waitcnt lgkmcnt(0)
	global_load_u8 v0, v0, s[2:3] offset:2
	s_waitcnt vmcnt(0)
	ds_store_b8 v1, v0 offset:2
.LBB1_8:                                ; %Flow122
	s_mov_b32 s10, 0
	s_and_b32 vcc_lo, exec_lo, s9
	s_mov_b32 s9, 0
	s_cbranch_vccz .LBB1_11
; %bb.9:
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s7
	s_mov_b32 s9, -1
	s_waitcnt lgkmcnt(0)
	global_load_u8 v0, v0, s[2:3] offset:1
	s_waitcnt vmcnt(0)
	ds_store_b8 v1, v0 offset:1
	s_branch .LBB1_11
.LBB1_10:
	s_mov_b32 s10, -1
	s_mov_b32 s9, 0
.LBB1_11:                               ; %Flow121
	s_and_b32 vcc_lo, exec_lo, s10
	s_cbranch_vccz .LBB1_13
; %bb.12:                               ; %LeafBlock
	s_cmp_eq_u64 s[4:5], 1
	s_cselect_b32 s9, -1, 0
.LBB1_13:                               ; %Flow125
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s9
	s_cbranch_vccnz .LBB1_15
; %bb.14:
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s7
	s_waitcnt lgkmcnt(0)
	global_load_u8 v0, v0, s[2:3]
	s_waitcnt vmcnt(0)
	ds_store_b8 v1, v0
.LBB1_15:                               ; %Flow129
	s_or_b32 exec_lo, exec_lo, s6
	s_load_b128 s[4:7], s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmp_gt_i32_e32 vcc_lo, s4, v3
	v_cmp_gt_i32_e64 s2, s5, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB1_20
; %bb.16:
	v_cvt_f32_i32_e32 v0, v3
	v_cvt_f32_i32_e32 v1, s4
	v_cvt_f32_i32_e32 v2, v4
	v_cvt_f32_i32_e32 v5, s5
	s_load_b64 s[10:11], s[0:1], 0x18
	s_cmp_lt_i32 s8, 1
	v_div_scale_f32 v6, null, v1, v1, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_div_scale_f32 v7, null, v5, v5, v2
	v_div_scale_f32 v12, vcc_lo, v0, v1, v0
	v_rcp_f32_e32 v8, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v9, v7
	s_waitcnt_depctr 0xfff
	v_fma_f32 v10, -v6, v8, 1.0
	v_fma_f32 v11, -v7, v9, 1.0
	v_dual_fmac_f32 v8, v10, v8 :: v_dual_fmac_f32 v9, v11, v9
	v_div_scale_f32 v10, s2, v2, v5, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v11, v12, v8
	v_mul_f32_e32 v13, v10, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v14, -v6, v11, v12
	v_fma_f32 v15, -v7, v13, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v11, v14, v8
	v_fmac_f32_e32 v13, v15, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v6, -v6, v11, v12
	v_fma_f32 v7, -v7, v13, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_div_fmas_f32 v6, v6, v8, v11
	s_mov_b32 vcc_lo, s2
	v_sub_f32_e64 v8, s7, s6
	v_div_fmas_f32 v7, v7, v9, v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_fixup_f32 v0, v6, v1, v0
	v_div_fixup_f32 v1, v7, v5, v2
	s_waitcnt lgkmcnt(0)
	v_sub_f32_e64 v2, s10, s11
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v0, v8, v0, s6
	v_fma_f32 v1, v2, v1, s11
	v_mov_b32_e32 v2, 0
	s_cbranch_scc1 .LBB1_19
; %bb.17:                               ; %.lr.ph.preheader
	s_mov_b32 s3, 0
	s_mov_b32 s5, 0x3e76c4e1
	s_brev_b32 s6, -2
.LBB1_18:                               ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	v_mov_b32_e32 v7, s3
	s_add_i32 s8, s8, -1
	s_add_i32 s3, s3, 12
	ds_load_2addr_b32 v[5:6], v7 offset1:1
	ds_load_b32 v7, v7 offset:8
	s_waitcnt lgkmcnt(1)
	v_dual_sub_f32 v6, v1, v6 :: v_dual_sub_f32 v5, v0, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v6, v6, v6
	v_fmac_f32_e32 v6, v5, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v6
	v_mul_f32_e32 v5, 0x4f800000, v6
	v_cndmask_b32_e32 v5, v6, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_sqrt_f32_e32 v6, v5
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v8, -1, v6
	v_add_nc_u32_e32 v9, 1, v6
	v_fma_f32 v10, -v8, v6, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v11, -v9, v6, v5
	v_cmp_ge_f32_e64 s2, 0, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v6, v6, v8, s2
	v_cmp_lt_f32_e64 s2, 0, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v6, v6, v9, s2
	v_mul_f32_e32 v8, 0x37800000, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v6, v6, v8, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v5, 0x260
	v_cndmask_b32_e32 v5, v6, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_neq_f32_e32 vcc_lo, 0, v5
	v_cndmask_b32_e32 v5, 0x3089705f, v5, vcc_lo
	v_frexp_mant_f32_e64 v6, |v5|
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_gt_f32_e32 vcc_lo, 0x3f2aaaab, v6
	v_cndmask_b32_e64 v9, 0, 1, vcc_lo
	v_ldexp_f32 v6, v6, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_add_f32_e32 v10, -1.0, v6
	v_frexp_exp_i32_f32_e32 v8, v5
	v_add_f32_e32 v9, 1.0, v6
	v_subrev_co_ci_u32_e32 v8, vcc_lo, 0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v11, v9
	v_cmp_eq_f32_e32 vcc_lo, 1.0, v5
	v_cvt_f32_i32_e32 v8, v8
	s_waitcnt_depctr 0xfff
	v_dual_mul_f32 v13, 0x3f317218, v8 :: v_dual_mul_f32 v14, v10, v11
	v_add_f32_e32 v12, -1.0, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_sub_f32_e32 v6, v6, v12
	v_fma_f32 v12, 0x3f317218, v8, -v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, 0xb102e308, v8
	v_mul_f32_e32 v8, v9, v14
	v_fma_f32 v9, v14, v9, -v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v9, v14, v6
	v_add_f32_e32 v6, v8, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v15, v10, v6
	v_sub_f32_e32 v8, v6, v8
	v_sub_f32_e32 v10, v10, v15
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v8, v8, v9
	v_sub_f32_e32 v6, v10, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v8, v6
	v_add_f32_e32 v6, v15, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v6, v11, v6
	v_add_f32_e32 v8, v14, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_sub_f32_e32 v9, v8, v14
	v_mul_f32_e32 v10, v8, v8
	v_ldexp_f32 v11, v8, 1
	v_sub_f32_e32 v6, v6, v9
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v9, v8, v8, -v10
	v_add_f32_e32 v14, v6, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v9, v8, v14
	v_ldexp_f32 v15, v6, 1
	v_add_f32_e32 v14, v10, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmaak_f32 v16, s5, v14, 0x3e91f4c4
	v_sub_f32_e32 v10, v14, v10
	v_dual_mul_f32 v17, v8, v14 :: v_dual_fmaak_f32 v16, v14, v16, 0x3ecccdef
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v9, v9, v10
	v_fma_f32 v10, v14, v8, -v17
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v18, v14, v16
	v_fmac_f32_e32 v10, v14, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v6, v14, v16, -v18
	v_fmac_f32_e32 v10, v9, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v6, v9, v16
	v_add_f32_e32 v8, v17, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_add_f32 v9, v18, v6 :: v_dual_sub_f32 v14, v8, v17
	v_dual_sub_f32 v16, v9, v18 :: v_dual_add_f32 v17, 0x3f2aaaaa, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v10, v10, v14
	v_sub_f32_e32 v6, v6, v16
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f32_e32 v14, 0xbf2aaaaa, v17
	v_add_f32_e32 v6, 0x31739010, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v9, v9, v14
	v_add_f32_e32 v6, v6, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v9, v17, v6
	v_sub_f32_e32 v14, v17, v9
	v_mul_f32_e32 v16, v8, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f32_e32 v6, v6, v14
	v_fma_f32 v14, v8, v9, -v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v14, v8, v6
	v_fmac_f32_e32 v14, v10, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v16, v14
	v_dual_add_f32 v8, v11, v6 :: v_dual_sub_f32 v9, v6, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v10, v8, v11 :: v_dual_sub_f32 v9, v14, v9
	v_dual_sub_f32 v6, v6, v10 :: v_dual_add_f32 v9, v15, v9
	v_add_f32_e32 v10, v13, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_add_f32 v6, v9, v6 :: v_dual_sub_f32 v9, v10, v13
	v_add_f32_e32 v11, v8, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v9, v12, v9 :: v_dual_add_f32 v12, v10, v11
	v_dual_sub_f32 v8, v11, v8 :: v_dual_sub_f32 v13, v12, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v6, v6, v8
	v_sub_f32_e32 v8, v12, v13
	v_sub_f32_e32 v11, v11, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_add_f32 v13, v9, v6 :: v_dual_sub_f32 v8, v10, v8
	v_sub_f32_e32 v10, v13, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_add_f32 v8, v11, v8 :: v_dual_sub_f32 v11, v13, v10
	v_sub_f32_e32 v6, v6, v10
	v_add_f32_e32 v8, v13, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v9, v9, v11 :: v_dual_add_f32 v10, v12, v8
	v_add_f32_e32 v6, v6, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v11, v10, v12
	v_sub_f32_e32 v8, v8, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v6, v6, v8
	v_cndmask_b32_e64 v8, 0x3d4ccccd, 1.0, vcc_lo
	v_add_f32_e32 v9, v10, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v10, v9, v10 :: v_dual_mul_f32 v11, v8, v9
	v_sub_f32_e32 v6, v6, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f32 v9, v8, v9, -v11
	v_cmp_class_f32_e64 vcc_lo, v11, 0x204
	v_fmac_f32_e32 v9, v8, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v11, v9
	v_cndmask_b32_e32 v10, v6, v11, vcc_lo
	v_sub_f32_e32 v6, v6, v11
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_eq_f32_e32 vcc_lo, 0x42b17218, v10
	v_sub_f32_e32 v6, v9, v6
	v_cndmask_b32_e64 v12, 0, 0x37000000, vcc_lo
	v_cmp_neq_f32_e64 vcc_lo, 0x7f800000, |v10|
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v13, v10, v12 :: v_dual_cndmask_b32 v6, 0, v6
	v_mul_f32_e32 v14, 0x3fb8aa3b, v13
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v13
	v_cmp_nlt_f32_e64 s2, 0x42b17218, v13
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f32_e32 v6, v12, v6
	v_fma_f32 v15, 0x3fb8aa3b, v13, -v14
	v_rndne_f32_e32 v16, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v15, 0x32a5705f, v13 :: v_dual_sub_f32 v14, v14, v16
	v_cvt_i32_f32_e32 v11, v16
	v_add_f32_e32 v14, v14, v15
	v_trunc_f32_e32 v15, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_exp_f32_e32 v14, v14
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v9, v14, v11
	v_mul_f32_e32 v11, 0.5, v8
	v_cndmask_b32_e32 v9, 0, v9, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_trunc_f32_e32 v10, v11
	v_cmp_eq_f32_e32 vcc_lo, v15, v8
	v_cndmask_b32_e64 v8, 0x7f800000, v9, s2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_neq_f32_e64 s2, v10, v11
	v_fma_f32 v6, v8, v6, v8
	s_delay_alu instid0(VALU_DEP_2)
	s_and_b32 vcc_lo, vcc_lo, s2
	s_cmp_eq_u32 s8, 0
	v_cndmask_b32_e32 v9, 1.0, v5, vcc_lo
	v_cndmask_b32_e32 v10, 0, v5, vcc_lo
	v_cmp_eq_f32_e32 vcc_lo, 0x7f800000, v8
	v_cndmask_b32_e32 v6, v6, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_bfi_b32 v8, s6, 0x7f800000, v10
	v_cmp_class_f32_e64 vcc_lo, v5, 0x204
	v_bfi_b32 v6, 0x7fffffff, v6, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v6, v6, v8, vcc_lo
	v_div_scale_f32 v8, null, v6, v6, 1.0
	v_div_scale_f32 v11, vcc_lo, 1.0, v6, 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v9, v8
	s_waitcnt_depctr 0xfff
	v_fma_f32 v10, -v8, v9, 1.0
	v_fmac_f32_e32 v9, v10, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v10, v11, v9
	v_fma_f32 v12, -v8, v10, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v10, v12, v9
	v_fma_f32 v8, -v8, v10, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_fmas_f32 v8, v8, v9, v10
	v_cmp_o_f32_e32 vcc_lo, v5, v5
	v_div_fixup_f32 v6, v8, v6, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v5, 0x7fc00000, v6, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_fmac_f32_e32 v2, v7, v5
	s_cbranch_scc0 .LBB1_18
.LBB1_19:                               ; %Flow119
	s_load_b64 s[0:1], s[0:1], 0x0
	v_mad_u64_u32 v[5:6], null, v3, s4, v[4:5]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_i64_i32 v[3:4], null, v5, 12, s[0:1]
	global_store_b96 v[3:4], v[0:2], off
.LBB1_20:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 1
		.amdhsa_next_free_vgpr 19
		.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	_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii, .Lfunc_end1-_Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 2128
; NumSgprs: 18
; NumVgprs: 19
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 19
; 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: 1
	.text
	.protected	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif ; -- Begin function _Z19calculateAsteroidsKP8asteroidiP9blackHoleif
	.globl	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif
	.p2align	8
	.type	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif,@function
_Z19calculateAsteroidsKP8asteroidiP9blackHoleif: ; @_Z19calculateAsteroidsKP8asteroidiP9blackHoleif
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x2c
	s_load_b32 s12, s[0:1], 0x8
	s_add_u32 s2, s0, 32
	s_addc_u32 s3, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s10, s4, 0xffff
	s_mov_b32 s4, exec_lo
	v_mad_u64_u32 v[1:2], null, s15, s10, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s12, v1
	s_cbranch_execz .LBB2_9
; %bb.1:                                ; %.preheader.lr.ph
	s_load_b128 s[4:7], s[0:1], 0x10
	s_load_b32 s11, s[2:3], 0x0
	s_load_b64 s[2:3], s[0:1], 0x0
	v_mov_b32_e32 v0, 0
	s_mov_b32 s8, 0x47ae147b
	s_mov_b32 s9, 0x3f847ae1
	s_mov_b32 s14, 0
	s_waitcnt lgkmcnt(0)
	s_cmp_gt_i32 s6, 0
	s_mul_i32 s1, s11, s10
	s_cselect_b32 s13, -1, 0
	s_add_u32 s4, s4, 4
	s_addc_u32 s5, s5, 0
.LBB2_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB2_4 Depth 2
	v_ashrrev_i32_e32 v2, 31, v1
	v_dual_mov_b32 v6, 0 :: v_dual_mov_b32 v7, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 4, v[1:2]
	v_add_co_u32 v2, vcc_lo, s2, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s3, v3, vcc_lo
	s_and_not1_b32 vcc_lo, exec_lo, s13
	global_load_b64 v[4:5], v[2:3], off
	s_cbranch_vccnz .LBB2_8
; %bb.3:                                ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB2_2 Depth=1
	v_dual_mov_b32 v6, 0 :: v_dual_mov_b32 v7, 0
	s_mov_b32 s15, 0
	s_mov_b32 s16, 1
	s_mov_b64 s[10:11], s[4:5]
.LBB2_4:                                ; %.lr.ph
                                        ;   Parent Loop BB2_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_b64 v[9:10], v0, s[10:11] offset:-4
	s_waitcnt vmcnt(0)
	v_dual_sub_f32 v9, v4, v9 :: v_dual_sub_f32 v8, v5, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_neq_f32_e32 vcc_lo, 0, v9
	v_cmp_neq_f32_e64 s0, 0, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s17, vcc_lo, s0
	s_and_saveexec_b32 s18, s17
	s_cbranch_execz .LBB2_6
; %bb.5:                                ;   in Loop: Header=BB2_4 Depth=2
	v_mul_f32_e32 v10, v8, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v10, v9, v9
	v_mul_f32_e32 v10, v10, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v11, 0x4f800000, v10
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v10
	v_cndmask_b32_e32 v10, v10, v11, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_sqrt_f32_e32 v11, v10
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v12, -1, v11
	v_add_nc_u32_e32 v13, 1, v11
	v_fma_f32 v14, -v12, v11, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v15, -v13, v11, v10
	v_cmp_ge_f32_e64 s0, 0, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v11, v11, v12, s0
	v_cmp_lt_f32_e64 s0, 0, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v11, v11, v13, s0
	v_mul_f32_e32 v12, 0x37800000, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v11, v11, v12, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v10, 0x260
	v_cndmask_b32_e32 v10, v11, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f32 v11, null, v10, v10, 1.0
	v_div_scale_f32 v14, vcc_lo, 1.0, v10, 1.0
	v_rcp_f32_e32 v12, v11
	s_waitcnt_depctr 0xfff
	v_fma_f32 v13, -v11, v12, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, v13, v12
	v_mul_f32_e32 v13, v14, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v15, -v11, v13, v14
	v_fmac_f32_e32 v13, v15, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v11, -v11, v13, v14
	v_div_fmas_f32 v11, v11, v12, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f32 v10, v11, v10, 1.0
	v_fmac_f32_e32 v6, v9, v10
	v_fmac_f32_e32 v7, v8, v10
.LBB2_6:                                ;   in Loop: Header=BB2_4 Depth=2
	s_or_b32 exec_lo, exec_lo, s18
	s_cmp_ge_i32 s16, s6
	s_cselect_b32 s0, -1, 0
	s_xor_b32 s17, s17, -1
	s_add_i32 s16, s16, 1
	s_or_b32 s0, s17, s0
	s_add_u32 s10, s10, 12
	s_addc_u32 s11, s11, 0
	s_and_b32 s0, exec_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s15, s0, s15
	s_and_not1_b32 exec_lo, exec_lo, s15
	s_cbranch_execnz .LBB2_4
; %bb.7:                                ; %Flow
                                        ;   in Loop: Header=BB2_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s15
.LBB2_8:                                ; %._crit_edge
                                        ;   in Loop: Header=BB2_2 Depth=1
	global_load_b64 v[8:9], v[2:3], off offset:8
	v_dual_mul_f32 v10, v6, v6 :: v_dual_add_nc_u32 v1, s1, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v10, v7, v7
	v_mul_f32_e32 v11, 0x4f800000, v10
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v10, v10, v11, vcc_lo
	v_sqrt_f32_e32 v11, v10
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v12, -1, v11
	v_add_nc_u32_e32 v13, 1, v11
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v14, -v12, v11, v10
	v_fma_f32 v15, -v13, v11, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, 0, v14
	v_cndmask_b32_e64 v11, v11, v12, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s0, 0, v15
	v_cndmask_b32_e64 v11, v11, v13, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v12, 0x37800000, v11
	v_cndmask_b32_e32 v11, v11, v12, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v10, 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v10, v11, v10, vcc_lo
	v_div_scale_f32 v11, null, v10, v10, v6
	v_div_scale_f32 v12, null, v10, v10, v7
	v_div_scale_f32 v17, vcc_lo, v6, v10, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v13, v11
	v_rcp_f32_e32 v14, v12
	s_waitcnt_depctr 0xfff
	v_fma_f32 v15, -v11, v13, 1.0
	v_fma_f32 v16, -v12, v14, 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v13, v15, v13
	v_div_scale_f32 v15, s0, v7, v10, v7
	v_fmac_f32_e32 v14, v16, v14
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v16, v17, v13
	v_mul_f32_e32 v18, v15, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v19, -v11, v16, v17
	v_fma_f32 v20, -v12, v18, v15
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v16, v19, v13
	v_fmac_f32_e32 v18, v20, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v11, -v11, v16, v17
	v_fma_f32 v12, -v12, v18, v15
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_fmas_f32 v11, v11, v13, v16
	s_mov_b32 vcc_lo, s0
	v_div_fmas_f32 v12, v12, v14, v18
	v_cmp_le_i32_e32 vcc_lo, s12, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_fixup_f32 v6, v11, v10, v6
	v_div_fixup_f32 v7, v12, v10, v7
	s_or_b32 s14, vcc_lo, s14
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v6, -v6, s7, v8
	v_fma_f32 v7, -v7, s7, v9
	v_cvt_f64_f32_e32 v[8:9], v4
	v_cvt_f64_f32_e32 v[4:5], v5
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cvt_f64_f32_e32 v[10:11], v6
	v_cvt_f64_f32_e32 v[12:13], v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[8:9], v[10:11], s[8:9], v[8:9]
	v_fma_f64 v[10:11], v[12:13], s[8:9], v[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f32_f64_e32 v4, v[8:9]
	v_cvt_f32_f64_e32 v5, v[10:11]
	global_store_b128 v[2:3], v[4:7], off
	s_and_not1_b32 exec_lo, exec_lo, s14
	s_cbranch_execnz .LBB2_2
.LBB2_9:                                ; %._crit_edge74
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19calculateAsteroidsKP8asteroidiP9blackHoleif
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 21
		.amdhsa_next_free_sgpr 19
		.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	_Z19calculateAsteroidsKP8asteroidiP9blackHoleif, .Lfunc_end2-_Z19calculateAsteroidsKP8asteroidiP9blackHoleif
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1036
; NumSgprs: 21
; NumVgprs: 21
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 21
; NumVGPRsForWavesPerEU: 21
; 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	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi ; -- Begin function _Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.globl	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
	.p2align	8
	.type	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi,@function
_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi: ; @_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b128 s[4:7], s[0:1], 0x18
	s_mov_b32 s10, 0
	s_mov_b32 s8, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s9, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s9, v[0:1]
	v_cmpx_eq_u32_e32 0, v1
	s_cbranch_execz .LBB3_15
; %bb.1:
	s_load_b64 s[2:3], s[0:1], 0x10
	s_ashr_i32 s7, s6, 31
	s_cmp_lt_u32 s6, 4
	s_cbranch_scc1 .LBB3_4
; %bb.2:                                ; %.lr.ph.i.i.preheader
	v_mov_b32_e32 v0, 0
.LBB3_3:                                ; %.lr.ph.i.i
                                        ; =>This Inner Loop Header: Depth=1
	s_waitcnt lgkmcnt(0)
	global_load_b32 v2, v0, s[2:3]
	s_add_u32 s6, s6, -4
	s_addc_u32 s7, s7, -1
	v_mov_b32_e32 v3, s10
	v_cmp_gt_u64_e64 s11, s[6:7], 3
	s_add_u32 s2, s2, 4
	s_addc_u32 s3, s3, 0
	s_add_i32 s10, s10, 4
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s11
	s_waitcnt vmcnt(0)
	v_lshrrev_b32_e32 v4, 8, v2
	v_lshrrev_b32_e32 v5, 24, v2
	ds_store_b8 v3, v2
	ds_store_b8 v3, v4 offset:1
	ds_store_b8_d16_hi v3, v2 offset:2
	ds_store_b8 v3, v5 offset:3
	s_cbranch_vccnz .LBB3_3
.LBB3_4:                                ; %NodeBlock115
	v_cmp_lt_i64_e64 s11, s[6:7], 2
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s11
	s_cbranch_vccnz .LBB3_10
; %bb.5:                                ; %NodeBlock
	v_cmp_gt_i64_e64 s11, s[6:7], 2
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s11
	s_mov_b32 s11, -1
	s_cbranch_vccz .LBB3_8
; %bb.6:                                ; %LeafBlock113
	s_cmp_eq_u64 s[6:7], 3
	s_mov_b32 s11, 0
	s_cbranch_scc0 .LBB3_8
; %bb.7:
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v2, s10
	s_mov_b32 s11, -1
	s_waitcnt lgkmcnt(0)
	global_load_u8 v0, v0, s[2:3] offset:2
	s_waitcnt vmcnt(0)
	ds_store_b8 v2, v0 offset:2
.LBB3_8:                                ; %Flow121
	s_mov_b32 s12, 0
	s_and_b32 vcc_lo, exec_lo, s11
	s_mov_b32 s11, 0
	s_cbranch_vccz .LBB3_11
; %bb.9:
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v2, s10
	s_mov_b32 s11, -1
	s_waitcnt lgkmcnt(0)
	global_load_u8 v0, v0, s[2:3] offset:1
	s_waitcnt vmcnt(0)
	ds_store_b8 v2, v0 offset:1
	s_branch .LBB3_11
.LBB3_10:
	s_mov_b32 s12, -1
	s_mov_b32 s11, 0
.LBB3_11:                               ; %Flow120
	s_and_b32 vcc_lo, exec_lo, s12
	s_cbranch_vccz .LBB3_13
; %bb.12:                               ; %LeafBlock
	s_cmp_eq_u64 s[6:7], 1
	s_cselect_b32 s11, -1, 0
.LBB3_13:                               ; %Flow124
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s11
	s_cbranch_vccnz .LBB3_15
; %bb.14:
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v2, s10
	s_waitcnt lgkmcnt(0)
	global_load_u8 v0, v0, s[2:3]
	s_waitcnt vmcnt(0)
	ds_store_b8 v2, v0
.LBB3_15:                               ; %Flow128
	s_or_b32 exec_lo, exec_lo, s8
	s_clause 0x1
	s_load_b32 s10, s[0:1], 0x28
	s_load_b32 s8, s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s8, v1
	s_cbranch_execz .LBB3_24
; %bb.16:                               ; %.preheader.lr.ph
	s_load_b64 s[2:3], s[0:1], 0x0
	s_cmp_gt_i32 s4, 0
	s_mov_b32 s6, 0x47ae147b
	s_mov_b32 s7, 0x3f847ae1
	s_cselect_b32 s1, -1, 0
	s_mul_i32 s9, s10, s9
	s_mov_b32 s10, 0
.LBB3_17:                               ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB3_19 Depth 2
	v_ashrrev_i32_e32 v2, 31, v1
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v6, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 4, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s2, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s3, v3, vcc_lo
	s_and_not1_b32 vcc_lo, exec_lo, s1
	global_load_b64 v[4:5], v[2:3], off
	s_cbranch_vccnz .LBB3_23
; %bb.18:                               ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB3_17 Depth=1
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v6, 0
	s_mov_b32 s11, 0
	s_mov_b32 s12, 1
	s_mov_b32 s13, 0
.LBB3_19:                               ; %.lr.ph
                                        ;   Parent Loop BB3_17 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v7, s13
	ds_load_2addr_b32 v[8:9], v7 offset1:1
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_sub_f32 v8, v4, v8 :: v_dual_sub_f32 v7, v5, v9
	v_cmp_neq_f32_e32 vcc_lo, 0, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_neq_f32_e64 s0, 0, v7
	s_and_b32 s14, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s15, s14
	s_cbranch_execz .LBB3_21
; %bb.20:                               ;   in Loop: Header=BB3_19 Depth=2
	v_mul_f32_e32 v9, v7, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v9, v8, v8
	v_mul_f32_e32 v9, v9, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v10, 0x4f800000, v9
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v9
	v_cndmask_b32_e32 v9, v9, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_sqrt_f32_e32 v10, v9
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v11, -1, v10
	v_add_nc_u32_e32 v12, 1, v10
	v_fma_f32 v13, -v11, v10, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v14, -v12, v10, v9
	v_cmp_ge_f32_e64 s0, 0, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v10, v10, v11, s0
	v_cmp_lt_f32_e64 s0, 0, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v10, v10, v12, s0
	v_mul_f32_e32 v11, 0x37800000, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v10, v10, v11, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v9, 0x260
	v_cndmask_b32_e32 v9, v10, v9, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f32 v10, null, v9, v9, 1.0
	v_div_scale_f32 v13, vcc_lo, 1.0, v9, 1.0
	v_rcp_f32_e32 v11, v10
	s_waitcnt_depctr 0xfff
	v_fma_f32 v12, -v10, v11, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v11, v12, v11
	v_mul_f32_e32 v12, v13, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v14, -v10, v12, v13
	v_fmac_f32_e32 v12, v14, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v10, -v10, v12, v13
	v_div_fmas_f32 v10, v10, v11, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f32 v9, v10, v9, 1.0
	v_fmac_f32_e32 v0, v8, v9
	v_fmac_f32_e32 v6, v7, v9
.LBB3_21:                               ;   in Loop: Header=BB3_19 Depth=2
	s_or_b32 exec_lo, exec_lo, s15
	s_cmp_ge_i32 s12, s4
	s_cselect_b32 s0, -1, 0
	s_xor_b32 s14, s14, -1
	s_add_i32 s12, s12, 1
	s_or_b32 s0, s14, s0
	s_add_i32 s13, s13, 12
	s_and_b32 s0, exec_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s11, s0, s11
	s_and_not1_b32 exec_lo, exec_lo, s11
	s_cbranch_execnz .LBB3_19
; %bb.22:                               ; %Flow
                                        ;   in Loop: Header=BB3_17 Depth=1
	s_or_b32 exec_lo, exec_lo, s11
.LBB3_23:                               ; %._crit_edge
                                        ;   in Loop: Header=BB3_17 Depth=1
	global_load_b64 v[7:8], v[2:3], off offset:8
	v_mul_f32_e32 v9, v0, v0
	v_add_nc_u32_e32 v1, s9, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v9, v6, v6
	v_mul_f32_e32 v10, 0x4f800000, v9
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v9, v9, v10, vcc_lo
	v_sqrt_f32_e32 v10, v9
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v11, -1, v10
	v_add_nc_u32_e32 v12, 1, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v13, -v11, v10, v9
	v_fma_f32 v14, -v12, v10, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, 0, v13
	v_cndmask_b32_e64 v10, v10, v11, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s0, 0, v14
	v_cndmask_b32_e64 v10, v10, v12, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v11, 0x37800000, v10
	v_cndmask_b32_e32 v10, v10, v11, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v9, 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v9, v10, v9, vcc_lo
	v_div_scale_f32 v10, null, v9, v9, v0
	v_div_scale_f32 v11, null, v9, v9, v6
	v_div_scale_f32 v16, vcc_lo, v0, v9, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v12, v10
	v_rcp_f32_e32 v13, v11
	s_waitcnt_depctr 0xfff
	v_fma_f32 v14, -v10, v12, 1.0
	v_fma_f32 v15, -v11, v13, 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v12, v14, v12
	v_div_scale_f32 v14, s0, v6, v9, v6
	v_fmac_f32_e32 v13, v15, v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v15, v16, v12
	v_mul_f32_e32 v17, v14, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v18, -v10, v15, v16
	v_fma_f32 v19, -v11, v17, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v15, v18, v12
	v_fmac_f32_e32 v17, v19, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v10, -v10, v15, v16
	v_fma_f32 v11, -v11, v17, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_fmas_f32 v10, v10, v12, v15
	s_mov_b32 vcc_lo, s0
	v_div_fmas_f32 v11, v11, v13, v17
	v_cmp_le_i32_e32 vcc_lo, s8, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_fixup_f32 v0, v10, v9, v0
	v_div_fixup_f32 v9, v11, v9, v6
	s_or_b32 s10, vcc_lo, s10
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v6, -v0, s5, v7
	v_fma_f32 v7, -v9, s5, v8
	v_cvt_f64_f32_e32 v[8:9], v4
	v_cvt_f64_f32_e32 v[4:5], v5
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cvt_f64_f32_e32 v[10:11], v6
	v_cvt_f64_f32_e32 v[12:13], v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[8:9], v[10:11], s[6:7], v[8:9]
	v_fma_f64 v[10:11], v[12:13], s[6:7], v[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f32_f64_e32 v4, v[8:9]
	v_cvt_f32_f64_e32 v5, v[10:11]
	global_store_b128 v[2:3], v[4:7], off
	s_and_not1_b32 exec_lo, exec_lo, s10
	s_cbranch_execnz .LBB3_17
.LBB3_24:                               ; %._crit_edge80
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.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 20
		.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_end3:
	.size	_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi, .Lfunc_end3-_Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1400
; NumSgprs: 18
; NumVgprs: 20
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 20
; 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
	.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
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z19calculateSpaceTimeKP10spacePointiiffffP9blackHolei.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     18
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         44
        .size:           4
        .value_kind:     by_value
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         168
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z22calculateSpaceTimeKSHMP10spacePointiiffffP9blackHoleii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     19
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z19calculateAsteroidsKP8asteroidiP9blackHoleif
    .private_segment_fixed_size: 0
    .sgpr_count:     21
    .sgpr_spill_count: 0
    .symbol:         _Z19calculateAsteroidsKP8asteroidiP9blackHoleif.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     21
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         160
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z22calculateAsteroidsKSHMP8asteroidiP9blackHoleifi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     20
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
