#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>

typedef unsigned long ulint;
typedef unsigned long long ulint64;

int banyakdata = 256000;
int dimensigrid = 2000;
int dimensiblok = 128;

void modexp(ulint a, ulint b, ulint c, ulint* res) {
	ulint64 s = a;
	ulint64 ans = 1;
	while (b != 0) {
		if (b % 2 == 1) {
			ans = ans * s % c;
			b--;
		}
		b /= 2;
		if (b != 0) {
			s = s * s %c;
		}
	}
	*res = ans;
}

void enkripsi(ulint g, ulint k, ulint p, ulint m, ulint y, ulint *res) {
	modexp(g, k, p, res);
	modexp(y, k, p, res + 1);

	*(res + 1) = *(res + 1) * m % p;
}

void dekripsi(ulint a, ulint b, ulint p, ulint e, ulint *res) {
	modexp(a, e, p, res);
	*res = *res * b % p;
}

void kernelenk(ulint *m, ulint *k, ulint g, ulint p, ulint y, ulint *res) {
	for (int i = 0; i < banyakdata; i++)
	{
		enkripsi(g, k[i], p, m[i], y, res + 2 * i);
	}
}

void kerneldek(ulint *c, ulint p, ulint e, ulint *res) {
	for (int i = 0; i < banyakdata; i++)
	{
		dekripsi(c[2 * i], c[2 * i + 1], p, e, res + i);
	}
}

void enkripsiCUDA(ulint *m, ulint *k, ulint g, ulint p, ulint y, ulint *res) {
	clock_t begin = clock();
	kernelenk(m, k, g, p, y, res);
	clock_t end = clock();

	double time_spent = (double)(end - begin);
	printf("Durasi enkripsi = %f milliseconds\n", time_spent / 1000);
}

void dekripsiCUDA(ulint *c, ulint p, ulint e, ulint *res2) {
	clock_t begin = clock();
	kerneldek(c, p, e, res2);
	clock_t end = clock();

	double time_spent = (double)(end - begin);
	printf("Durasi dekripsi = %f milliseconds\n", time_spent / 1000);
}

void initenkripsi(ulint *m, ulint *k) {

	for (int i = 0; i < banyakdata; i++) {
		m[i] = rand() % 3999999978;
		k[i] = rand() % 3999999978;
	}
}

int main() {
	ulint *m, *k, *res, *res2, g, p, y, x, e;

	m = (ulint*)malloc(banyakdata * sizeof(ulint));
	k = (ulint*)malloc(banyakdata * sizeof(ulint));
	res = (ulint*)malloc(banyakdata * 2 * sizeof(ulint));
	res2 = (ulint*)malloc(banyakdata * sizeof(ulint));

	srand(2018);

	g = rand() % 3999999978;
	p = 3999999979;
	x = rand() % 3999999978;
	modexp(g, x, p, &y);
	initenkripsi(m, k);

	// printf("<<<<<<<<<<<<<<Pesan Asli>>>>>>>>>>>>>>>\n");
	// for (int i = 0; i < 4; i++) {
	// 	printf("m[%d] = %lu\n", i, m[i]);
	// }

	// printf("m[...]\n");
	// printf("m[%d] = %lu\n", banyakdata - 1, m[banyakdata - 1]);

	enkripsiCUDA(m, k, g, p, y, res);

	// printf("<<<<<<<<<<<<<<Hasil Enkripsi>>>>>>>>>>>>>>>\n");
	// for (int i = 0; i < 4; i++) {
	// 	printf("c[%d] = %lu 	c[%d] = %lu\n", 2 * i, res[2 * i], 2 * i + 1, res[2 * i + 1]);
	// }

	// printf("c ...\n");
	// printf("c[%d] = %lu 	c[%d] = %lu\n", banyakdata * 2 - 2, res[banyakdata * 2 - 2], banyakdata * 2 - 1, res[banyakdata * 2 - 1]);

	e = p - x - 1;
	dekripsiCUDA(res, p, e, res2);

	// printf("<<<<<<<<<<<<<<Hasil Dekripsi>>>>>>>>>>>>>>>\n");
	// for (int i = 0; i < 4; i++) {
	// 	printf("m[%d] = %lu\n", i, res2[i]);
	// }

	// printf("m[...]\n");
	// printf("m[%d] = %lu\n", banyakdata - 1, res2[banyakdata - 1]);

	free(m);
	free(k);
	free(res);
	free(res2);

	return 0;
}

	.file	"tmpxft_0032f5bf_00000000-6_32.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2038:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2038:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z6modexpmmmPm
	.type	_Z6modexpmmmPm, @function
_Z6modexpmmmPm:
.LFB2027:
	.cfi_startproc
	endbr64
	movq	%rdx, %r9
	movl	$1, %r8d
.L3:
	testq	%rsi, %rsi
	je	.L11
	testl	$1, %esi
	je	.L4
	movq	%r8, %rax
	xorl	%edx, %edx
	decq	%rsi
	imulq	%rdi, %rax
	divq	%r9
	movq	%rdx, %r8
.L4:
	cmpq	$1, %rsi
	jbe	.L11
	imulq	%rdi, %rdi
	xorl	%edx, %edx
	shrq	%rsi
	movq	%rdi, %rax
	divq	%r9
	movq	%rdx, %rdi
	jmp	.L3
.L11:
	movq	%r8, (%rcx)
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z6modexpmmmPm, .-_Z6modexpmmmPm
	.globl	_Z8enkripsimmmmmPm
	.type	_Z8enkripsimmmmmPm, @function
_Z8enkripsimmmmmPm:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rcx, %r10
	movq	%r9, %rcx
	movq	%r9, %r11
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%r8, %r12
	movq	%rdx, %rbx
	pushq	%rax
	.cfi_def_cfa_offset 32
	movq	%rsi, (%rsp)
	call	_Z6modexpmmmPm
	movq	(%rsp), %rsi
	movq	%rbx, %rdx
	movq	%r12, %rdi
	leaq	8(%r11), %rcx
	call	_Z6modexpmmmPm
	movq	8(%r11), %rax
	xorl	%edx, %edx
	imulq	%r10, %rax
	divq	%rbx
	movq	%rdx, 8(%r11)
	popq	%rdx
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z8enkripsimmmmmPm, .-_Z8enkripsimmmmmPm
	.globl	_Z8dekripsimmmmPm
	.type	_Z8dekripsimmmmPm, @function
_Z8dekripsimmmmPm:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%r8, %r11
	movq	%rsi, %r10
	movq	%rcx, %rsi
	movq	%r8, %rcx
	movq	%rdx, %rbx
	call	_Z6modexpmmmPm
	movq	(%r11), %rax
	xorl	%edx, %edx
	imulq	%r10, %rax
	divq	%rbx
	popq	%rbx
	.cfi_def_cfa_offset 8
	movq	%rdx, (%r11)
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z8dekripsimmmmPm, .-_Z8dekripsimmmmPm
	.globl	_Z9kernelenkPmS_mmmS_
	.type	_Z9kernelenkPmS_mmmS_, @function
_Z9kernelenkPmS_mmmS_:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%r8, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rcx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r9, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	pushq	%r10
	.cfi_def_cfa_offset 64
	movq	%rdx, (%rsp)
.L18:
	cmpl	%ebx, banyakdata(%rip)
	jle	.L21
	movq	(%r12,%rbx,8), %rcx
	movq	0(%r13,%rbx,8), %rsi
	movq	%rbp, %r9
	movq	%r15, %r8
	movq	(%rsp), %rdi
	movq	%r14, %rdx
	incq	%rbx
	addq	$16, %rbp
	call	_Z8enkripsimmmmmPm
	jmp	.L18
.L21:
	popq	%rax
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z9kernelenkPmS_mmmS_, .-_Z9kernelenkPmS_mmmS_
	.globl	_Z9kerneldekPmmmS_
	.type	_Z9kerneldekPmmmS_, @function
_Z9kerneldekPmmmS_:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
.L23:
	cmpl	%r14d, banyakdata(%rip)
	jle	.L26
	movq	8(%rbx), %rsi
	movq	(%rbx), %rdi
	movq	%rbp, %r8
	movq	%r13, %rcx
	movq	%r12, %rdx
	incl	%r14d
	addq	$16, %rbx
	addq	$8, %rbp
	call	_Z8dekripsimmmmPm
	jmp	.L23
.L26:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z9kerneldekPmmmS_, .-_Z9kerneldekPmmmS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"Durasi enkripsi = %f milliseconds\n"
	.text
	.globl	_Z12enkripsiCUDAPmS_mmmS_
	.type	_Z12enkripsiCUDAPmS_mmmS_, @function
_Z12enkripsiCUDAPmS_mmmS_:
.LFB2032:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	%rdi, 40(%rsp)
	movq	%rsi, 32(%rsp)
	movq	%rdx, 24(%rsp)
	movq	%rcx, 16(%rsp)
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	call	clock@PLT
	movq	32(%rsp), %rsi
	movq	40(%rsp), %rdi
	movq	(%rsp), %r9
	movq	8(%rsp), %r8
	movq	%rax, %rbx
	movq	16(%rsp), %rcx
	movq	24(%rsp), %rdx
	call	_Z9kernelenkPmS_mmmS_
	call	clock@PLT
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	subq	%rbx, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC0(%rip), %xmm0
	movb	$1, %al
	addq	$48, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2032:
	.size	_Z12enkripsiCUDAPmS_mmmS_, .-_Z12enkripsiCUDAPmS_mmmS_
	.section	.rodata.str1.1
.LC2:
	.string	"Durasi dekripsi = %f milliseconds\n"
	.text
	.globl	_Z12dekripsiCUDAPmmmS_
	.type	_Z12dekripsiCUDAPmmmS_, @function
_Z12dekripsiCUDAPmmmS_:
.LFB2033:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%rdi, 24(%rsp)
	movq	%rsi, 16(%rsp)
	movq	%rdx, 8(%rsp)
	movq	%rcx, (%rsp)
	call	clock@PLT
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rdi
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdx
	movq	%rax, %rbx
	call	_Z9kerneldekPmmmS_
	call	clock@PLT
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	subq	%rbx, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC0(%rip), %xmm0
	movb	$1, %al
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2033:
	.size	_Z12dekripsiCUDAPmmmS_, .-_Z12dekripsiCUDAPmmmS_
	.globl	_Z12initenkripsiPmS_
	.type	_Z12initenkripsiPmS_, @function
_Z12initenkripsiPmS_:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
.L32:
	cmpl	%ebx, banyakdata(%rip)
	jle	.L35
	call	rand@PLT
	cltq
	movq	%rax, 0(%rbp,%rbx,8)
	call	rand@PLT
	cltq
	movq	%rax, (%r12,%rbx,8)
	incq	%rbx
	jmp	.L32
.L35:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2034:
	.size	_Z12initenkripsiPmS_, .-_Z12initenkripsiPmS_
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2035:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$3999999979, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movslq	banyakdata(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%r13, %rbx
	salq	$3, %r13
	movq	%r13, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %r12
	call	malloc@PLT
	leal	(%rbx,%rbx), %edi
	movslq	%edi, %rdi
	movq	%rax, %rbp
	salq	$3, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movl	$2018, %edi
	movq	%rax, %r13
	call	srand@PLT
	call	rand@PLT
	movslq	%eax, %r14
	call	rand@PLT
	leaq	16(%rsp), %rcx
	movq	%r15, %rdx
	movq	%r14, %rdi
	movslq	%eax, %rbx
	movq	%rbx, %rsi
	call	_Z6modexpmmmPm
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	_Z12initenkripsiPmS_
	movq	8(%rsp), %r9
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	16(%rsp), %r8
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	_Z12enkripsiCUDAPmS_mmmS_
	movq	8(%rsp), %rdi
	movq	%r13, %rcx
	movq	%r15, %rsi
	movl	$3999999978, %edx
	subq	%rbx, %rdx
	call	_Z12dekripsiCUDAPmmmS_
	movq	%r12, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	8(%rsp), %rdi
	call	free@PLT
	movq	%r13, %rdi
	call	free@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	addq	$40, %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
.LFE2035:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2061:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2061:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	dimensiblok
	.data
	.align 4
	.type	dimensiblok, @object
	.size	dimensiblok, 4
dimensiblok:
	.long	128
	.globl	dimensigrid
	.align 4
	.type	dimensigrid, @object
	.size	dimensigrid, 4
dimensigrid:
	.long	2000
	.globl	banyakdata
	.align 4
	.type	banyakdata, @object
	.size	banyakdata, 4
banyakdata:
	.long	256000
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1083129856
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include "hip/hip_runtime.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>

typedef unsigned long ulint;
typedef unsigned long long ulint64;

int banyakdata = 256000;
int dimensigrid = 2000;
int dimensiblok = 128;

void modexp(ulint a, ulint b, ulint c, ulint* res) {
	ulint64 s = a;
	ulint64 ans = 1;
	while (b != 0) {
		if (b % 2 == 1) {
			ans = ans * s % c;
			b--;
		}
		b /= 2;
		if (b != 0) {
			s = s * s %c;
		}
	}
	*res = ans;
}

void enkripsi(ulint g, ulint k, ulint p, ulint m, ulint y, ulint *res) {
	modexp(g, k, p, res);
	modexp(y, k, p, res + 1);

	*(res + 1) = *(res + 1) * m % p;
}

void dekripsi(ulint a, ulint b, ulint p, ulint e, ulint *res) {
	modexp(a, e, p, res);
	*res = *res * b % p;
}

void kernelenk(ulint *m, ulint *k, ulint g, ulint p, ulint y, ulint *res) {
	for (int i = 0; i < banyakdata; i++)
	{
		enkripsi(g, k[i], p, m[i], y, res + 2 * i);
	}
}

void kerneldek(ulint *c, ulint p, ulint e, ulint *res) {
	for (int i = 0; i < banyakdata; i++)
	{
		dekripsi(c[2 * i], c[2 * i + 1], p, e, res + i);
	}
}

void enkripsiCUDA(ulint *m, ulint *k, ulint g, ulint p, ulint y, ulint *res) {
	clock_t begin = clock();
	kernelenk(m, k, g, p, y, res);
	clock_t end = clock();

	double time_spent = (double)(end - begin);
	printf("Durasi enkripsi = %f milliseconds\n", time_spent / 1000);
}

void dekripsiCUDA(ulint *c, ulint p, ulint e, ulint *res2) {
	clock_t begin = clock();
	kerneldek(c, p, e, res2);
	clock_t end = clock();

	double time_spent = (double)(end - begin);
	printf("Durasi dekripsi = %f milliseconds\n", time_spent / 1000);
}

void initenkripsi(ulint *m, ulint *k) {

	for (int i = 0; i < banyakdata; i++) {
		m[i] = rand() % 3999999978;
		k[i] = rand() % 3999999978;
	}
}

int main() {
	ulint *m, *k, *res, *res2, g, p, y, x, e;

	m = (ulint*)malloc(banyakdata * sizeof(ulint));
	k = (ulint*)malloc(banyakdata * sizeof(ulint));
	res = (ulint*)malloc(banyakdata * 2 * sizeof(ulint));
	res2 = (ulint*)malloc(banyakdata * sizeof(ulint));

	srand(2018);

	g = rand() % 3999999978;
	p = 3999999979;
	x = rand() % 3999999978;
	modexp(g, x, p, &y);
	initenkripsi(m, k);

	// printf("<<<<<<<<<<<<<<Pesan Asli>>>>>>>>>>>>>>>\n");
	// for (int i = 0; i < 4; i++) {
	// 	printf("m[%d] = %lu\n", i, m[i]);
	// }

	// printf("m[...]\n");
	// printf("m[%d] = %lu\n", banyakdata - 1, m[banyakdata - 1]);

	enkripsiCUDA(m, k, g, p, y, res);

	// printf("<<<<<<<<<<<<<<Hasil Enkripsi>>>>>>>>>>>>>>>\n");
	// for (int i = 0; i < 4; i++) {
	// 	printf("c[%d] = %lu 	c[%d] = %lu\n", 2 * i, res[2 * i], 2 * i + 1, res[2 * i + 1]);
	// }

	// printf("c ...\n");
	// printf("c[%d] = %lu 	c[%d] = %lu\n", banyakdata * 2 - 2, res[banyakdata * 2 - 2], banyakdata * 2 - 1, res[banyakdata * 2 - 1]);

	e = p - x - 1;
	dekripsiCUDA(res, p, e, res2);

	// printf("<<<<<<<<<<<<<<Hasil Dekripsi>>>>>>>>>>>>>>>\n");
	// for (int i = 0; i < 4; i++) {
	// 	printf("m[%d] = %lu\n", i, res2[i]);
	// }

	// printf("m[...]\n");
	// printf("m[%d] = %lu\n", banyakdata - 1, res2[banyakdata - 1]);

	free(m);
	free(k);
	free(res);
	free(res2);

	return 0;
}

	.text
	.file	"32.hip"
	.globl	_Z6modexpmmmPm                  # -- Begin function _Z6modexpmmmPm
	.type	_Z6modexpmmmPm,@function
_Z6modexpmmmPm:                         # @_Z6modexpmmmPm
	.cfi_startproc
# %bb.0:
	testq	%rsi, %rsi
	je	.LBB0_1
# %bb.3:                                # %.lr.ph.preheader
	movq	%rdx, %r8
	movq	%rdi, %r9
	movl	$1, %edi
.LBB0_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	testb	$1, %sil
	je	.LBB0_6
# %bb.5:                                #   in Loop: Header=BB0_4 Depth=1
	imulq	%r9, %rdi
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%r8
	decq	%rsi
	movq	%rdx, %rdi
.LBB0_6:                                #   in Loop: Header=BB0_4 Depth=1
	cmpq	$2, %rsi
	jb	.LBB0_2
# %bb.7:                                #   in Loop: Header=BB0_4 Depth=1
	shrq	%rsi
	imulq	%r9, %r9
	movq	%r9, %rax
	xorl	%edx, %edx
	divq	%r8
	movq	%rdx, %r9
	jmp	.LBB0_4
.LBB0_1:
	movl	$1, %edi
.LBB0_2:                                # %._crit_edge
	movq	%rdi, (%rcx)
	retq
.Lfunc_end0:
	.size	_Z6modexpmmmPm, .Lfunc_end0-_Z6modexpmmmPm
	.cfi_endproc
                                        # -- End function
	.globl	_Z8enkripsimmmmmPm              # -- Begin function _Z8enkripsimmmmmPm
	.type	_Z8enkripsimmmmmPm,@function
_Z8enkripsimmmmmPm:                     # @_Z8enkripsimmmmmPm
	.cfi_startproc
# %bb.0:
	movq	%r8, %r10
	movq	%rdx, %r8
	testq	%rsi, %rsi
	je	.LBB1_11
# %bb.1:                                # %.lr.ph.i.preheader
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movl	$1, %r11d
	movq	%rsi, %rbx
.LBB1_2:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	testb	$1, %bl
	je	.LBB1_4
# %bb.3:                                #   in Loop: Header=BB1_2 Depth=1
	imulq	%rdi, %r11
	movq	%r11, %rax
	xorl	%edx, %edx
	divq	%r8
	decq	%rbx
	movq	%rdx, %r11
.LBB1_4:                                #   in Loop: Header=BB1_2 Depth=1
	cmpq	$2, %rbx
	jb	.LBB1_6
# %bb.5:                                #   in Loop: Header=BB1_2 Depth=1
	shrq	%rbx
	imulq	%rdi, %rdi
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%r8
	movq	%rdx, %rdi
	jmp	.LBB1_2
.LBB1_6:                                # %_Z6modexpmmmPm.exit
	movq	%r11, (%r9)
	movl	$1, %edi
	popq	%rbx
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
.LBB1_7:                                # %.lr.ph.i12
                                        # =>This Inner Loop Header: Depth=1
	testb	$1, %sil
	je	.LBB1_9
# %bb.8:                                #   in Loop: Header=BB1_7 Depth=1
	imulq	%r10, %rdi
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%r8
	decq	%rsi
	movq	%rdx, %rdi
.LBB1_9:                                #   in Loop: Header=BB1_7 Depth=1
	cmpq	$2, %rsi
	jb	.LBB1_12
# %bb.10:                               #   in Loop: Header=BB1_7 Depth=1
	shrq	%rsi
	imulq	%r10, %r10
	movq	%r10, %rax
	xorl	%edx, %edx
	divq	%r8
	movq	%rdx, %r10
	jmp	.LBB1_7
.LBB1_11:                               # %_Z6modexpmmmPm.exit.thread
	movq	$1, (%r9)
	movl	$1, %edi
.LBB1_12:                               # %_Z6modexpmmmPm.exit21
	imulq	%rcx, %rdi
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%r8
	movq	%rdx, 8(%r9)
	retq
.Lfunc_end1:
	.size	_Z8enkripsimmmmmPm, .Lfunc_end1-_Z8enkripsimmmmmPm
	.cfi_endproc
                                        # -- End function
	.globl	_Z8dekripsimmmmPm               # -- Begin function _Z8dekripsimmmmPm
	.type	_Z8dekripsimmmmPm,@function
_Z8dekripsimmmmPm:                      # @_Z8dekripsimmmmPm
	.cfi_startproc
# %bb.0:
	movq	%rdx, %r9
	testq	%rcx, %rcx
	je	.LBB2_1
# %bb.3:                                # %.lr.ph.i.preheader
	movq	%rdi, %r10
	movl	$1, %edi
.LBB2_4:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	testb	$1, %cl
	je	.LBB2_6
# %bb.5:                                #   in Loop: Header=BB2_4 Depth=1
	imulq	%r10, %rdi
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%r9
	decq	%rcx
	movq	%rdx, %rdi
.LBB2_6:                                #   in Loop: Header=BB2_4 Depth=1
	cmpq	$2, %rcx
	jb	.LBB2_2
# %bb.7:                                #   in Loop: Header=BB2_4 Depth=1
	shrq	%rcx
	imulq	%r10, %r10
	movq	%r10, %rax
	xorl	%edx, %edx
	divq	%r9
	movq	%rdx, %r10
	jmp	.LBB2_4
.LBB2_1:
	movl	$1, %edi
.LBB2_2:                                # %_Z6modexpmmmPm.exit
	imulq	%rsi, %rdi
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%r9
	movq	%rdx, (%r8)
	retq
.Lfunc_end2:
	.size	_Z8dekripsimmmmPm, .Lfunc_end2-_Z8dekripsimmmmPm
	.cfi_endproc
                                        # -- End function
	.globl	_Z9kernelenkPmS_mmmS_           # -- Begin function _Z9kernelenkPmS_mmmS_
	.type	_Z9kernelenkPmS_mmmS_,@function
_Z9kernelenkPmS_mmmS_:                  # @_Z9kernelenkPmS_mmmS_
	.cfi_startproc
# %bb.0:
	cmpl	$0, banyakdata(%rip)
	jle	.LBB3_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, %rbx
	movq	%r8, %r15
	movq	%rcx, %rax
	movq	%rdx, %r13
	movq	%rsi, %rbp
	movq	%rdi, %r12
	xorl	%r14d, %r14d
	movq	%rcx, (%rsp)                    # 8-byte Spill
.LBB3_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbp,%r14,8), %rsi
	movq	(%r12,%r14,8), %rcx
	movq	%r13, %rdi
	movq	%rax, %rdx
	movq	%r15, %r8
	movq	%rbx, %r9
	callq	_Z8enkripsimmmmmPm
	incq	%r14
	movslq	banyakdata(%rip), %rax
	addq	$16, %rbx
	cmpq	%rax, %r14
	movq	(%rsp), %rax                    # 8-byte Reload
	jl	.LBB3_2
# %bb.3:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB3_4:                                # %._crit_edge
	retq
.Lfunc_end3:
	.size	_Z9kernelenkPmS_mmmS_, .Lfunc_end3-_Z9kernelenkPmS_mmmS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z9kerneldekPmmmS_              # -- Begin function _Z9kerneldekPmmmS_
	.type	_Z9kerneldekPmmmS_,@function
_Z9kerneldekPmmmS_:                     # @_Z9kerneldekPmmmS_
	.cfi_startproc
# %bb.0:
	movl	banyakdata(%rip), %r11d
	testl	%r11d, %r11d
	jle	.LBB4_6
# %bb.1:                                # %.lr.ph
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r8
	xorl	%ebx, %ebx
.LBB4_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_8 Depth 2
	movq	%rbx, %rax
	shlq	$4, %rax
	movq	8(%rdi,%rax), %r14
	testq	%r8, %r8
	je	.LBB4_3
# %bb.7:                                # %.lr.ph.i.i.preheader
                                        #   in Loop: Header=BB4_2 Depth=1
	leaq	(%rbx,%rbx), %rax
	movq	(%rdi,%rax,8), %r10
	movl	$1, %r9d
	movq	%r8, %r15
.LBB4_8:                                # %.lr.ph.i.i
                                        #   Parent Loop BB4_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	testb	$1, %r15b
	je	.LBB4_10
# %bb.9:                                #   in Loop: Header=BB4_8 Depth=2
	imulq	%r10, %r9
	movq	%r9, %rax
	xorl	%edx, %edx
	divq	%rsi
	decq	%r15
	movq	%rdx, %r9
.LBB4_10:                               #   in Loop: Header=BB4_8 Depth=2
	cmpq	$2, %r15
	jb	.LBB4_4
# %bb.11:                               #   in Loop: Header=BB4_8 Depth=2
	shrq	%r15
	imulq	%r10, %r10
	movq	%r10, %rax
	xorl	%edx, %edx
	divq	%rsi
	movq	%rdx, %r10
	jmp	.LBB4_8
.LBB4_3:                                #   in Loop: Header=BB4_2 Depth=1
	movl	$1, %r9d
.LBB4_4:                                # %_Z8dekripsimmmmPm.exit
                                        #   in Loop: Header=BB4_2 Depth=1
	imulq	%r14, %r9
	movq	%r9, %rax
	xorl	%edx, %edx
	divq	%rsi
	movq	%rdx, (%rcx,%rbx,8)
	incq	%rbx
	cmpq	%r11, %rbx
	jne	.LBB4_2
# %bb.5:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB4_6:                                # %._crit_edge
	retq
.Lfunc_end4:
	.size	_Z9kerneldekPmmmS_, .Lfunc_end4-_Z9kerneldekPmmmS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z12enkripsiCUDAPmS_mmmS_
.LCPI5_0:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	_Z12enkripsiCUDAPmS_mmmS_
	.type	_Z12enkripsiCUDAPmS_mmmS_,@function
_Z12enkripsiCUDAPmS_mmmS_:              # @_Z12enkripsiCUDAPmS_mmmS_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, (%rsp)                     # 8-byte Spill
	movq	%r8, %r14
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbp
	callq	clock
	movq	%rax, %rbx
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	movq	%r15, %rcx
	movq	%r14, %r8
	movq	(%rsp), %r9                     # 8-byte Reload
	callq	_Z9kernelenkPmS_mmmS_
	callq	clock
	subq	%rbx, %rax
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI5_0(%rip), %xmm0
	movl	$.L.str, %edi
	movb	$1, %al
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.Lfunc_end5:
	.size	_Z12enkripsiCUDAPmS_mmmS_, .Lfunc_end5-_Z12enkripsiCUDAPmS_mmmS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z12dekripsiCUDAPmmmS_
.LCPI6_0:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	_Z12dekripsiCUDAPmmmS_
	.type	_Z12dekripsiCUDAPmmmS_,@function
_Z12dekripsiCUDAPmmmS_:                 # @_Z12dekripsiCUDAPmmmS_
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	callq	clock
	movq	%rax, %r13
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	_Z9kerneldekPmmmS_
	callq	clock
	subq	%r13, %rax
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI6_0(%rip), %xmm0
	movl	$.L.str.1, %edi
	movb	$1, %al
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.Lfunc_end6:
	.size	_Z12dekripsiCUDAPmmmS_, .Lfunc_end6-_Z12dekripsiCUDAPmmmS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z12initenkripsiPmS_            # -- Begin function _Z12initenkripsiPmS_
	.type	_Z12initenkripsiPmS_,@function
_Z12initenkripsiPmS_:                   # @_Z12initenkripsiPmS_
	.cfi_startproc
# %bb.0:
	cmpl	$0, banyakdata(%rip)
	jle	.LBB7_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	xorl	%r15d, %r15d
.LBB7_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	movq	%rax, (%r14,%r15,8)
	callq	rand
	cltq
	movq	%rax, (%rbx,%r15,8)
	incq	%r15
	movslq	banyakdata(%rip), %rax
	cmpq	%rax, %r15
	jl	.LBB7_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB7_4:                                # %._crit_edge
	retq
.Lfunc_end7:
	.size	_Z12initenkripsiPmS_, .Lfunc_end7-_Z12initenkripsiPmS_
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movslq	banyakdata(%rip), %r15
	leaq	(,%r15,8), %r12
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %rbp
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r14
	shlq	$4, %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	$2018, %edi                     # imm = 0x7E2
	callq	srand
	callq	rand
	movslq	%eax, %rbx
	callq	rand
	movslq	%eax, %r13
	movl	$1, %r12d
	testl	%r13d, %r13d
	je	.LBB8_6
# %bb.1:                                # %.lr.ph.i.preheader
	movabsq	$1360296658843496629, %rsi      # imm = 0x12E0BE9AA38470B5
	movl	$3999999979, %edi               # imm = 0xEE6B27EB
	movq	%rbx, %rcx
	movq	%r13, %r8
.LBB8_2:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	testb	$1, %r8b
	je	.LBB8_4
# %bb.3:                                #   in Loop: Header=BB8_2 Depth=1
	imulq	%rcx, %r12
	movq	%r12, %rax
	mulq	%rsi
	movq	%r12, %rax
	subq	%rdx, %rax
	shrq	%rax
	addq	%rdx, %rax
	shrq	$31, %rax
	imulq	%rdi, %rax
	subq	%rax, %r12
	decq	%r8
.LBB8_4:                                #   in Loop: Header=BB8_2 Depth=1
	cmpq	$2, %r8
	jb	.LBB8_6
# %bb.5:                                #   in Loop: Header=BB8_2 Depth=1
	shrq	%r8
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	mulq	%rsi
	movq	%rcx, %rax
	subq	%rdx, %rax
	shrq	%rax
	addq	%rdx, %rax
	shrq	$31, %rax
	imulq	%rdi, %rax
	subq	%rax, %rcx
	jmp	.LBB8_2
.LBB8_6:                                # %_Z6modexpmmmPm.exit
	movq	%rbp, %rdi
	movq	%r14, %rsi
	callq	_Z12initenkripsiPmS_
	movl	$3999999979, %r15d              # imm = 0xEE6B27EB
	movl	$3999999979, %ecx               # imm = 0xEE6B27EB
	movq	%rbp, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movq	%r12, %r8
	movq	8(%rsp), %rbx                   # 8-byte Reload
	movq	%rbx, %r9
	callq	_Z12enkripsiCUDAPmS_mmmS_
	notq	%r13
	addq	%r15, %r13
	movl	$3999999979, %esi               # imm = 0xEE6B27EB
	movq	%rbx, %rdi
	movq	%r13, %rdx
	movq	16(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rcx
	callq	_Z12dekripsiCUDAPmmmS_
	movq	%rbp, %rdi
	callq	free
	movq	%r14, %rdi
	callq	free
	movq	%rbx, %rdi
	callq	free
	movq	%r12, %rdi
	callq	free
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	main, .Lfunc_end8-main
	.cfi_endproc
                                        # -- End function
	.type	banyakdata,@object              # @banyakdata
	.data
	.globl	banyakdata
	.p2align	2, 0x0
banyakdata:
	.long	256000                          # 0x3e800
	.size	banyakdata, 4

	.type	dimensigrid,@object             # @dimensigrid
	.globl	dimensigrid
	.p2align	2, 0x0
dimensigrid:
	.long	2000                            # 0x7d0
	.size	dimensigrid, 4

	.type	dimensiblok,@object             # @dimensiblok
	.globl	dimensiblok
	.p2align	2, 0x0
dimensiblok:
	.long	128                             # 0x80
	.size	dimensiblok, 4

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Durasi enkripsi = %f milliseconds\n"
	.size	.L.str, 35

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Durasi dekripsi = %f milliseconds\n"
	.size	.L.str.1, 35

	.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 __hip_cuid_

	.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_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
