

/*
1. so vsi proteini enako dolgi ?
2. mutacija
*/
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <iostream>
#include <stdio.h>
#include <time.h>
#include <stdlib.h> 
#include <random>
#include <algorithm>
// dolzina proteina 5 - 256
#define maxLenProtein 256
#define minLenProtein 5
#define numProtein 210
#define Cr 6

cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size);

//nikamor je namjnen zgolj prvemu clenu
enum smer{nikamor, naprej, nazaj, gor, dol, levo, desno};
//enum smerobratno{nikamor, nazaj, naprej, dol, gor, desno, levo};
enum vrsta{H, P};

struct tocka {
    int x = 0;
    int y = 0;
    int z = 0;
};

struct protein
{
    int dolzinaProteina = maxLenProtein;
    int proteinSmer[maxLenProtein] = {0};
    bool proteinVrsta[maxLenProtein];
    struct tocka tocke [maxLenProtein];
    int hevristika = 0;
};

__global__ void addKernel(int *c, struct protein* Arr)
{
    int i = threadIdx.x;
    c[i] = Arr[i].proteinSmer[1];
}

bool enako(struct protein ena, struct protein dva) {
    bool enak = true;
    for (int i = 0; i < maxLenProtein; i++) {
        if (ena.proteinSmer[i] != dva.proteinSmer[i]) {
            return false;
        }
    }
    return true;
}

void tvori_mrezo(struct protein &prot) {
    for (int i = 0; i < maxLenProtein; i++) {
        struct tocka t;
        if (i != 0) {
            t = prot.tocke[i - 1];
        }
        
        if (prot.proteinSmer[i] == nikamor) {
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == naprej) {
            t.x++;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == nazaj) {
            t.x--;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == gor) {
            t.z++;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == dol) {
            t.z--;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == levo) {
            t.y++;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == desno) {
            t.y--;
            prot.tocke[i] = t;
        }
    }
}

bool cikelj(struct tocka a, struct tocka b) {
    if (a.x == b.x && a.y == b.y && a.z == b.z) {
        return true;
    }
    return false;
}

bool hevristicna_povezava(struct tocka a, struct tocka b) {

    //povezav za nazaj ni potrebno preverjati, saj tocke v katerih se isce pocvezava so vsaj 3 narazen
    if (a.x == b.x && a.y == b.y && (a.z == b.z + 1 || a.z == b.z - 1)) {
        return true;
    }
    if (a.x == b.x && a.z == b.z && (a.y == b.y + 1 || a.y == b.y - 1)) {
        return true;
    }
    if (a.z == b.z && a.y == b.y && (a.x == b.x + 1 || a.x == b.x - 1)) {
        return true;
    }

    return false;
}

void doloci_hevristiko(struct protein &prot) {
    int br = 0;
    prot.hevristika = 0;
    for (int i = 0; i < maxLenProtein-3; i++) {

        for (int j = i+3; j < maxLenProtein; j++) {
            if (cikelj(prot.tocke[i], prot.tocke[j])) {
                // v primeru cikla minus dolzina proteina
                prot.hevristika -= prot.dolzinaProteina;
            }

            if (prot.proteinVrsta[i] == H && prot.proteinVrsta[j] == H) {
                if (hevristicna_povezava(prot.tocke[i], prot.tocke[j])) {
                    prot.hevristika++;
                }
            }
        }
    }
}

int main()
{
    //struct protein *arr = new struct protein[numProtein];
    int nfes = 0;
    std::cin >> nfes;
    nfes *= 1000;
    int count = 0;
    struct protein arr1[numProtein];
    srand(5);
    for (int i = 0; i < numProtein; i++) {
        struct protein generiranProtein ;
        // generiramo dolzino proteina
        generiranProtein.dolzinaProteina = rand() %(maxLenProtein - minLenProtein) + minLenProtein;
        int prev = 20;
        int premik = 0;
        //tvorimo smeri proteina pri cemer preverjamo da netvorimo kontra strani od prejsne
        for ( int j = 0; j < generiranProtein.dolzinaProteina; j++) {

            generiranProtein.proteinSmer[j] = rand() % 6+1;
            if (prev % 2 == 0) {
                premik = -1;
            }
            else {
                premik = 1;
            }
            while (prev + premik == generiranProtein.proteinSmer[j]) {
               generiranProtein.proteinSmer[j] = rand() % 6+1;
            }
            prev = generiranProtein.proteinSmer[j];


            generiranProtein.proteinVrsta[j] = rand() % 2;
        }
        arr1[i] = generiranProtein;
    }

    while (count < nfes) {

        for (int i = 0; i < numProtein; i++) {

            // KRIZANJE
            int r1 = rand() % numProtein;

            while (r1 == i)
            {
                r1 = rand() % numProtein;
            }

            struct protein generiranProtein1;
            struct protein generiranProtein2; 
            
            struct protein najdenI = arr1[i];
            struct protein najdenR1 = arr1[r1];

            int crospoint = 0;
            if (najdenI.dolzinaProteina < najdenR1.dolzinaProteina) {
                crospoint = najdenI.dolzinaProteina;
            }
            else {
                crospoint = najdenR1.dolzinaProteina;
            }
            crospoint -= 3;
            int crosoverPoint = rand() % crospoint + 3;

            
            std::copy(najdenI.proteinSmer, najdenI.proteinSmer + crosoverPoint, generiranProtein1.proteinSmer);
            std::copy(najdenR1.proteinSmer + crosoverPoint, najdenR1.proteinSmer + najdenR1.dolzinaProteina, generiranProtein1.proteinSmer + crosoverPoint);

            std::copy(najdenI.proteinVrsta, najdenI.proteinVrsta + crosoverPoint, generiranProtein1.proteinVrsta);
            std::copy(najdenR1.proteinVrsta + crosoverPoint, najdenR1.proteinVrsta + najdenR1.dolzinaProteina, generiranProtein1.proteinVrsta + crosoverPoint);

            generiranProtein1.dolzinaProteina = najdenR1.dolzinaProteina;
            

            std::copy(najdenR1.proteinSmer, najdenR1.proteinSmer + crosoverPoint, generiranProtein2.proteinSmer);
            std::copy(najdenI.proteinSmer + crosoverPoint, najdenI.proteinSmer + najdenI.dolzinaProteina, generiranProtein2.proteinSmer + crosoverPoint);

            std::copy(najdenR1.proteinVrsta, najdenR1.proteinVrsta + crosoverPoint, generiranProtein2.proteinVrsta);
            std::copy(najdenI.proteinVrsta + crosoverPoint, najdenI.proteinVrsta + najdenI.dolzinaProteina, generiranProtein2.proteinVrsta + crosoverPoint);

            generiranProtein2.dolzinaProteina = najdenI.dolzinaProteina;
            /*
            for (int j = 0; j < maxLenProtein; j++)
            {
                if (crosoverPoint < j)
                {
                    // memory copy std::copy
                    generiranProtein1.proteinSmer[j] = arr1[i].proteinSmer[j];
                    generiranProtein1.proteinVrsta[j] = arr1[i].proteinVrsta[j];
                     generiranProtein2.dolzinaProteina = arr1[i].dolzinaProteina;generiranProtein2.dolzinaProteina = arr1[i].dolzinaProteina;
                    generiranProtein2.proteinSmer[j] = arr1[r1].proteinSmer[j];
                    generiranProtein2.proteinVrsta[j] = arr1[r1].proteinVrsta[j];

                }
                else {
                    generiranProtein1.proteinSmer[j] = arr1[r1].proteinSmer[j];
                    generiranProtein1.proteinVrsta[j] = arr1[r1].proteinVrsta[j];
                    generiranProtein2.dolzinaProteina = arr1[i].dolzinaProteina;generiranProtein2.dolzinaProteina = arr1[i].dolzinaProteina;
                    generiranProtein2.proteinSmer[j] = arr1[i].proteinSmer[j];
                    generiranProtein2.proteinVrsta[j] = arr1[i].proteinVrsta[j];
                }
            }
            */
            if (enako(generiranProtein1, najdenI) || enako(generiranProtein1, najdenR1) || rand() % 100 < 2) {

                int tockaObrta1 = rand() % generiranProtein1.dolzinaProteina;
                int tockaObrta2 = rand() % generiranProtein1.dolzinaProteina;
                int tockaObrta3 = rand() % generiranProtein1.dolzinaProteina;
                int premik = 0;

                generiranProtein1.proteinSmer[tockaObrta1] = rand() % 6+1;
                if (generiranProtein1.proteinSmer[tockaObrta1 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein1.proteinSmer[tockaObrta1 - 1] + premik == generiranProtein1.proteinSmer[tockaObrta1]) {
                    generiranProtein1.proteinSmer[tockaObrta1 - 1] = rand() % 6+1;
                }

                generiranProtein1.proteinSmer[tockaObrta2] = rand() % 6+1;
                if (generiranProtein1.proteinSmer[tockaObrta2 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein1.proteinSmer[tockaObrta2 - 1] + premik == generiranProtein1.proteinSmer[tockaObrta2]) {
                    generiranProtein1.proteinSmer[tockaObrta2 - 1] = rand() % 6+1;
                }

                generiranProtein1.proteinSmer[tockaObrta3] = rand() % 6+1;
                if (generiranProtein1.proteinSmer[tockaObrta3 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein1.proteinSmer[tockaObrta3 - 1] + premik == generiranProtein1.proteinSmer[tockaObrta3]) {
                    generiranProtein1.proteinSmer[tockaObrta3 - 1] = rand() % 6+1;
                }

                generiranProtein1.proteinVrsta[tockaObrta1] = rand() % 2;
                generiranProtein1.proteinVrsta[tockaObrta2] = rand() % 2;
                generiranProtein1.proteinVrsta[tockaObrta3] = rand() % 2;

            }
            if (enako(generiranProtein2, najdenI) || enako(generiranProtein2, najdenR1) || rand() % 100 < 1) {
                int tockaObrta1 = rand() % generiranProtein2.dolzinaProteina;
                int tockaObrta2 = rand() % generiranProtein2.dolzinaProteina;
                int tockaObrta3 = rand() % generiranProtein2.dolzinaProteina;
                int premik = 0;
                generiranProtein2.proteinSmer[tockaObrta1] = rand() % 6+1;
                if (generiranProtein2.proteinSmer[tockaObrta1 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein2.proteinSmer[tockaObrta1 - 1] + premik == generiranProtein2.proteinSmer[tockaObrta1]) {
                    generiranProtein2.proteinSmer[tockaObrta1 - 1] = rand() % 6+1;
                }

                generiranProtein2.proteinSmer[tockaObrta2] = rand() % 6+1;
                if (generiranProtein2.proteinSmer[tockaObrta2 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein2.proteinSmer[tockaObrta2 - 1] + premik == generiranProtein2.proteinSmer[tockaObrta2]) {
                    generiranProtein2.proteinSmer[tockaObrta2 - 1] = rand() % 6+1;
                }

                generiranProtein2.proteinSmer[tockaObrta3] = rand() % 6+1;
                if (generiranProtein2.proteinSmer[tockaObrta3 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein2.proteinSmer[tockaObrta3 - 1] + premik == generiranProtein2.proteinSmer[tockaObrta3]) {
                    generiranProtein2.proteinSmer[tockaObrta3 - 1] = rand() % 6+1;
                }

                generiranProtein2.proteinVrsta[tockaObrta1] = rand() % 2;
                generiranProtein2.proteinVrsta[tockaObrta2] = rand() % 2;
                generiranProtein2.proteinVrsta[tockaObrta3] = rand() % 2;

            }

            tvori_mrezo(generiranProtein1);
            tvori_mrezo(generiranProtein2);
            tvori_mrezo(najdenI);

            doloci_hevristiko(generiranProtein1);
            doloci_hevristiko(generiranProtein2);
            doloci_hevristiko(najdenI);
            
            if ( generiranProtein1.hevristika > generiranProtein2.hevristika) {
                if (najdenI.hevristika < generiranProtein1.hevristika) {
                    arr1[i] = generiranProtein1;
                }
            }
            else {
                if (najdenI.hevristika < generiranProtein2.hevristika) {
                    arr1[i] = generiranProtein2;
                }
            }

            count++;
        }
    }
   













    int c[10] = {0};

    printf(" {%d,%d,%d,%d,%d,%d,%d}\n",
        arr1[1].proteinSmer[1], arr1[2].proteinSmer[1], arr1[3].proteinSmer[1], arr1[4].proteinSmer[1], arr1[5].proteinSmer[1], arr1[6].proteinSmer[1], arr1[7].proteinSmer[1]);
    printf(" {%d,%d,%d,%d,%d,%d,%d}\n",
        c[0], c[1], c[2], c[3], c[4], c[5], c[6]);
    // Add vectors in parallel.
    int* dev_b = 0;
    struct protein* arrr = 0;
    cudaSetDevice(0);
    cudaMalloc((void**)&dev_b, 10 * sizeof(int));
    cudaMalloc((void**)&arrr, 10 * sizeof(struct protein));
    cudaMemcpy(arrr, arr1, 10 * sizeof(struct protein), cudaMemcpyHostToDevice);
    addKernel <<<1, 10 >>> (dev_b, arrr);

    cudaMemcpy(c, dev_b, 10 * sizeof(int), cudaMemcpyDeviceToHost);
    printf(" {%d,%d,%d,%d,%d,%d,%d}\n",
        c[0], c[1], c[2], c[3], c[4], c[5], c[6]);

    cudaFree(c);
    cudaFree(arrr);
    cudaFree(dev_b);

    return 0;
}

// Helper function for using CUDA to add vectors in parallel.

    
	.file	"tmpxft_0028c44c_00000000-6_kernel.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4950:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4950:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_ZSt4copyIPbS0_ET0_T_S2_S1_.isra.0, @function
_ZSt4copyIPbS0_ET0_T_S2_S1_.isra.0:
.LFB5650:
	.cfi_startproc
	movq	%rdi, %rax
	movq	%rdx, %rdi
	subq	%rax, %rsi
	movq	%rsi, %rdx
	cmpq	$1, %rsi
	jle	.L3
	movq	%rax, %rsi
	jmp	memmove@PLT
.L3:
	jne	.L2
	movb	(%rax), %al
	movb	%al, (%rdi)
.L2:
	ret
	.cfi_endproc
.LFE5650:
	.size	_ZSt4copyIPbS0_ET0_T_S2_S1_.isra.0, .-_ZSt4copyIPbS0_ET0_T_S2_S1_.isra.0
	.type	_ZSt4copyIPiS0_ET0_T_S2_S1_.isra.0, @function
_ZSt4copyIPiS0_ET0_T_S2_S1_.isra.0:
.LFB5652:
	.cfi_startproc
	movq	%rdi, %rax
	movq	%rdx, %rdi
	subq	%rax, %rsi
	movq	%rsi, %rdx
	cmpq	$4, %rsi
	jle	.L7
	movq	%rax, %rsi
	jmp	memmove@PLT
.L7:
	jne	.L6
	movl	(%rax), %eax
	movl	%eax, (%rdi)
.L6:
	ret
	.cfi_endproc
.LFE5652:
	.size	_ZSt4copyIPiS0_ET0_T_S2_S1_.isra.0, .-_ZSt4copyIPiS0_ET0_T_S2_S1_.isra.0
	.globl	_Z5enako7proteinS_
	.type	_Z5enako7proteinS_, @function
_Z5enako7proteinS_:
.LFB4936:
	.cfi_startproc
	endbr64
	movl	$4, %eax
	leaq	4368(%rsp), %rdx
.L11:
	movl	(%rdx,%rax), %ecx
	cmpl	%ecx, 8(%rsp,%rax)
	jne	.L12
	addq	$4, %rax
	cmpq	$1028, %rax
	jne	.L11
	movb	$1, %al
	ret
.L12:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE4936:
	.size	_Z5enako7proteinS_, .-_Z5enako7proteinS_
	.globl	_Z11tvori_mrezoR7protein
	.type	_Z11tvori_mrezoR7protein, @function
_Z11tvori_mrezoR7protein:
.LFB4937:
	.cfi_startproc
	endbr64
	leaq	1272(%rdi), %rax
	xorl	%r9d, %r9d
.L23:
	testq	%r9, %r9
	je	.L24
	movl	(%rax), %esi
	movl	4(%rax), %ecx
	movl	8(%rax), %edx
	jmp	.L15
.L24:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%esi, %esi
.L15:
	movl	4(%rdi,%r9,4), %r8d
	testl	%r8d, %r8d
	je	.L28
	cmpl	$1, %r8d
	jne	.L18
	incl	%esi
.L28:
	movl	%esi, 12(%rax)
	jmp	.L27
.L18:
	cmpl	$2, %r8d
	jne	.L20
	decl	%esi
	jmp	.L28
.L20:
	cmpl	$3, %r8d
	jne	.L21
	movl	%esi, 12(%rax)
	incl	%edx
	movl	%ecx, 16(%rax)
	jmp	.L26
.L21:
	cmpl	$4, %r8d
	jne	.L17
	movl	%esi, 12(%rax)
	decl	%edx
	movl	%ecx, 16(%rax)
	jmp	.L26
.L17:
	cmpl	$5, %r8d
	jne	.L19
	movl	%esi, 12(%rax)
	incl	%ecx
	jmp	.L27
.L19:
	cmpl	$6, %r8d
	jne	.L22
	movl	%esi, 12(%rax)
	decl	%ecx
.L27:
	movl	%ecx, 16(%rax)
.L26:
	movl	%edx, 20(%rax)
.L22:
	incq	%r9
	addq	$12, %rax
	cmpq	$256, %r9
	jne	.L23
	ret
	.cfi_endproc
.LFE4937:
	.size	_Z11tvori_mrezoR7protein, .-_Z11tvori_mrezoR7protein
	.globl	_Z6cikelj5tockaS_
	.type	_Z6cikelj5tockaS_, @function
_Z6cikelj5tockaS_:
.LFB4941:
	.cfi_startproc
	endbr64
	movq	%rdi, -16(%rsp)
	xorl	%eax, %eax
	movq	%rdx, -32(%rsp)
	movl	%ecx, -24(%rsp)
	cmpl	%edi, %edx
	jne	.L29
	movl	-28(%rsp), %ecx
	cmpl	%ecx, -12(%rsp)
	jne	.L29
	cmpl	-24(%rsp), %esi
	sete	%al
.L29:
	ret
	.cfi_endproc
.LFE4941:
	.size	_Z6cikelj5tockaS_, .-_Z6cikelj5tockaS_
	.globl	_Z20hevristicna_povezava5tockaS_
	.type	_Z20hevristicna_povezava5tockaS_, @function
_Z20hevristicna_povezava5tockaS_:
.LFB4942:
	.cfi_startproc
	endbr64
	movq	%rdi, -16(%rsp)
	movl	%edi, %r9d
	movl	%edx, %edi
	movq	%rdx, -32(%rsp)
	movl	-12(%rsp), %edx
	movl	-28(%rsp), %r8d
	cmpl	%edi, %r9d
	jne	.L34
	cmpl	%r8d, %edx
	jne	.L35
	leal	1(%rcx), %r10d
	movb	$1, %al
	cmpl	%esi, %r10d
	je	.L33
	leal	-1(%rcx), %r10d
	cmpl	%esi, %r10d
	jne	.L46
	ret
.L35:
	xorl	%eax, %eax
	cmpl	%ecx, %esi
	jne	.L33
	leal	1(%r8), %r10d
	movb	$1, %al
	cmpl	%edx, %r10d
	je	.L33
	leal	-1(%r8), %r10d
	cmpl	%edx, %r10d
	je	.L33
.L34:
	cmpl	%r8d, %edx
	sete	%al
	cmpl	%ecx, %esi
	sete	%dl
	andb	%dl, %al
	je	.L33
	leal	1(%rdi), %edx
	cmpl	%r9d, %edx
	je	.L33
	decl	%edi
	cmpl	%r9d, %edi
	sete	%al
	ret
.L46:
	cmpl	%ecx, %esi
	je	.L34
	xorl	%eax, %eax
.L33:
	ret
	.cfi_endproc
.LFE4942:
	.size	_Z20hevristicna_povezava5tockaS_, .-_Z20hevristicna_povezava5tockaS_
	.globl	_Z17doloci_hevristikoR7protein
	.type	_Z17doloci_hevristikoR7protein, @function
_Z17doloci_hevristikoR7protein:
.LFB4943:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r11
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	movl	%eax, 4356(%rdi)
.L51:
	movslq	%ebx, %r12
	movb	1028(%r11,%rbx), %r13b
	leaq	3(%rbx), %rbp
	imulq	$12, %r12, %r12
	addq	%r11, %r12
.L50:
	movslq	%ebp, %rax
	movq	1284(%r12), %rdi
	movl	1292(%r12), %esi
	movslq	%ebp, %r8
	imulq	$12, %rax, %rax
	leaq	1280(%r11,%rax), %rax
	movq	4(%rax), %rdx
	movl	12(%rax), %ecx
	call	_Z6cikelj5tockaS_
	testb	%al, %al
	je	.L48
	movl	(%r11), %eax
	subl	%eax, 4356(%r11)
.L48:
	testb	%r13b, %r13b
	jne	.L49
	cmpb	$0, 1028(%r11,%rbp)
	jne	.L49
	imulq	$12, %r8, %r8
	movq	1284(%r12), %rdi
	movl	1292(%r12), %esi
	leaq	1280(%r11,%r8), %rax
	movq	4(%rax), %rdx
	movl	12(%rax), %ecx
	call	_Z20hevristicna_povezava5tockaS_
	testb	%al, %al
	je	.L49
	incl	4356(%r11)
.L49:
	incq	%rbp
	cmpl	$256, %ebp
	jne	.L50
	incq	%rbx
	cmpq	$253, %rbx
	jne	.L51
	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
	.cfi_endproc
.LFE4943:
	.size	_Z17doloci_hevristikoR7protein, .-_Z17doloci_hevristikoR7protein
	.section	.text._ZN7proteinC2Ev,"axG",@progbits,_ZN7proteinC5Ev,comdat
	.align 2
	.weak	_ZN7proteinC2Ev
	.type	_ZN7proteinC2Ev, @function
_ZN7proteinC2Ev:
.LFB4946:
	.cfi_startproc
	endbr64
	movl	$256, (%rdi)
	movq	%rdi, %rdx
	xorl	%eax, %eax
	leaq	4(%rdi), %rdi
	movl	$256, %ecx
	rep stosl
	leaq	1284(%rdx), %rdi
	movl	$768, %ecx
	rep stosl
	xorl	%eax, %eax
	movl	%eax, 4356(%rdx)
	ret
	.cfi_endproc
.LFE4946:
	.size	_ZN7proteinC2Ev, .-_ZN7proteinC2Ev
	.weak	_ZN7proteinC1Ev
	.set	_ZN7proteinC1Ev,_ZN7proteinC2Ev
	.text
	.globl	_Z37__device_stub__Z9addKernelPiP7proteinPiP7protein
	.type	_Z37__device_stub__Z9addKernelPiP7proteinPiP7protein, @function
_Z37__device_stub__Z9addKernelPiP7proteinPiP7protein:
.LFB4972:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L62
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z9addKernelPiP7protein(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L62:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L64
	call	__stack_chk_fail@PLT
.L64:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4972:
	.size	_Z37__device_stub__Z9addKernelPiP7proteinPiP7protein, .-_Z37__device_stub__Z9addKernelPiP7proteinPiP7protein
	.globl	_Z9addKernelPiP7protein
	.type	_Z9addKernelPiP7protein, @function
_Z9addKernelPiP7protein:
.LFB4973:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z9addKernelPiP7proteinPiP7protein
	.cfi_endproc
.LFE4973:
	.size	_Z9addKernelPiP7protein, .-_Z9addKernelPiP7protein
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" {%d,%d,%d,%d,%d,%d,%d}\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB4944:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-937984(%rsp), %r11
	.cfi_def_cfa 11, 938040
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3944, %rsp
	.cfi_def_cfa_offset 941984
	xorl	%r8d, %r8d
	leaq	_ZSt3cin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 941912(%rsp)
	xorl	%eax, %eax
	leaq	108(%rsp), %rsi
	movl	%r8d, 108(%rsp)
	leaq	941912(%rsp), %r15
	call	_ZNSirsERi@PLT
	imull	$1000, 108(%rsp), %eax
	movl	%eax, 108(%rsp)
	leaq	26312(%rsp), %rax
	movq	%rax, 24(%rsp)
	movq	%rax, %rbx
.L68:
	movq	%rbx, %rdi
	addq	$4360, %rbx
	call	_ZN7proteinC1Ev
	cmpq	%r15, %rbx
	jne	.L68
	movl	$5, %edi
	leaq	21952(%rsp), %r12
	call	srand@PLT
	movq	24(%rsp), %rbx
.L75:
	movq	%r12, %rdi
	xorl	%ebp, %ebp
	movl	$6, %r14d
	call	_ZN7proteinC1Ev
	call	rand@PLT
	movl	$251, %ecx
	cltd
	idivl	%ecx
	movl	$20, %ecx
	leal	5(%rdx), %r13d
	movl	%r13d, 21952(%rsp)
.L69:
	cmpl	%ebp, %r13d
	jle	.L135
	movl	%ecx, (%rsp)
	call	rand@PLT
	movl	(%rsp), %ecx
	cltd
	idivl	%r14d
	movl	%ecx, %eax
	incl	%edx
	andl	$1, %eax
	jne	.L71
	orl	$-1, %eax
.L71:
	addl	%ecx, %eax
	movl	%eax, (%rsp)
.L72:
	movl	%edx, 4(%r12,%rbp,4)
	cmpl	%edx, (%rsp)
	jne	.L136
	call	rand@PLT
	cltd
	idivl	%r14d
	incl	%edx
	jmp	.L72
.L136:
	movl	%edx, (%rsp)
	call	rand@PLT
	movl	%eax, %ecx
	leaq	22980(%rsp,%rbp), %rax
	incq	%rbp
	movb	%cl, (%rax)
	movl	(%rsp), %ecx
	andb	$1, (%rax)
	jmp	.L69
.L135:
	movq	%rbx, %rdi
	addq	$4360, %rbx
	movl	$1090, %ecx
	movq	%r12, %rsi
	rep movsl
	cmpq	%r15, %rbx
	jne	.L75
	xorl	%edi, %edi
	movl	%edi, 60(%rsp)
.L76:
	movl	60(%rsp), %eax
	cmpl	%eax, 108(%rsp)
	jle	.L137
	movq	24(%rsp), %rax
	xorl	%esi, %esi
	movl	%esi, 56(%rsp)
	movq	%rax, 8(%rsp)
.L78:
	call	rand@PLT
	movl	$210, %ebx
	cltd
	idivl	%ebx
	movl	56(%rsp), %eax
	cmpl	%eax, %edx
	je	.L78
	leaq	152(%rsp), %rax
	movl	%edx, 16(%rsp)
	leaq	156(%rsp), %r12
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	leaq	13236(%rsp), %r15
	call	_ZN7proteinC1Ev
	leaq	4512(%rsp), %rdi
	call	_ZN7proteinC1Ev
	movslq	16(%rsp), %rdx
	movq	8(%rsp), %rsi
	leaq	8872(%rsp), %rdi
	movl	$1090, %ecx
	rep movsl
	imulq	$4360, %rdx, %rdx
	leaq	13232(%rsp), %rdi
	movl	$1090, %ecx
	movl	8872(%rsp), %ebp
	leaq	26312(%rsp,%rdx), %rsi
	rep movsl
	movl	13232(%rsp), %eax
	cmpl	%eax, %ebp
	cmovg	%eax, %ebp
	call	rand@PLT
	leaq	8876(%rsp), %r9
	subl	$3, %ebp
	cltd
	movq	%r9, %rdi
	movq	%r9, 88(%rsp)
	idivl	%ebp
	leaq	8872(%rsp), %rax
	movq	%rax, 64(%rsp)
	addl	$3, %edx
	movslq	%edx, %rbx
	movq	%r12, %rdx
	leaq	0(,%rbx,4), %r14
	leaq	(%r9,%r14), %rax
	movq	%rax, %rsi
	movq	%rax, 16(%rsp)
	call	_ZSt4copyIPiS0_ET0_T_S2_S1_.isra.0
	leaq	(%r15,%r14), %rax
	leaq	(%r12,%r14), %rdx
	movslq	13232(%rsp), %r13
	movq	%rax, %rdi
	movq	%rax, 32(%rsp)
	leaq	1180(%rsp), %r12
	leaq	(%r15,%r13,4), %rsi
	movq	%r13, %rbp
	call	_ZSt4copyIPiS0_ET0_T_S2_S1_.isra.0
	leaq	9900(%rsp), %rax
	movq	%r12, %rdx
	leaq	(%rax,%rbx), %rdi
	movq	%rax, 80(%rsp)
	movq	%rdi, %rsi
	movq	%rdi, 40(%rsp)
	movq	%rax, %rdi
	call	_ZSt4copyIPbS0_ET0_T_S2_S1_.isra.0
	leaq	14260(%rsp), %r8
	leaq	(%r12,%rbx), %rdx
	leaq	(%r8,%rbx), %rax
	leaq	(%r8,%r13), %rsi
	movq	%r8, 72(%rsp)
	movq	%rax, %rdi
	movq	%rax, 48(%rsp)
	call	_ZSt4copyIPbS0_ET0_T_S2_S1_.isra.0
	movl	%r13d, 152(%rsp)
	movq	32(%rsp), %rsi
	movq	%r15, %rdi
	leaq	4516(%rsp), %r13
	movq	%r13, %rdx
	call	_ZSt4copyIPiS0_ET0_T_S2_S1_.isra.0
	movq	88(%rsp), %r9
	movq	16(%rsp), %rdi
	leaq	0(%r13,%r14), %rdx
	movslq	8872(%rsp), %r15
	leaq	5540(%rsp), %r13
	leaq	(%r9,%r15,4), %rsi
	movq	%r15, %r12
	call	_ZSt4copyIPiS0_ET0_T_S2_S1_.isra.0
	movq	48(%rsp), %rsi
	movq	72(%rsp), %rdi
	movq	%r13, %rdx
	call	_ZSt4copyIPbS0_ET0_T_S2_S1_.isra.0
	movq	80(%rsp), %rax
	movq	40(%rsp), %rdi
	leaq	0(%r13,%rbx), %rdx
	leaq	21952(%rsp), %rbx
	leaq	(%rax,%r15), %rsi
	call	_ZSt4copyIPbS0_ET0_T_S2_S1_.isra.0
	movq	(%rsp), %rsi
	leaq	17592(%rsp), %rdi
	movl	$1090, %ecx
	rep movsl
	movq	64(%rsp), %rsi
	leaq	21952(%rsp), %rdi
	movl	$1090, %ecx
	rep movsl
	movl	%r15d, 4512(%rsp)
	movl	$4, %eax
	leaq	13232(%rsp), %r8
	leaq	17592(%rsp), %rdx
.L80:
	movl	(%rbx,%rax), %edi
	cmpl	%edi, (%rdx,%rax)
	jne	.L79
	addq	$4, %rax
	cmpq	$1028, %rax
	jne	.L80
.L121:
	call	rand@PLT
	cltd
	idivl	%ebp
	movslq	%edx, %r13
	call	rand@PLT
	cltd
	idivl	%ebp
	movl	%edx, %r15d
	call	rand@PLT
	cltd
	idivl	%ebp
	leal	-1(%r13), %ebp
	movl	%edx, %r14d
	call	rand@PLT
	movl	$6, %ecx
	movslq	%r13d, %rsi
	cltd
	idivl	%ecx
	movslq	%ebp, %rax
	incl	%edx
	movl	%edx, 156(%rsp,%rsi,4)
	movl	156(%rsp,%rax,4), %ecx
	andl	$1, %ecx
	jne	.L83
	orl	$-1, %ecx
.L83:
	movslq	%ebp, %rbp
.L87:
	movl	156(%rsp,%rbp,4), %edx
	movslq	%r13d, %rax
	addl	%ecx, %edx
	cmpl	156(%rsp,%rax,4), %edx
	jne	.L138
	movl	%ecx, 16(%rsp)
	call	rand@PLT
	movl	$6, %esi
	movl	16(%rsp), %ecx
	cltd
	idivl	%esi
	incl	%edx
	movl	%edx, 156(%rsp,%rbp,4)
	jmp	.L87
.L138:
	call	rand@PLT
	movl	$6, %ecx
	movslq	%r15d, %rsi
	cltd
	idivl	%ecx
	leal	-1(%r15), %ecx
	movslq	%ecx, %rax
	incl	%edx
	movl	%edx, 156(%rsp,%rsi,4)
	movl	156(%rsp,%rax,4), %esi
	andl	$1, %esi
	jne	.L90
	orl	$-1, %esi
.L90:
	movslq	%ecx, %rcx
.L91:
	movl	156(%rsp,%rcx,4), %eax
	movslq	%r15d, %rbp
	addl	%esi, %eax
	cmpl	156(%rsp,%rbp,4), %eax
	jne	.L139
	movq	%rcx, 32(%rsp)
	movl	%esi, 16(%rsp)
	call	rand@PLT
	movl	$6, %edi
	movq	32(%rsp), %rcx
	movl	16(%rsp), %esi
	cltd
	idivl	%edi
	incl	%edx
	movl	%edx, 156(%rsp,%rcx,4)
	jmp	.L91
.L139:
	call	rand@PLT
	movl	$6, %ecx
	movslq	%r14d, %rsi
	cltd
	idivl	%ecx
	leal	-1(%r14), %ecx
	movslq	%ecx, %rax
	incl	%edx
	movl	%edx, 156(%rsp,%rsi,4)
	movl	156(%rsp,%rax,4), %esi
	andl	$1, %esi
	jne	.L94
	orl	$-1, %esi
.L94:
	movslq	%ecx, %rcx
.L95:
	movl	156(%rsp,%rcx,4), %eax
	movslq	%r14d, %r15
	addl	%esi, %eax
	cmpl	156(%rsp,%r15,4), %eax
	jne	.L140
	movq	%rcx, 32(%rsp)
	movl	%esi, 16(%rsp)
	call	rand@PLT
	movl	$6, %edi
	movq	32(%rsp), %rcx
	movl	16(%rsp), %esi
	cltd
	idivl	%edi
	incl	%edx
	movl	%edx, 156(%rsp,%rcx,4)
	jmp	.L95
.L140:
	call	rand@PLT
	movb	%al, 1180(%rsp,%r13)
	andb	$1, 1180(%rsp,%r13)
	call	rand@PLT
	movb	%al, 1180(%rsp,%rbp)
	andb	$1, 1180(%rsp,%rbp)
	call	rand@PLT
	movb	%al, 1180(%rsp,%r15)
	andb	$1, 1180(%rsp,%r15)
.L122:
	leaq	17592(%rsp), %rdi
	movl	$1090, %ecx
	leaq	4512(%rsp), %rsi
	movl	$4, %eax
	rep movsl
	movl	$1090, %ecx
	leaq	8872(%rsp), %rsi
	movq	%rbx, %rdi
	rep movsl
	leaq	4512(%rsp), %rdi
	leaq	8872(%rsp), %r14
	movq	%rdi, 16(%rsp)
	leaq	17592(%rsp), %rdx
.L98:
	movl	(%rbx,%rax), %edi
	cmpl	%edi, (%rdx,%rax)
	jne	.L97
	addq	$4, %rax
	cmpq	$1028, %rax
	jne	.L98
.L119:
	call	rand@PLT
	cltd
	idivl	%r12d
	movslq	%edx, %rbx
	call	rand@PLT
	cltd
	idivl	%r12d
	movl	%edx, %r15d
	call	rand@PLT
	cltd
	idivl	%r12d
	leal	-1(%rbx), %r12d
	movl	%edx, %r13d
	call	rand@PLT
	movl	$6, %ecx
	movslq	%ebx, %rsi
	cltd
	idivl	%ecx
	movslq	%r12d, %rax
	incl	%edx
	movl	%edx, 4516(%rsp,%rsi,4)
	movl	4516(%rsp,%rax,4), %ecx
	andl	$1, %ecx
	movl	%ecx, %ebp
	jne	.L101
	orl	$-1, %ebp
.L101:
	movslq	%r12d, %r12
.L105:
	movl	4516(%rsp,%r12,4), %edx
	movslq	%ebx, %rax
	addl	%ebp, %edx
	cmpl	4516(%rsp,%rax,4), %edx
	jne	.L141
	call	rand@PLT
	movl	$6, %esi
	cltd
	idivl	%esi
	incl	%edx
	movl	%edx, 4516(%rsp,%r12,4)
	jmp	.L105
.L141:
	call	rand@PLT
	movl	$6, %ecx
	movslq	%r15d, %rsi
	cltd
	idivl	%ecx
	leal	-1(%r15), %ecx
	movslq	%ecx, %rax
	incl	%edx
	movl	%edx, 4516(%rsp,%rsi,4)
	movl	4516(%rsp,%rax,4), %esi
	andl	$1, %esi
	jne	.L108
	orl	$-1, %esi
.L108:
	movslq	%ecx, %rbp
.L109:
	movl	4516(%rsp,%rbp,4), %eax
	movslq	%r15d, %r12
	addl	%esi, %eax
	cmpl	4516(%rsp,%r12,4), %eax
	jne	.L142
	movl	%esi, 32(%rsp)
	call	rand@PLT
	movl	$6, %edi
	movl	32(%rsp), %esi
	cltd
	idivl	%edi
	incl	%edx
	movl	%edx, 4516(%rsp,%rbp,4)
	jmp	.L109
.L142:
	call	rand@PLT
	movl	$6, %ecx
	leal	-1(%r13), %r15d
	movslq	%r13d, %rsi
	cltd
	idivl	%ecx
	movslq	%r15d, %rax
	incl	%edx
	movl	%edx, 4516(%rsp,%rsi,4)
	movl	4516(%rsp,%rax,4), %ecx
	andl	$1, %ecx
	jne	.L112
	orl	$-1, %ecx
.L112:
	movslq	%r15d, %r15
.L113:
	movl	4516(%rsp,%r15,4), %eax
	movslq	%r13d, %rbp
	addl	%ecx, %eax
	cmpl	4516(%rsp,%rbp,4), %eax
	jne	.L143
	movl	%ecx, 32(%rsp)
	call	rand@PLT
	movl	$6, %esi
	movl	32(%rsp), %ecx
	cltd
	idivl	%esi
	incl	%edx
	movl	%edx, 4516(%rsp,%r15,4)
	jmp	.L113
.L143:
	call	rand@PLT
	movb	%al, 5540(%rsp,%rbx)
	andb	$1, 5540(%rsp,%rbx)
	call	rand@PLT
	movb	%al, 5540(%rsp,%r12)
	andb	$1, 5540(%rsp,%r12)
	call	rand@PLT
	movb	%al, 5540(%rsp,%rbp)
	andb	$1, 5540(%rsp,%rbp)
.L120:
	movq	(%rsp), %rdi
	call	_Z11tvori_mrezoR7protein
	movq	16(%rsp), %rdi
	call	_Z11tvori_mrezoR7protein
	movq	%r14, %rdi
	call	_Z11tvori_mrezoR7protein
	movq	(%rsp), %rdi
	call	_Z17doloci_hevristikoR7protein
	movq	16(%rsp), %rdi
	call	_Z17doloci_hevristikoR7protein
	movq	%r14, %rdi
	call	_Z17doloci_hevristikoR7protein
	movl	4508(%rsp), %edx
	movl	8868(%rsp), %eax
	cmpl	%eax, %edx
	jle	.L115
	cmpl	13228(%rsp), %edx
	jle	.L116
	movq	8(%rsp), %rdi
	movq	(%rsp), %rsi
	movl	$1090, %ecx
	jmp	.L134
.L115:
	cmpl	13228(%rsp), %eax
	jle	.L116
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
	movl	$1090, %ecx
.L134:
	rep movsl
.L116:
	incl	56(%rsp)
	addq	$4360, 8(%rsp)
	cmpl	$210, 56(%rsp)
	jne	.L78
	addl	$210, 60(%rsp)
	jmp	.L76
.L137:
	leaq	21952(%rsp), %rdi
	xorl	%eax, %eax
	movl	$10, %ecx
	rep stosl
	pushq	%rdx
	.cfi_def_cfa_offset 941992
	movl	56848(%rsp), %eax
	movl	$2, %edi
	leaq	.LC0(%rip), %rbp
	pushq	%rax
	.cfi_def_cfa_offset 942000
	movl	52496(%rsp), %eax
	movq	%rbp, %rsi
	pushq	%rax
	.cfi_def_cfa_offset 942008
	movl	48144(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 942016
	movl	43792(%rsp), %r9d
	xorl	%eax, %eax
	movl	39432(%rsp), %r8d
	movl	35072(%rsp), %ecx
	movl	30712(%rsp), %edx
	call	__printf_chk@PLT
	movl	22008(%rsp), %eax
	addq	$24, %rsp
	.cfi_def_cfa_offset 941992
	movq	%rbp, %rsi
	movl	$2, %edi
	pushq	%rax
	.cfi_def_cfa_offset 942000
	movl	21988(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 942008
	movl	21992(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 942016
	movl	21996(%rsp), %r9d
	xorl	%eax, %eax
	movl	21992(%rsp), %r8d
	movl	21984(%rsp), %edx
	movl	21988(%rsp), %ecx
	call	__printf_chk@PLT
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	movq	%rcx, 144(%rsp)
	movq	%rcx, 152(%rsp)
	addq	$32, %rsp
	.cfi_def_cfa_offset 941984
	call	cudaSetDevice@PLT
	leaq	112(%rsp), %rdi
	movl	$40, %esi
	leaq	21952(%rsp), %rbx
	call	cudaMalloc@PLT
	leaq	120(%rsp), %rdi
	movl	$43600, %esi
	call	cudaMalloc@PLT
	movq	120(%rsp), %rdi
	movl	$1, %ecx
	leaq	26312(%rsp), %rsi
	movl	$43600, %edx
	call	cudaMemcpy@PLT
	movl	$2147483653, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addq	%rdx, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movq	%rdx, 140(%rsp)
	movl	$1, 148(%rsp)
	movq	%rdi, 128(%rsp)
	movl	$1, 136(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L118
	movq	120(%rsp), %rsi
	movq	112(%rsp), %rdi
	call	_Z37__device_stub__Z9addKernelPiP7proteinPiP7protein
.L118:
	movq	112(%rsp), %rsi
	movl	$2, %ecx
	movl	$40, %edx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	movq	%rbp, %rsi
	movl	$2, %edi
	pushq	%rax
	.cfi_def_cfa_offset 941992
	movl	21984(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 942000
	movl	21988(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 942008
	movl	21992(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 942016
	movl	21996(%rsp), %r9d
	xorl	%eax, %eax
	movl	21992(%rsp), %r8d
	movl	21988(%rsp), %ecx
	movl	21984(%rsp), %edx
	call	__printf_chk@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 941984
	movq	%rbx, %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	941912(%rsp), %rax
	subq	%fs:40, %rax
	je	.L123
	call	__stack_chk_fail@PLT
.L97:
	movq	16(%rsp), %rsi
	movl	$1090, %ecx
	movq	%rdx, %rdi
	movl	$4, %eax
	rep movsl
	leaq	13232(%rsp), %rsi
	movl	$1090, %ecx
	movq	%rbx, %rdi
	rep movsl
.L103:
	movl	(%rbx,%rax), %edi
	cmpl	%edi, (%rdx,%rax)
	jne	.L102
	addq	$4, %rax
	cmpq	$1028, %rax
	jne	.L103
	jmp	.L119
.L102:
	call	rand@PLT
	movl	$100, %ecx
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jg	.L120
	jmp	.L119
.L79:
	movq	(%rsp), %rsi
	movl	$1090, %ecx
	movq	%rdx, %rdi
	movl	$4, %eax
	rep movsl
	movl	$1090, %ecx
	movq	%rbx, %rdi
	movq	%r8, %rsi
	rep movsl
.L85:
	movl	(%rbx,%rax), %edi
	cmpl	%edi, (%rdx,%rax)
	jne	.L84
	addq	$4, %rax
	cmpq	$1028, %rax
	jne	.L85
	jmp	.L121
.L84:
	call	rand@PLT
	movl	$100, %ecx
	cltd
	idivl	%ecx
	decl	%edx
	jg	.L122
	jmp	.L121
.L123:
	addq	$941928, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4944:
	.size	main, .-main
	.section	.rodata.str1.1
.LC1:
	.string	"_Z9addKernelPiP7protein"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4975:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC1(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z9addKernelPiP7protein(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4975:
	.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
	.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:



/*
1. so vsi proteini enako dolgi ?
2. mutacija
*/
#include "hip/hip_runtime.h"

#include <iostream>
#include <stdio.h>
#include <time.h>
#include <stdlib.h> 
#include <random>
#include <algorithm>
// dolzina proteina 5 - 256
#define maxLenProtein 256
#define minLenProtein 5
#define numProtein 210
#define Cr 6

hipError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size);

//nikamor je namjnen zgolj prvemu clenu
enum smer{nikamor, naprej, nazaj, gor, dol, levo, desno};
//enum smerobratno{nikamor, nazaj, naprej, dol, gor, desno, levo};
enum vrsta{H, P};

struct tocka {
    int x = 0;
    int y = 0;
    int z = 0;
};

struct protein
{
    int dolzinaProteina = maxLenProtein;
    int proteinSmer[maxLenProtein] = {0};
    bool proteinVrsta[maxLenProtein];
    struct tocka tocke [maxLenProtein];
    int hevristika = 0;
};

__global__ void addKernel(int *c, struct protein* Arr)
{
    int i = threadIdx.x;
    c[i] = Arr[i].proteinSmer[1];
}

bool enako(struct protein ena, struct protein dva) {
    bool enak = true;
    for (int i = 0; i < maxLenProtein; i++) {
        if (ena.proteinSmer[i] != dva.proteinSmer[i]) {
            return false;
        }
    }
    return true;
}

void tvori_mrezo(struct protein &prot) {
    for (int i = 0; i < maxLenProtein; i++) {
        struct tocka t;
        if (i != 0) {
            t = prot.tocke[i - 1];
        }
        
        if (prot.proteinSmer[i] == nikamor) {
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == naprej) {
            t.x++;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == nazaj) {
            t.x--;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == gor) {
            t.z++;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == dol) {
            t.z--;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == levo) {
            t.y++;
            prot.tocke[i] = t;
        }
        if (prot.proteinSmer[i] == desno) {
            t.y--;
            prot.tocke[i] = t;
        }
    }
}

bool cikelj(struct tocka a, struct tocka b) {
    if (a.x == b.x && a.y == b.y && a.z == b.z) {
        return true;
    }
    return false;
}

bool hevristicna_povezava(struct tocka a, struct tocka b) {

    //povezav za nazaj ni potrebno preverjati, saj tocke v katerih se isce pocvezava so vsaj 3 narazen
    if (a.x == b.x && a.y == b.y && (a.z == b.z + 1 || a.z == b.z - 1)) {
        return true;
    }
    if (a.x == b.x && a.z == b.z && (a.y == b.y + 1 || a.y == b.y - 1)) {
        return true;
    }
    if (a.z == b.z && a.y == b.y && (a.x == b.x + 1 || a.x == b.x - 1)) {
        return true;
    }

    return false;
}

void doloci_hevristiko(struct protein &prot) {
    int br = 0;
    prot.hevristika = 0;
    for (int i = 0; i < maxLenProtein-3; i++) {

        for (int j = i+3; j < maxLenProtein; j++) {
            if (cikelj(prot.tocke[i], prot.tocke[j])) {
                // v primeru cikla minus dolzina proteina
                prot.hevristika -= prot.dolzinaProteina;
            }

            if (prot.proteinVrsta[i] == H && prot.proteinVrsta[j] == H) {
                if (hevristicna_povezava(prot.tocke[i], prot.tocke[j])) {
                    prot.hevristika++;
                }
            }
        }
    }
}

int main()
{
    //struct protein *arr = new struct protein[numProtein];
    int nfes = 0;
    std::cin >> nfes;
    nfes *= 1000;
    int count = 0;
    struct protein arr1[numProtein];
    srand(5);
    for (int i = 0; i < numProtein; i++) {
        struct protein generiranProtein ;
        // generiramo dolzino proteina
        generiranProtein.dolzinaProteina = rand() %(maxLenProtein - minLenProtein) + minLenProtein;
        int prev = 20;
        int premik = 0;
        //tvorimo smeri proteina pri cemer preverjamo da netvorimo kontra strani od prejsne
        for ( int j = 0; j < generiranProtein.dolzinaProteina; j++) {

            generiranProtein.proteinSmer[j] = rand() % 6+1;
            if (prev % 2 == 0) {
                premik = -1;
            }
            else {
                premik = 1;
            }
            while (prev + premik == generiranProtein.proteinSmer[j]) {
               generiranProtein.proteinSmer[j] = rand() % 6+1;
            }
            prev = generiranProtein.proteinSmer[j];


            generiranProtein.proteinVrsta[j] = rand() % 2;
        }
        arr1[i] = generiranProtein;
    }

    while (count < nfes) {

        for (int i = 0; i < numProtein; i++) {

            // KRIZANJE
            int r1 = rand() % numProtein;

            while (r1 == i)
            {
                r1 = rand() % numProtein;
            }

            struct protein generiranProtein1;
            struct protein generiranProtein2; 
            
            struct protein najdenI = arr1[i];
            struct protein najdenR1 = arr1[r1];

            int crospoint = 0;
            if (najdenI.dolzinaProteina < najdenR1.dolzinaProteina) {
                crospoint = najdenI.dolzinaProteina;
            }
            else {
                crospoint = najdenR1.dolzinaProteina;
            }
            crospoint -= 3;
            int crosoverPoint = rand() % crospoint + 3;

            
            std::copy(najdenI.proteinSmer, najdenI.proteinSmer + crosoverPoint, generiranProtein1.proteinSmer);
            std::copy(najdenR1.proteinSmer + crosoverPoint, najdenR1.proteinSmer + najdenR1.dolzinaProteina, generiranProtein1.proteinSmer + crosoverPoint);

            std::copy(najdenI.proteinVrsta, najdenI.proteinVrsta + crosoverPoint, generiranProtein1.proteinVrsta);
            std::copy(najdenR1.proteinVrsta + crosoverPoint, najdenR1.proteinVrsta + najdenR1.dolzinaProteina, generiranProtein1.proteinVrsta + crosoverPoint);

            generiranProtein1.dolzinaProteina = najdenR1.dolzinaProteina;
            

            std::copy(najdenR1.proteinSmer, najdenR1.proteinSmer + crosoverPoint, generiranProtein2.proteinSmer);
            std::copy(najdenI.proteinSmer + crosoverPoint, najdenI.proteinSmer + najdenI.dolzinaProteina, generiranProtein2.proteinSmer + crosoverPoint);

            std::copy(najdenR1.proteinVrsta, najdenR1.proteinVrsta + crosoverPoint, generiranProtein2.proteinVrsta);
            std::copy(najdenI.proteinVrsta + crosoverPoint, najdenI.proteinVrsta + najdenI.dolzinaProteina, generiranProtein2.proteinVrsta + crosoverPoint);

            generiranProtein2.dolzinaProteina = najdenI.dolzinaProteina;
            /*
            for (int j = 0; j < maxLenProtein; j++)
            {
                if (crosoverPoint < j)
                {
                    // memory copy std::copy
                    generiranProtein1.proteinSmer[j] = arr1[i].proteinSmer[j];
                    generiranProtein1.proteinVrsta[j] = arr1[i].proteinVrsta[j];
                     generiranProtein2.dolzinaProteina = arr1[i].dolzinaProteina;generiranProtein2.dolzinaProteina = arr1[i].dolzinaProteina;
                    generiranProtein2.proteinSmer[j] = arr1[r1].proteinSmer[j];
                    generiranProtein2.proteinVrsta[j] = arr1[r1].proteinVrsta[j];

                }
                else {
                    generiranProtein1.proteinSmer[j] = arr1[r1].proteinSmer[j];
                    generiranProtein1.proteinVrsta[j] = arr1[r1].proteinVrsta[j];
                    generiranProtein2.dolzinaProteina = arr1[i].dolzinaProteina;generiranProtein2.dolzinaProteina = arr1[i].dolzinaProteina;
                    generiranProtein2.proteinSmer[j] = arr1[i].proteinSmer[j];
                    generiranProtein2.proteinVrsta[j] = arr1[i].proteinVrsta[j];
                }
            }
            */
            if (enako(generiranProtein1, najdenI) || enako(generiranProtein1, najdenR1) || rand() % 100 < 2) {

                int tockaObrta1 = rand() % generiranProtein1.dolzinaProteina;
                int tockaObrta2 = rand() % generiranProtein1.dolzinaProteina;
                int tockaObrta3 = rand() % generiranProtein1.dolzinaProteina;
                int premik = 0;

                generiranProtein1.proteinSmer[tockaObrta1] = rand() % 6+1;
                if (generiranProtein1.proteinSmer[tockaObrta1 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein1.proteinSmer[tockaObrta1 - 1] + premik == generiranProtein1.proteinSmer[tockaObrta1]) {
                    generiranProtein1.proteinSmer[tockaObrta1 - 1] = rand() % 6+1;
                }

                generiranProtein1.proteinSmer[tockaObrta2] = rand() % 6+1;
                if (generiranProtein1.proteinSmer[tockaObrta2 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein1.proteinSmer[tockaObrta2 - 1] + premik == generiranProtein1.proteinSmer[tockaObrta2]) {
                    generiranProtein1.proteinSmer[tockaObrta2 - 1] = rand() % 6+1;
                }

                generiranProtein1.proteinSmer[tockaObrta3] = rand() % 6+1;
                if (generiranProtein1.proteinSmer[tockaObrta3 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein1.proteinSmer[tockaObrta3 - 1] + premik == generiranProtein1.proteinSmer[tockaObrta3]) {
                    generiranProtein1.proteinSmer[tockaObrta3 - 1] = rand() % 6+1;
                }

                generiranProtein1.proteinVrsta[tockaObrta1] = rand() % 2;
                generiranProtein1.proteinVrsta[tockaObrta2] = rand() % 2;
                generiranProtein1.proteinVrsta[tockaObrta3] = rand() % 2;

            }
            if (enako(generiranProtein2, najdenI) || enako(generiranProtein2, najdenR1) || rand() % 100 < 1) {
                int tockaObrta1 = rand() % generiranProtein2.dolzinaProteina;
                int tockaObrta2 = rand() % generiranProtein2.dolzinaProteina;
                int tockaObrta3 = rand() % generiranProtein2.dolzinaProteina;
                int premik = 0;
                generiranProtein2.proteinSmer[tockaObrta1] = rand() % 6+1;
                if (generiranProtein2.proteinSmer[tockaObrta1 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein2.proteinSmer[tockaObrta1 - 1] + premik == generiranProtein2.proteinSmer[tockaObrta1]) {
                    generiranProtein2.proteinSmer[tockaObrta1 - 1] = rand() % 6+1;
                }

                generiranProtein2.proteinSmer[tockaObrta2] = rand() % 6+1;
                if (generiranProtein2.proteinSmer[tockaObrta2 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein2.proteinSmer[tockaObrta2 - 1] + premik == generiranProtein2.proteinSmer[tockaObrta2]) {
                    generiranProtein2.proteinSmer[tockaObrta2 - 1] = rand() % 6+1;
                }

                generiranProtein2.proteinSmer[tockaObrta3] = rand() % 6+1;
                if (generiranProtein2.proteinSmer[tockaObrta3 - 1] % 2 == 0) {
                    premik = -1;
                }
                else {
                    premik = 1;
                }
                while (generiranProtein2.proteinSmer[tockaObrta3 - 1] + premik == generiranProtein2.proteinSmer[tockaObrta3]) {
                    generiranProtein2.proteinSmer[tockaObrta3 - 1] = rand() % 6+1;
                }

                generiranProtein2.proteinVrsta[tockaObrta1] = rand() % 2;
                generiranProtein2.proteinVrsta[tockaObrta2] = rand() % 2;
                generiranProtein2.proteinVrsta[tockaObrta3] = rand() % 2;

            }

            tvori_mrezo(generiranProtein1);
            tvori_mrezo(generiranProtein2);
            tvori_mrezo(najdenI);

            doloci_hevristiko(generiranProtein1);
            doloci_hevristiko(generiranProtein2);
            doloci_hevristiko(najdenI);
            
            if ( generiranProtein1.hevristika > generiranProtein2.hevristika) {
                if (najdenI.hevristika < generiranProtein1.hevristika) {
                    arr1[i] = generiranProtein1;
                }
            }
            else {
                if (najdenI.hevristika < generiranProtein2.hevristika) {
                    arr1[i] = generiranProtein2;
                }
            }

            count++;
        }
    }
   













    int c[10] = {0};

    printf(" {%d,%d,%d,%d,%d,%d,%d}\n",
        arr1[1].proteinSmer[1], arr1[2].proteinSmer[1], arr1[3].proteinSmer[1], arr1[4].proteinSmer[1], arr1[5].proteinSmer[1], arr1[6].proteinSmer[1], arr1[7].proteinSmer[1]);
    printf(" {%d,%d,%d,%d,%d,%d,%d}\n",
        c[0], c[1], c[2], c[3], c[4], c[5], c[6]);
    // Add vectors in parallel.
    int* dev_b = 0;
    struct protein* arrr = 0;
    hipSetDevice(0);
    hipMalloc((void**)&dev_b, 10 * sizeof(int));
    hipMalloc((void**)&arrr, 10 * sizeof(struct protein));
    hipMemcpy(arrr, arr1, 10 * sizeof(struct protein), hipMemcpyHostToDevice);
    addKernel <<<1, 10 >>> (dev_b, arrr);

    hipMemcpy(c, dev_b, 10 * sizeof(int), hipMemcpyDeviceToHost);
    printf(" {%d,%d,%d,%d,%d,%d,%d}\n",
        c[0], c[1], c[2], c[3], c[4], c[5], c[6]);

    hipFree(c);
    hipFree(arrr);
    hipFree(dev_b);

    return 0;
}

// Helper function for using CUDA to add vectors in parallel.

    
	.text
	.file	"kernel.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z24__device_stub__addKernelPiP7protein # -- Begin function _Z24__device_stub__addKernelPiP7protein
	.type	_Z24__device_stub__addKernelPiP7protein,@function
_Z24__device_stub__addKernelPiP7protein: # @_Z24__device_stub__addKernelPiP7protein
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9addKernelPiP7protein, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z24__device_stub__addKernelPiP7protein, .Lfunc_end0-_Z24__device_stub__addKernelPiP7protein
	.cfi_endproc
                                        # -- End function
	.globl	_Z5enako7proteinS_              # -- Begin function _Z5enako7proteinS_
	.type	_Z5enako7proteinS_,@function
_Z5enako7proteinS_:                     # @_Z5enako7proteinS_
	.cfi_startproc
# %bb.0:
	movl	12(%rsp), %eax
	cmpl	4372(%rsp), %eax
	jne	.LBB1_5
# %bb.1:                                # %.lr.ph.preheader
	leaq	4368(%rsp), %rax
	leaq	8(%rsp), %rcx
	xorl	%esi, %esi
.LBB1_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	%rsi, %rdx
	cmpq	$255, %rsi
	je	.LBB1_4
# %bb.3:                                #   in Loop: Header=BB1_2 Depth=1
	movl	8(%rcx,%rdx,4), %edi
	leaq	1(%rdx), %rsi
	cmpl	8(%rax,%rdx,4), %edi
	je	.LBB1_2
.LBB1_4:                                # %.critedge.loopexit
	cmpq	$255, %rdx
	setae	%al
                                        # kill: def $al killed $al killed $eax
	retq
.LBB1_5:
	xorl	%eax, %eax
                                        # kill: def $al killed $al killed $eax
	retq
.Lfunc_end1:
	.size	_Z5enako7proteinS_, .Lfunc_end1-_Z5enako7proteinS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z11tvori_mrezoR7protein        # -- Begin function _Z11tvori_mrezoR7protein
	.type	_Z11tvori_mrezoR7protein,@function
_Z11tvori_mrezoR7protein:               # @_Z11tvori_mrezoR7protein
	.cfi_startproc
# %bb.0:
	leaq	1292(%rdi), %rax
	movl	$1, %ecx
.LBB2_1:                                # =>This Inner Loop Header: Depth=1
	xorl	%edx, %edx
	movl	$0, %esi
	movl	$0, %r8d
	cmpq	$1, %rcx
	je	.LBB2_3
# %bb.2:                                #   in Loop: Header=BB2_1 Depth=1
	movl	-20(%rax), %r8d
	movl	-16(%rax), %esi
	movl	-12(%rax), %edx
.LBB2_3:                                #   in Loop: Header=BB2_1 Depth=1
	movl	(%rdi,%rcx,4), %r9d
	testl	%r9d, %r9d
	jne	.LBB2_5
# %bb.4:                                #   in Loop: Header=BB2_1 Depth=1
	movl	%r8d, -8(%rax)
	movl	%esi, -4(%rax)
	movl	%edx, (%rax)
	movl	(%rdi,%rcx,4), %r9d
.LBB2_5:                                #   in Loop: Header=BB2_1 Depth=1
	cmpl	$1, %r9d
	jne	.LBB2_7
# %bb.6:                                #   in Loop: Header=BB2_1 Depth=1
	incl	%r8d
	movl	%r8d, -8(%rax)
	movl	%esi, -4(%rax)
	movl	%edx, (%rax)
	movl	(%rdi,%rcx,4), %r9d
.LBB2_7:                                #   in Loop: Header=BB2_1 Depth=1
	cmpl	$2, %r9d
	jne	.LBB2_9
# %bb.8:                                #   in Loop: Header=BB2_1 Depth=1
	decl	%r8d
	movl	%r8d, -8(%rax)
	movl	%esi, -4(%rax)
	movl	%edx, (%rax)
	movl	(%rdi,%rcx,4), %r9d
.LBB2_9:                                #   in Loop: Header=BB2_1 Depth=1
	cmpl	$3, %r9d
	jne	.LBB2_11
# %bb.10:                               #   in Loop: Header=BB2_1 Depth=1
	incl	%edx
	movl	%r8d, -8(%rax)
	movl	%esi, -4(%rax)
	movl	%edx, (%rax)
	movl	(%rdi,%rcx,4), %r9d
.LBB2_11:                               #   in Loop: Header=BB2_1 Depth=1
	cmpl	$4, %r9d
	jne	.LBB2_13
# %bb.12:                               #   in Loop: Header=BB2_1 Depth=1
	decl	%edx
	movl	%r8d, -8(%rax)
	movl	%esi, -4(%rax)
	movl	%edx, (%rax)
	movl	(%rdi,%rcx,4), %r9d
.LBB2_13:                               #   in Loop: Header=BB2_1 Depth=1
	cmpl	$5, %r9d
	jne	.LBB2_15
# %bb.14:                               #   in Loop: Header=BB2_1 Depth=1
	incl	%esi
	movl	%r8d, -8(%rax)
	movl	%esi, -4(%rax)
	movl	%edx, (%rax)
	movl	(%rdi,%rcx,4), %r9d
.LBB2_15:                               #   in Loop: Header=BB2_1 Depth=1
	cmpl	$6, %r9d
	jne	.LBB2_17
# %bb.16:                               #   in Loop: Header=BB2_1 Depth=1
	decl	%esi
	movl	%r8d, -8(%rax)
	movl	%esi, -4(%rax)
	movl	%edx, (%rax)
.LBB2_17:                               #   in Loop: Header=BB2_1 Depth=1
	incq	%rcx
	addq	$12, %rax
	cmpq	$257, %rcx                      # imm = 0x101
	jne	.LBB2_1
# %bb.18:
	retq
.Lfunc_end2:
	.size	_Z11tvori_mrezoR7protein, .Lfunc_end2-_Z11tvori_mrezoR7protein
	.cfi_endproc
                                        # -- End function
	.globl	_Z6cikelj5tockaS_               # -- Begin function _Z6cikelj5tockaS_
	.type	_Z6cikelj5tockaS_,@function
_Z6cikelj5tockaS_:                      # @_Z6cikelj5tockaS_
	.cfi_startproc
# %bb.0:
	cmpq	%rdx, %rdi
	sete	%dl
	cmpl	%ecx, %esi
	sete	%al
	andb	%dl, %al
	retq
.Lfunc_end3:
	.size	_Z6cikelj5tockaS_, .Lfunc_end3-_Z6cikelj5tockaS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z20hevristicna_povezava5tockaS_ # -- Begin function _Z20hevristicna_povezava5tockaS_
	.type	_Z20hevristicna_povezava5tockaS_,@function
_Z20hevristicna_povezava5tockaS_:       # @_Z20hevristicna_povezava5tockaS_
	.cfi_startproc
# %bb.0:
                                        # kill: def $ecx killed $ecx def $rcx
	movq	%rdi, %r8
	shrq	$32, %r8
	movq	%rdx, %r9
	shrq	$32, %r9
	cmpl	%edx, %edi
	jne	.LBB4_4
# %bb.1:
	cmpq	%r9, %r8
	jne	.LBB4_4
# %bb.2:
	leal	1(%rcx), %r10d
	movb	$1, %al
	cmpl	%esi, %r10d
	je	.LBB4_13
# %bb.3:
	leal	-1(%rcx), %r10d
	cmpl	%esi, %r10d
	je	.LBB4_13
.LBB4_4:
	cmpl	%edx, %edi
	jne	.LBB4_8
# %bb.5:
	cmpl	%ecx, %esi
	jne	.LBB4_8
# %bb.6:
	leal	1(%r9), %r10d
	movb	$1, %al
	cmpl	%r8d, %r10d
	je	.LBB4_13
# %bb.7:
	leal	-1(%r9), %r10d
	cmpl	%r8d, %r10d
	je	.LBB4_13
.LBB4_8:
	cmpl	%ecx, %esi
	jne	.LBB4_12
# %bb.9:
	cmpq	%r9, %r8
	jne	.LBB4_12
# %bb.10:
	leal	1(%rdx), %ecx
	movb	$1, %al
	cmpl	%edi, %ecx
	je	.LBB4_13
# %bb.11:
	leal	-1(%rdx), %ecx
	cmpl	%edi, %ecx
	je	.LBB4_13
.LBB4_12:
	xorl	%eax, %eax
.LBB4_13:
                                        # kill: def $al killed $al killed $eax
	retq
.Lfunc_end4:
	.size	_Z20hevristicna_povezava5tockaS_, .Lfunc_end4-_Z20hevristicna_povezava5tockaS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z17doloci_hevristikoR7protein  # -- Begin function _Z17doloci_hevristikoR7protein
	.type	_Z17doloci_hevristikoR7protein,@function
_Z17doloci_hevristikoR7protein:         # @_Z17doloci_hevristikoR7protein
	.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	$0, 4356(%rdi)
	movl	(%rdi), %edx
	leaq	1320(%rdi), %rbx
	xorl	%ecx, %ecx
	movq	$-253, %r14
	xorl	%r15d, %r15d
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	movl	%edx, 4(%rsp)                   # 4-byte Spill
.LBB5_1:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_2 Depth 2
	leaq	(%rcx,%rcx,2), %rax
	leaq	(%rdi,%rax,4), %r13
	addq	$1284, %r13                     # imm = 0x504
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	movb	1028(%rdi,%rcx), %r12b
	movl	8(%r13), %ebp
	movq	%r14, 16(%rsp)                  # 8-byte Spill
	movq	%rbx, 32(%rsp)                  # 8-byte Spill
.LBB5_2:                                #   Parent Loop BB5_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%r13), %rax
	movl	8(%rbx), %ecx
	cmpq	(%rbx), %rax
	jne	.LBB5_5
# %bb.3:                                #   in Loop: Header=BB5_2 Depth=2
	cmpl	%ecx, %ebp
	jne	.LBB5_5
# %bb.4:                                #   in Loop: Header=BB5_2 Depth=2
	subl	%edx, %r15d
	movl	%r15d, 4356(%rdi)
.LBB5_5:                                #   in Loop: Header=BB5_2 Depth=2
	testb	%r12b, %r12b
	jne	.LBB5_13
# %bb.6:                                #   in Loop: Header=BB5_2 Depth=2
	cmpb	$0, 1284(%rdi,%r14)
	jne	.LBB5_13
# %bb.7:                                #   in Loop: Header=BB5_2 Depth=2
	movq	(%r13), %rdi
	movq	(%rbx), %rdx
	movl	%ebp, %esi
	callq	_Z20hevristicna_povezava5tockaS_
	testb	%al, %al
	je	.LBB5_8
# %bb.11:                               #   in Loop: Header=BB5_2 Depth=2
	incl	%r15d
	movq	8(%rsp), %rdi                   # 8-byte Reload
	movl	%r15d, 4356(%rdi)
	jmp	.LBB5_12
.LBB5_8:                                #   in Loop: Header=BB5_2 Depth=2
	movq	8(%rsp), %rdi                   # 8-byte Reload
.LBB5_12:                               #   in Loop: Header=BB5_2 Depth=2
	movl	4(%rsp), %edx                   # 4-byte Reload
.LBB5_13:                               #   in Loop: Header=BB5_2 Depth=2
	addq	$12, %rbx
	incq	%r14
	jne	.LBB5_2
# %bb.9:                                # %._crit_edge
                                        #   in Loop: Header=BB5_1 Depth=1
	movq	24(%rsp), %rcx                  # 8-byte Reload
	incq	%rcx
	movq	32(%rsp), %rbx                  # 8-byte Reload
	addq	$12, %rbx
	movq	16(%rsp), %r14                  # 8-byte Reload
	incq	%r14
	cmpq	$253, %rcx
	jne	.LBB5_1
# %bb.10:
	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_end5:
	.size	_Z17doloci_hevristikoR7protein, .Lfunc_end5-_Z17doloci_hevristikoR7protein
	.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	%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	$968008, %rsp                   # imm = 0xEC548
	.cfi_def_cfa_offset 968064
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	12(%rsp), %rbx
	movl	$0, (%rbx)
	movl	$_ZSt3cin, %edi
	movq	%rbx, %rsi
	callq	_ZNSirsERi
	imull	$1000, (%rbx), %eax             # imm = 0x3E8
	movl	%eax, (%rbx)
	xorl	%r14d, %r14d
.LBB6_1:                                # =>This Inner Loop Header: Depth=1
	leaq	(%rsp,%r14), %rdi
	addq	$52404, %rdi                    # imm = 0xCCB4
	movl	$256, -4(%rdi)                  # imm = 0x100
	leaq	(%rsp,%r14), %rbx
	addq	$53684, %rbx                    # imm = 0xD1B4
	movl	$1024, %edx                     # imm = 0x400
	xorl	%esi, %esi
	callq	memset@PLT
	movl	$3076, %edx                     # imm = 0xC04
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	addq	$4360, %r14                     # imm = 0x1108
	cmpq	$915600, %r14                   # imm = 0xDF890
	jne	.LBB6_1
# %bb.2:
	movl	$5, %edi
	callq	srand
	leaq	84(%rsp), %r13
	xorl	%r15d, %r15d
.LBB6_3:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_5 Depth 2
                                        #       Child Loop BB6_7 Depth 3
	movl	$1024, %edx                     # imm = 0x400
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movl	$3076, %edx                     # imm = 0xC04
	leaq	1364(%rsp), %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	callq	rand
	cltq
	imulq	$-2104705089, %rax, %rcx        # imm = 0x828CBFBF
	shrq	$32, %rcx
	addl	%eax, %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	sarl	$7, %ecx
	addl	%edx, %ecx
	imull	$251, %ecx, %ecx
	movl	%eax, %edx
	subl	%ecx, %edx
	negl	%ecx
	addl	%ecx, %eax
	addl	$5, %eax
	movl	%eax, 80(%rsp)
	cmpl	$-4, %edx
	jl	.LBB6_10
# %bb.4:                                # %.lr.ph145.preheader
                                        #   in Loop: Header=BB6_3 Depth=1
	movl	%eax, %r12d
	movl	$20, %ebx
	xorl	%r13d, %r13d
.LBB6_5:                                # %.lr.ph145
                                        #   Parent Loop BB6_3 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_7 Depth 3
	callq	rand
	movl	%eax, %r14d
	cltq
	imulq	$715827883, %rax, %rax          # imm = 0x2AAAAAAB
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	addl	%ecx, %eax
	addl	%eax, %eax
	leal	(%rax,%rax,2), %eax
	movl	%eax, %ecx
	negl	%ecx
	movl	%ebx, %edx
	andl	$1, %edx
	cmpl	$1, %edx
	movl	$0, %edx
	sbbl	%edx, %edx
	leal	(%r14,%rcx), %ebp
	incl	%ebp
	orl	$1, %edx
	addl	%ebx, %edx
	cmpl	%ebp, %edx
	jne	.LBB6_9
# %bb.6:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB6_5 Depth=2
	subl	%eax, %r14d
.LBB6_7:                                # %.lr.ph
                                        #   Parent Loop BB6_3 Depth=1
                                        #     Parent Loop BB6_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	rand
	movslq	%eax, %rbp
	imulq	$715827883, %rbp, %rax          # imm = 0x2AAAAAAB
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	addl	%ecx, %eax
	addl	%eax, %eax
	leal	(%rax,%rax,2), %eax
	subl	%eax, %ebp
	cmpl	%ebp, %r14d
	je	.LBB6_7
# %bb.8:                                # %._crit_edge.loopexit
                                        #   in Loop: Header=BB6_5 Depth=2
	incl	%ebp
.LBB6_9:                                # %._crit_edge
                                        #   in Loop: Header=BB6_5 Depth=2
	movl	%ebp, 84(%rsp,%r13,4)
	callq	rand
	andb	$1, %al
	movb	%al, 1108(%rsp,%r13)
	incq	%r13
	movl	%ebp, %ebx
	cmpq	%r12, %r13
	jne	.LBB6_5
.LBB6_10:                               # %._crit_edge146
                                        #   in Loop: Header=BB6_3 Depth=1
	imulq	$4360, %r15, %rax               # imm = 0x1108
	leaq	(%rsp,%rax), %rdi
	addq	$52400, %rdi                    # imm = 0xCCB0
	movl	$4360, %edx                     # imm = 0x1108
	leaq	80(%rsp), %rbx
	movq	%rbx, %rsi
	callq	memcpy@PLT
	incq	%r15
	cmpq	$210, %r15
	leaq	84(%rsp), %r13
	jne	.LBB6_3
# %bb.11:                               # %.preheader139
	cmpl	$0, 12(%rsp)
	jle	.LBB6_96
# %bb.12:                               # %.preheader.lr.ph
	movl	$1284, %eax                     # imm = 0x504
	leaq	(%rbx,%rax), %rcx
	movq	%rcx, 56(%rsp)                  # 8-byte Spill
	leaq	4444(%rsp), %r15
	leaq	4440(%rsp), %rdi
	addq	%rdi, %rax
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movl	$1028, %eax                     # imm = 0x404
	leaq	8800(%rsp), %rcx
	addq	%rax, %rcx
	movq	%rcx, 40(%rsp)                  # 8-byte Spill
	leaq	(%rbx,%rax), %rcx
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	leaq	13160(%rsp), %rcx
	addq	%rax, %rcx
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	addq	%rdi, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	xorl	%eax, %eax
.LBB6_14:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_15 Depth 2
                                        #       Child Loop BB6_50 Depth 3
                                        #       Child Loop BB6_55 Depth 3
                                        #       Child Loop BB6_60 Depth 3
                                        #       Child Loop BB6_63 Depth 3
                                        #       Child Loop BB6_66 Depth 3
                                        #       Child Loop BB6_71 Depth 3
                                        #       Child Loop BB6_76 Depth 3
                                        #       Child Loop BB6_81 Depth 3
                                        #       Child Loop BB6_84 Depth 3
                                        #       Child Loop BB6_87 Depth 3
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	xorl	%ebx, %ebx
.LBB6_15:                               # %.lr.ph150
                                        #   Parent Loop BB6_14 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_50 Depth 3
                                        #       Child Loop BB6_55 Depth 3
                                        #       Child Loop BB6_60 Depth 3
                                        #       Child Loop BB6_63 Depth 3
                                        #       Child Loop BB6_66 Depth 3
                                        #       Child Loop BB6_71 Depth 3
                                        #       Child Loop BB6_76 Depth 3
                                        #       Child Loop BB6_81 Depth 3
                                        #       Child Loop BB6_84 Depth 3
                                        #       Child Loop BB6_87 Depth 3
	callq	rand
	movslq	%eax, %r14
	imulq	$-1677082467, %r14, %rax        # imm = 0x9C09C09D
	shrq	$32, %rax
	addl	%r14d, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	sarl	$7, %eax
	addl	%ecx, %eax
	imull	$210, %eax, %eax
	subl	%eax, %r14d
	cmpq	%r14, %rbx
	je	.LBB6_15
# %bb.16:                               # %._crit_edge151
                                        #   in Loop: Header=BB6_15 Depth=2
	movl	$256, %ebp                      # imm = 0x100
	movl	%ebp, 80(%rsp)
	movl	$1024, %edx                     # imm = 0x400
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movl	$3076, %edx                     # imm = 0xC04
	movq	56(%rsp), %rdi                  # 8-byte Reload
	xorl	%esi, %esi
	callq	memset@PLT
	movl	%ebp, 4440(%rsp)
	movl	$1024, %edx                     # imm = 0x400
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movl	$3076, %edx                     # imm = 0xC04
	movq	64(%rsp), %rdi                  # 8-byte Reload
	xorl	%esi, %esi
	callq	memset@PLT
	imulq	$4360, %rbx, %rax               # imm = 0x1108
	leaq	(%rsp,%rax), %rsi
	addq	$52400, %rsi                    # imm = 0xCCB0
	movl	$4360, %edx                     # imm = 0x1108
	leaq	8800(%rsp), %rdi
	movq	%rsi, 72(%rsp)                  # 8-byte Spill
	callq	memcpy@PLT
	movslq	%r14d, %rax
	imulq	$4360, %rax, %rax               # imm = 0x1108
	leaq	(%rsp,%rax), %rsi
	addq	$52400, %rsi                    # imm = 0xCCB0
	movl	$4360, %edx                     # imm = 0x1108
	leaq	13160(%rsp), %rdi
	callq	memcpy@PLT
	movl	8800(%rsp), %eax
	movl	13160(%rsp), %ebp
	cmpl	%ebp, %eax
	cmovll	%eax, %ebp
	addl	$-3, %ebp
	callq	rand
	cltd
	idivl	%ebp
	movl	%edx, %ebp
	movslq	%edx, %r12
	leaq	3(%r12), %r15
	cmpl	$-1, %r12d
	jl	.LBB6_18
# %bb.17:                               #   in Loop: Header=BB6_15 Depth=2
	leaq	(,%r15,4), %rdx
	movq	%r13, %rdi
	leaq	8804(%rsp), %rsi
	callq	memcpy@PLT
	movq	%r13, %rcx
.LBB6_20:                               # %_ZSt4copyIPiS0_ET0_T_S2_S1_.exit
                                        #   in Loop: Header=BB6_15 Depth=2
	leaq	13164(%rsp), %rax
	leaq	(%rax,%r15,4), %rsi
	movl	13160(%rsp), %edx
	movl	%edx, 8(%rsp)                   # 4-byte Spill
	movslq	%edx, %r13
	leaq	(%rax,%r13,4), %rdx
	leaq	(%rcx,%r15,4), %rdi
	subq	%rsi, %rdx
	cmpq	$5, %rdx
	jl	.LBB6_22
# %bb.21:                               #   in Loop: Header=BB6_15 Depth=2
	callq	memcpy@PLT
.LBB6_24:                               # %_ZSt4copyIPiS0_ET0_T_S2_S1_.exit110
                                        #   in Loop: Header=BB6_15 Depth=2
	cmpl	$-1, %ebp
	jl	.LBB6_26
# %bb.25:                               #   in Loop: Header=BB6_15 Depth=2
	movq	24(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rdi
	movq	40(%rsp), %rsi                  # 8-byte Reload
	movq	%r15, %rdx
	callq	memcpy@PLT
.LBB6_28:                               # %_ZSt4copyIPbS0_ET0_T_S2_S1_.exit
                                        #   in Loop: Header=BB6_15 Depth=2
	movq	32(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%r15), %rsi
	addq	%rax, %r13
	leaq	(%r14,%r15), %rdi
	subq	%rsi, %r13
	cmpq	$2, %r13
	jl	.LBB6_30
# %bb.29:                               #   in Loop: Header=BB6_15 Depth=2
	movq	%r13, %rdx
	callq	memcpy@PLT
.LBB6_32:                               # %_ZSt4copyIPbS0_ET0_T_S2_S1_.exit111
                                        #   in Loop: Header=BB6_15 Depth=2
	movl	8(%rsp), %eax                   # 4-byte Reload
	movl	%eax, 80(%rsp)
	cmpl	$-1, %ebp
	jl	.LBB6_34
# %bb.33:                               #   in Loop: Header=BB6_15 Depth=2
	leaq	(,%r15,4), %rdx
	leaq	4444(%rsp), %r14
	movq	%r14, %rdi
	leaq	13164(%rsp), %rsi
	callq	memcpy@PLT
.LBB6_36:                               # %_ZSt4copyIPiS0_ET0_T_S2_S1_.exit112
                                        #   in Loop: Header=BB6_15 Depth=2
	leaq	8804(%rsp), %rax
	leaq	(%rax,%r12,4), %rsi
	addq	$12, %rsi
	movl	8800(%rsp), %ecx
	movl	%ecx, 4(%rsp)                   # 4-byte Spill
	movslq	%ecx, %r13
	leaq	(%rax,%r13,4), %rdx
	leaq	(%r14,%r15,4), %rdi
	subq	%rsi, %rdx
	cmpq	$5, %rdx
	jl	.LBB6_38
# %bb.37:                               #   in Loop: Header=BB6_15 Depth=2
	callq	memcpy@PLT
	leaq	80(%rsp), %r12
	leaq	4440(%rsp), %r14
	movq	16(%rsp), %rcx                  # 8-byte Reload
.LBB6_40:                               # %_ZSt4copyIPiS0_ET0_T_S2_S1_.exit113
                                        #   in Loop: Header=BB6_15 Depth=2
	cmpl	$-1, %ebp
	jl	.LBB6_42
# %bb.41:                               #   in Loop: Header=BB6_15 Depth=2
	movq	%rcx, %rdi
	movq	32(%rsp), %rsi                  # 8-byte Reload
	movq	%r15, %rdx
	callq	memcpy@PLT
	movq	16(%rsp), %rcx                  # 8-byte Reload
.LBB6_44:                               # %_ZSt4copyIPbS0_ET0_T_S2_S1_.exit114
                                        #   in Loop: Header=BB6_15 Depth=2
	movq	40(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%r15), %rsi
	addq	%rax, %r13
	addq	%rcx, %r15
	subq	%rsi, %r13
	cmpq	$2, %r13
	jl	.LBB6_46
# %bb.45:                               #   in Loop: Header=BB6_15 Depth=2
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	memcpy@PLT
.LBB6_48:                               # %_ZSt4copyIPbS0_ET0_T_S2_S1_.exit115
                                        #   in Loop: Header=BB6_15 Depth=2
	movl	4(%rsp), %eax                   # 4-byte Reload
	movl	%eax, 4440(%rsp)
	movl	$4360, %edx                     # imm = 0x1108
	leaq	48040(%rsp), %rdi
	movq	%r12, %rsi
	callq	memcpy@PLT
	movl	$4360, %edx                     # imm = 0x1108
	leaq	43680(%rsp), %rdi
	leaq	8800(%rsp), %rsi
	callq	memcpy@PLT
	movl	48044(%rsp), %eax
	cmpl	43684(%rsp), %eax
	leaq	84(%rsp), %r13
	jne	.LBB6_53
# %bb.49:                               # %.lr.ph155.preheader
                                        #   in Loop: Header=BB6_15 Depth=2
	movq	$-1, %rax
.LBB6_50:                               # %.lr.ph155
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpq	$254, %rax
	je	.LBB6_59
# %bb.51:                               #   in Loop: Header=BB6_50 Depth=3
	movl	48052(%rsp,%rax,4), %edx
	leaq	1(%rax), %rcx
	cmpl	43692(%rsp,%rax,4), %edx
	movq	%rcx, %rax
	je	.LBB6_50
# %bb.52:                               # %_Z5enako7proteinS_.exit
                                        #   in Loop: Header=BB6_15 Depth=2
	cmpq	$254, %rcx
	ja	.LBB6_59
.LBB6_53:                               # %.critedge
                                        #   in Loop: Header=BB6_15 Depth=2
	movl	$4360, %edx                     # imm = 0x1108
	leaq	39320(%rsp), %rdi
	movq	%r12, %rsi
	callq	memcpy@PLT
	movl	$4360, %edx                     # imm = 0x1108
	leaq	34960(%rsp), %rdi
	leaq	13160(%rsp), %rsi
	callq	memcpy@PLT
	movl	39324(%rsp), %eax
	cmpl	34964(%rsp), %eax
	jne	.LBB6_58
# %bb.54:                               # %.lr.ph162.preheader
                                        #   in Loop: Header=BB6_15 Depth=2
	movq	$-1, %rax
.LBB6_55:                               # %.lr.ph162
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpq	$254, %rax
	je	.LBB6_59
# %bb.56:                               #   in Loop: Header=BB6_55 Depth=3
	movl	39332(%rsp,%rax,4), %edx
	leaq	1(%rax), %rcx
	cmpl	34972(%rsp,%rax,4), %edx
	movq	%rcx, %rax
	je	.LBB6_55
# %bb.57:                               # %_Z5enako7proteinS_.exit121
                                        #   in Loop: Header=BB6_15 Depth=2
	cmpq	$254, %rcx
	ja	.LBB6_59
.LBB6_58:                               # %.critedge220
                                        #   in Loop: Header=BB6_15 Depth=2
	callq	rand
	cltq
	imulq	$1374389535, %rax, %rcx         # imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$37, %rcx
	addl	%edx, %ecx
	imull	$100, %ecx, %ecx
	subl	%ecx, %eax
	cmpl	$1, %eax
	jg	.LBB6_69
.LBB6_59:                               # %_Z5enako7proteinS_.exit.thread
                                        #   in Loop: Header=BB6_15 Depth=2
	callq	rand
	cltd
	movl	8(%rsp), %r14d                  # 4-byte Reload
	idivl	%r14d
	movl	%edx, %r13d
	callq	rand
	cltd
	idivl	%r14d
	movl	%edx, %ebp
	callq	rand
	cltd
	idivl	%r14d
	movl	%edx, %r12d
	callq	rand
	cltq
	imulq	$715827883, %rax, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	negl	%ecx
	leal	(%rax,%rcx), %r15d
	incl	%r15d
	movslq	%r13d, %r14
	movl	%r15d, 84(%rsp,%r14,4)
	movl	80(%rsp,%r14,4), %eax
	movl	%eax, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	movl	$0, %r13d
	sbbl	%r13d, %r13d
	orl	$1, %r13d
	leal	(%rax,%r13), %ecx
	cmpl	%r15d, %ecx
	jne	.LBB6_62
.LBB6_60:                               # %.lr.ph169
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rsi
	shrq	$63, %rsi
	shrq	$32, %rcx
	addl	%esi, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	addl	%r13d, %edx
	incl	%edx
	cmpl	%r15d, %edx
	je	.LBB6_60
# %bb.61:                               #   in Loop: Header=BB6_15 Depth=2
	negl	%ecx
	addl	%ecx, %eax
	incl	%eax
.LBB6_62:                               # %._crit_edge170
                                        #   in Loop: Header=BB6_15 Depth=2
	leaq	-1(%r14), %rcx
	movl	%eax, 84(%rsp,%rcx,4)
	callq	rand
	cltq
	imulq	$715827883, %rax, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	negl	%ecx
	leal	(%rax,%rcx), %r15d
	incl	%r15d
	movslq	%ebp, %r13
	movl	%r15d, 84(%rsp,%r13,4)
	movl	80(%rsp,%r13,4), %eax
	movl	%eax, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	movl	$0, %ebp
	sbbl	%ebp, %ebp
	orl	$1, %ebp
	leal	(%rax,%rbp), %ecx
	cmpl	%r15d, %ecx
	jne	.LBB6_65
.LBB6_63:                               # %.lr.ph175
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rsi
	shrq	$63, %rsi
	shrq	$32, %rcx
	addl	%esi, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	addl	%ebp, %edx
	incl	%edx
	cmpl	%r15d, %edx
	je	.LBB6_63
# %bb.64:                               #   in Loop: Header=BB6_15 Depth=2
	negl	%ecx
	addl	%ecx, %eax
	incl	%eax
.LBB6_65:                               # %._crit_edge176
                                        #   in Loop: Header=BB6_15 Depth=2
	leaq	-1(%r13), %rcx
	movl	%eax, 84(%rsp,%rcx,4)
	callq	rand
	cltq
	imulq	$715827883, %rax, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	negl	%ecx
	leal	(%rax,%rcx), %ebp
	incl	%ebp
	movslq	%r12d, %r15
	movl	%ebp, 84(%rsp,%r15,4)
	movl	80(%rsp,%r15,4), %eax
	movl	%eax, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	movl	$0, %r12d
	sbbl	%r12d, %r12d
	orl	$1, %r12d
	leal	(%rax,%r12), %ecx
	cmpl	%ebp, %ecx
	jne	.LBB6_68
.LBB6_66:                               # %.lr.ph181
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rsi
	shrq	$63, %rsi
	shrq	$32, %rcx
	addl	%esi, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	addl	%r12d, %edx
	incl	%edx
	cmpl	%ebp, %edx
	je	.LBB6_66
# %bb.67:                               #   in Loop: Header=BB6_15 Depth=2
	negl	%ecx
	addl	%ecx, %eax
	incl	%eax
.LBB6_68:                               # %._crit_edge182
                                        #   in Loop: Header=BB6_15 Depth=2
	leaq	-1(%r15), %rcx
	movl	%eax, 84(%rsp,%rcx,4)
	callq	rand
	andb	$1, %al
	movb	%al, 1108(%rsp,%r14)
	callq	rand
	andb	$1, %al
	movb	%al, 1108(%rsp,%r13)
	callq	rand
	andb	$1, %al
	movb	%al, 1108(%rsp,%r15)
	leaq	84(%rsp), %r13
	leaq	80(%rsp), %r12
	leaq	4440(%rsp), %r14
.LBB6_69:                               #   in Loop: Header=BB6_15 Depth=2
	movl	$4360, %edx                     # imm = 0x1108
	leaq	30600(%rsp), %rdi
	movq	%r14, %rsi
	callq	memcpy@PLT
	movl	$4360, %edx                     # imm = 0x1108
	leaq	26240(%rsp), %rdi
	leaq	8800(%rsp), %rsi
	callq	memcpy@PLT
	movl	30604(%rsp), %eax
	cmpl	26244(%rsp), %eax
	jne	.LBB6_74
# %bb.70:                               # %.lr.ph187.preheader
                                        #   in Loop: Header=BB6_15 Depth=2
	movq	$-1, %rax
.LBB6_71:                               # %.lr.ph187
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpq	$254, %rax
	je	.LBB6_80
# %bb.72:                               #   in Loop: Header=BB6_71 Depth=3
	movl	30612(%rsp,%rax,4), %edx
	leaq	1(%rax), %rcx
	cmpl	26252(%rsp,%rax,4), %edx
	movq	%rcx, %rax
	je	.LBB6_71
# %bb.73:                               # %_Z5enako7proteinS_.exit127
                                        #   in Loop: Header=BB6_15 Depth=2
	cmpq	$254, %rcx
	ja	.LBB6_80
.LBB6_74:                               # %.critedge221
                                        #   in Loop: Header=BB6_15 Depth=2
	movl	$4360, %edx                     # imm = 0x1108
	leaq	21880(%rsp), %rdi
	movq	%r14, %rsi
	callq	memcpy@PLT
	movl	$4360, %edx                     # imm = 0x1108
	leaq	17520(%rsp), %rdi
	leaq	13160(%rsp), %rsi
	callq	memcpy@PLT
	movl	21884(%rsp), %eax
	cmpl	17524(%rsp), %eax
	jne	.LBB6_79
# %bb.75:                               # %.lr.ph194.preheader
                                        #   in Loop: Header=BB6_15 Depth=2
	movq	$-1, %rax
.LBB6_76:                               # %.lr.ph194
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpq	$254, %rax
	je	.LBB6_80
# %bb.77:                               #   in Loop: Header=BB6_76 Depth=3
	movl	21892(%rsp,%rax,4), %edx
	leaq	1(%rax), %rcx
	cmpl	17532(%rsp,%rax,4), %edx
	movq	%rcx, %rax
	je	.LBB6_76
# %bb.78:                               # %_Z5enako7proteinS_.exit133
                                        #   in Loop: Header=BB6_15 Depth=2
	cmpq	$254, %rcx
	ja	.LBB6_80
.LBB6_79:                               # %.critedge222
                                        #   in Loop: Header=BB6_15 Depth=2
	callq	rand
	cltq
	imulq	$1374389535, %rax, %rcx         # imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$37, %rcx
	addl	%edx, %ecx
	imull	$100, %ecx, %ecx
	subl	%ecx, %eax
	testl	%eax, %eax
	jg	.LBB6_90
.LBB6_80:                               # %_Z5enako7proteinS_.exit127.thread
                                        #   in Loop: Header=BB6_15 Depth=2
	callq	rand
	cltd
	movl	4(%rsp), %r14d                  # 4-byte Reload
	idivl	%r14d
	movl	%edx, %r13d
	callq	rand
	cltd
	idivl	%r14d
	movl	%edx, %ebp
	callq	rand
	cltd
	idivl	%r14d
	movl	%edx, %r15d
	callq	rand
	cltq
	imulq	$715827883, %rax, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	negl	%ecx
	leal	(%rax,%rcx), %r12d
	incl	%r12d
	movslq	%r13d, %r14
	movl	%r12d, 4444(%rsp,%r14,4)
	movl	4440(%rsp,%r14,4), %eax
	movl	%eax, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	movl	$0, %r13d
	sbbl	%r13d, %r13d
	orl	$1, %r13d
	leal	(%rax,%r13), %ecx
	cmpl	%r12d, %ecx
	jne	.LBB6_83
.LBB6_81:                               # %.lr.ph201
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rsi
	shrq	$63, %rsi
	shrq	$32, %rcx
	addl	%esi, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	addl	%r13d, %edx
	incl	%edx
	cmpl	%r12d, %edx
	je	.LBB6_81
# %bb.82:                               #   in Loop: Header=BB6_15 Depth=2
	negl	%ecx
	addl	%ecx, %eax
	incl	%eax
.LBB6_83:                               # %._crit_edge202
                                        #   in Loop: Header=BB6_15 Depth=2
	leaq	-1(%r14), %rcx
	movl	%eax, 4444(%rsp,%rcx,4)
	callq	rand
	cltq
	imulq	$715827883, %rax, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	negl	%ecx
	leal	(%rax,%rcx), %r13d
	incl	%r13d
	movslq	%ebp, %r12
	movl	%r13d, 4444(%rsp,%r12,4)
	movl	4440(%rsp,%r12,4), %eax
	movl	%eax, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	movl	$0, %ebp
	sbbl	%ebp, %ebp
	orl	$1, %ebp
	leal	(%rax,%rbp), %ecx
	cmpl	%r13d, %ecx
	jne	.LBB6_86
.LBB6_84:                               # %.lr.ph207
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rsi
	shrq	$63, %rsi
	shrq	$32, %rcx
	addl	%esi, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	addl	%ebp, %edx
	incl	%edx
	cmpl	%r13d, %edx
	je	.LBB6_84
# %bb.85:                               #   in Loop: Header=BB6_15 Depth=2
	negl	%ecx
	addl	%ecx, %eax
	incl	%eax
.LBB6_86:                               # %._crit_edge208
                                        #   in Loop: Header=BB6_15 Depth=2
	leaq	-1(%r12), %rcx
	movl	%eax, 4444(%rsp,%rcx,4)
	callq	rand
	cltq
	imulq	$715827883, %rax, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	negl	%ecx
	leal	(%rax,%rcx), %ebp
	incl	%ebp
	movslq	%r15d, %r15
	movl	%ebp, 4444(%rsp,%r15,4)
	movl	4440(%rsp,%r15,4), %eax
	movl	%eax, %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	movl	$0, %r13d
	sbbl	%r13d, %r13d
	orl	$1, %r13d
	leal	(%rax,%r13), %ecx
	cmpl	%ebp, %ecx
	jne	.LBB6_89
.LBB6_87:                               # %.lr.ph213
                                        #   Parent Loop BB6_14 Depth=1
                                        #     Parent Loop BB6_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rcx          # imm = 0x2AAAAAAB
	movq	%rcx, %rsi
	shrq	$63, %rsi
	shrq	$32, %rcx
	addl	%esi, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edx
	addl	%r13d, %edx
	incl	%edx
	cmpl	%ebp, %edx
	je	.LBB6_87
# %bb.88:                               #   in Loop: Header=BB6_15 Depth=2
	negl	%ecx
	addl	%ecx, %eax
	incl	%eax
.LBB6_89:                               # %._crit_edge214
                                        #   in Loop: Header=BB6_15 Depth=2
	leaq	-1(%r15), %rcx
	movl	%eax, 4444(%rsp,%rcx,4)
	callq	rand
	andb	$1, %al
	movb	%al, 5468(%rsp,%r14)
	callq	rand
	andb	$1, %al
	movb	%al, 5468(%rsp,%r12)
	callq	rand
	andb	$1, %al
	movb	%al, 5468(%rsp,%r15)
	leaq	84(%rsp), %r13
	leaq	80(%rsp), %r12
	leaq	4440(%rsp), %r14
.LBB6_90:                               #   in Loop: Header=BB6_15 Depth=2
	movq	%r12, %rdi
	callq	_Z11tvori_mrezoR7protein
	movq	%r14, %rdi
	callq	_Z11tvori_mrezoR7protein
	leaq	8800(%rsp), %r15
	movq	%r15, %rdi
	callq	_Z11tvori_mrezoR7protein
	movq	%r12, %rdi
	callq	_Z17doloci_hevristikoR7protein
	movq	%r14, %rdi
	callq	_Z17doloci_hevristikoR7protein
	movq	%r15, %rdi
	callq	_Z17doloci_hevristikoR7protein
	movl	4436(%rsp), %ecx
	movl	8796(%rsp), %edx
	movl	13156(%rsp), %eax
	cmpl	%edx, %ecx
	jle	.LBB6_92
# %bb.91:                               #   in Loop: Header=BB6_15 Depth=2
	movq	%r12, %r14
	cmpl	%ecx, %eax
	jmp	.LBB6_93
.LBB6_92:                               #   in Loop: Header=BB6_15 Depth=2
	cmpl	%edx, %eax
.LBB6_93:                               #   in Loop: Header=BB6_15 Depth=2
	leaq	4444(%rsp), %r15
	jge	.LBB6_95
# %bb.94:                               # %.sink.split
                                        #   in Loop: Header=BB6_15 Depth=2
	movl	$4360, %edx                     # imm = 0x1108
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movq	%r14, %rsi
	callq	memcpy@PLT
.LBB6_95:                               #   in Loop: Header=BB6_15 Depth=2
	incq	%rbx
	cmpq	$210, %rbx
	jne	.LBB6_15
	jmp	.LBB6_13
.LBB6_18:                               #   in Loop: Header=BB6_15 Depth=2
	cmpl	$1, %r15d
	movq	%r13, %rcx
	jne	.LBB6_20
# %bb.19:                               #   in Loop: Header=BB6_15 Depth=2
	movl	8804(%rsp), %eax
	movl	%eax, 84(%rsp)
	jmp	.LBB6_20
.LBB6_22:                               #   in Loop: Header=BB6_15 Depth=2
	cmpq	$4, %rdx
	jne	.LBB6_24
# %bb.23:                               #   in Loop: Header=BB6_15 Depth=2
	movl	(%rsi), %eax
	movl	%eax, (%rdi)
	jmp	.LBB6_24
.LBB6_26:                               #   in Loop: Header=BB6_15 Depth=2
	cmpl	$1, %r15d
	movq	24(%rsp), %r14                  # 8-byte Reload
	jne	.LBB6_28
# %bb.27:                               #   in Loop: Header=BB6_15 Depth=2
	movb	9828(%rsp), %al
	movb	%al, 1108(%rsp)
	jmp	.LBB6_28
.LBB6_30:                               #   in Loop: Header=BB6_15 Depth=2
	cmpq	$1, %r13
	jne	.LBB6_32
# %bb.31:                               #   in Loop: Header=BB6_15 Depth=2
	movb	(%rsi), %al
	movb	%al, (%rdi)
	jmp	.LBB6_32
.LBB6_34:                               #   in Loop: Header=BB6_15 Depth=2
	cmpl	$1, %r15d
	leaq	4444(%rsp), %r14
	jne	.LBB6_36
# %bb.35:                               #   in Loop: Header=BB6_15 Depth=2
	movl	13164(%rsp), %eax
	movl	%eax, 4444(%rsp)
	jmp	.LBB6_36
.LBB6_38:                               #   in Loop: Header=BB6_15 Depth=2
	cmpq	$4, %rdx
	leaq	80(%rsp), %r12
	leaq	4440(%rsp), %r14
	movq	16(%rsp), %rcx                  # 8-byte Reload
	jne	.LBB6_40
# %bb.39:                               #   in Loop: Header=BB6_15 Depth=2
	movl	(%rsi), %eax
	movl	%eax, (%rdi)
	jmp	.LBB6_40
.LBB6_42:                               #   in Loop: Header=BB6_15 Depth=2
	cmpl	$1, %r15d
	jne	.LBB6_44
# %bb.43:                               #   in Loop: Header=BB6_15 Depth=2
	movb	14188(%rsp), %al
	movb	%al, 5468(%rsp)
	jmp	.LBB6_44
.LBB6_46:                               #   in Loop: Header=BB6_15 Depth=2
	cmpq	$1, %r13
	jne	.LBB6_48
# %bb.47:                               #   in Loop: Header=BB6_15 Depth=2
	movb	(%rsi), %al
	movb	%al, (%r15)
	jmp	.LBB6_48
.LBB6_13:                               # %.loopexit
                                        #   in Loop: Header=BB6_14 Depth=1
	movq	48(%rsp), %rax                  # 8-byte Reload
	addl	$210, %eax
	cmpl	12(%rsp), %eax
	jl	.LBB6_14
.LBB6_96:                               # %._crit_edge219
	xorps	%xmm0, %xmm0
	movaps	%xmm0, 96(%rsp)
	movaps	%xmm0, 80(%rsp)
	xorl	%r12d, %r12d
	movq	%r12, 112(%rsp)
	leaq	52400(%rsp), %rbx
	movl	4368(%rbx), %esi
	movl	8728(%rbx), %edx
	movl	13088(%rbx), %ecx
	movl	17448(%rbx), %r8d
	movl	21808(%rbx), %r9d
	movl	26168(%rbx), %r10d
	movl	30528(%rbx), %r11d
	movl	$.L.str, %edi
	xorl	%eax, %eax
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	callq	printf
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$.L.str, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	xorl	%eax, %eax
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	callq	printf
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	leaq	4440(%rsp), %r14
	movq	%r12, (%r14)
	leaq	8800(%rsp), %r15
	movq	%r12, (%r15)
	xorl	%edi, %edi
	callq	hipSetDevice
	movl	$40, %esi
	movq	%r14, %rdi
	callq	hipMalloc
	movl	$43600, %esi                    # imm = 0xAA50
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	movl	$43600, %edx                    # imm = 0xAA50
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	leaq	9(%rdi), %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_98
# %bb.97:
	movq	4440(%rsp), %rdi
	movq	8800(%rsp), %rsi
	callq	_Z24__device_stub__addKernelPiP7protein
.LBB6_98:
	movq	4440(%rsp), %rsi
	leaq	80(%rsp), %rbx
	movl	$40, %edx
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	(%rbx), %esi
	movl	4(%rbx), %edx
	movl	8(%rbx), %ecx
	movl	12(%rbx), %r8d
	movl	16(%rbx), %r9d
	movl	20(%rbx), %r10d
	movl	24(%rbx), %r11d
	movl	$.L.str, %edi
	xorl	%eax, %eax
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	callq	printf
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movq	%rbx, %rdi
	callq	hipFree
	movq	8800(%rsp), %rdi
	callq	hipFree
	movq	4440(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$968008, %rsp                   # imm = 0xEC548
	.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	main, .Lfunc_end6-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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB7_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB7_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9addKernelPiP7protein, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end7:
	.size	__hip_module_ctor, .Lfunc_end7-__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	.LBB8_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
.LBB8_2:
	retq
.Lfunc_end8:
	.size	__hip_module_dtor, .Lfunc_end8-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z9addKernelPiP7protein,@object # @_Z9addKernelPiP7protein
	.section	.rodata,"a",@progbits
	.globl	_Z9addKernelPiP7protein
	.p2align	3, 0x0
_Z9addKernelPiP7protein:
	.quad	_Z24__device_stub__addKernelPiP7protein
	.size	_Z9addKernelPiP7protein, 8

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z9addKernelPiP7protein"
	.size	.L__unnamed_1, 24

	.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

	.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 _Z24__device_stub__addKernelPiP7protein
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z9addKernelPiP7protein
	.addrsig_sym _ZSt3cin
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z9addKernelPiP7protein ; -- Begin function _Z9addKernelPiP7protein
	.globl	_Z9addKernelPiP7protein
	.p2align	8
	.type	_Z9addKernelPiP7protein,@function
_Z9addKernelPiP7protein:                ; @_Z9addKernelPiP7protein
; %bb.0:
	s_load_b128 s[0:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	v_mad_u64_u32 v[1:2], null, 0x1108, v0, s[2:3]
	v_lshlrev_b32_e32 v0, 2, v0
	global_load_b32 v1, v[1:2], off offset:8
	s_waitcnt vmcnt(0)
	global_store_b32 v0, v1, s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9addKernelPiP7protein
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 16
		.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 3
		.amdhsa_next_free_sgpr 4
		.amdhsa_reserve_vcc 0
		.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	_Z9addKernelPiP7protein, .Lfunc_end0-_Z9addKernelPiP7protein
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 60
; NumSgprs: 4
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 4
; NumVGPRsForWavesPerEU: 3
; 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
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 16
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9addKernelPiP7protein
    .private_segment_fixed_size: 0
    .sgpr_count:     4
    .sgpr_spill_count: 0
    .symbol:         _Z9addKernelPiP7protein.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
