#include <cuda.h>
#include <stdio.h>

#define mega 1048576

__global__ void fdcalc(int n)
{
   long n1 = 0;

    for (int j=0; j < 100000; j++) {
      for(int i=2; i < n; ++i) {
         n1=pow(n1,i);
         //n1=n1*i; (GF 730)
       }
     }
}

// função principal executada iniciada em CPU
int main(int argc, char const *argv[]) {
  unsigned long *dev_a;
  unsigned long *dev_b;
  unsigned long *dev_c;
  unsigned long *dev_d;
  unsigned long *dev_e;
  unsigned long *dev_f;
  int error=0;
  int i=0, mem=0, mem2=0;


  if (argc == 3) {
     mem = atoi(argv[1]);
     mem2 = atoi(argv[2]);
  } else {
     printf ("./06_mem <mem_contigua> <mem_N_contigua>`\n");
     printf ("Titan = ./06_mem 2040 12000\n");
     printf ("730   = ./06_mem 1930 1970\n");
     exit(1);
  }

  printf ("\n #####  ##### \n Alocação de Memória Global\n");
  i = mem;
  while (!error) {
     // alocação de memória na GPU 
     error = cudaMalloc ((void **) &dev_a, mega*i);
     printf ("\t cudaMalloc (%d MB)\tError Status %d\n", i, error);
     fdcalc <<<1,1>>>(20);
     cudaDeviceSynchronize();
     cudaFree(dev_a);
     i+=10;
  }

  printf ("\n #####  ##### \n Alocação de Memória Global\n");
  error=0;
  i = (int)mem2/6;
  while (!error) {
     // alocação de memória na GPU 
     error = cudaMalloc ((void **) &dev_a, mega*i);
     error = cudaMalloc ((void **) &dev_b, mega*i);
     error = cudaMalloc ((void **) &dev_c, mega*i);
     error = cudaMalloc ((void **) &dev_d, mega*i);
     error = cudaMalloc ((void **) &dev_e, mega*i);
     error = cudaMalloc ((void **) &dev_f, mega*i);
     printf ("\t cudaMalloc (%d MB)\tError Status %d\n", i*6, error);
     fdcalc <<<1,1>>>(20);
     cudaDeviceSynchronize();
     cudaFree(dev_a);
     cudaFree(dev_b);
     cudaFree(dev_c);
     cudaFree(dev_d);
     cudaFree(dev_e);
     cudaFree(dev_f);
     i+=10;
  }
  printf("\n");

  return 0;
}

	.file	"tmpxft_0028d084_00000000-6_06_mem.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2030:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2030:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z24__device_stub__Z6fdcalcii
	.type	_Z24__device_stub__Z6fdcalcii, @function
_Z24__device_stub__Z6fdcalcii:
.LFB2052:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movl	%edi, 12(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z6fdcalci(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L2:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2052:
	.size	_Z24__device_stub__Z6fdcalcii, .-_Z24__device_stub__Z6fdcalcii
	.globl	_Z6fdcalci
	.type	_Z6fdcalci, @function
_Z6fdcalci:
.LFB2053:
	.cfi_startproc
	endbr64
	jmp	_Z24__device_stub__Z6fdcalcii
	.cfi_endproc
.LFE2053:
	.size	_Z6fdcalci, .-_Z6fdcalci
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\n #####  ##### \n Aloca\303\247\303\243o de Mem\303\263ria Global\n"
.LC1:
	.string	"./06_mem <mem_contigua> <mem_N_contigua>`\n"
.LC2:
	.string	"Titan = ./06_mem 2040 12000\n"
.LC3:
	.string	"730   = ./06_mem 1930 1970\n"
.LC4:
	.string	"\t cudaMalloc (%d MB)\tError Status %d\n"
.LC5:
	.string	"\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2027:
	.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
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	cmpl	$3, %edi
	jne	.L9
	movq	8(%rsi), %rdi
	movq	%rsi, %rbx
	leaq	.LC0(%rip), %r15
	leaq	.LC4(%rip), %r14
	call	atoi@PLT
	movq	16(%rbx), %rdi
	movl	%eax, %ebp
	call	atoi@PLT
	movl	%ebp, %r12d
	movq	%r15, %rsi
	movl	$2, %edi
	movl	%eax, %ebx
	sall	$20, %r12d
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	%r12d, %r12
	jmp	.L10
.L9:
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$2, %edi
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L10:
	leaq	16(%rsp), %rax
	movq	%r12, %rsi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	cudaMalloc@PLT
	movl	%ebp, %edx
	movq	%r14, %rsi
	movl	$2, %edi
	movl	%eax, %ecx
	movl	%eax, %r13d
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 84(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 76(%rsp)
	movq	%rdi, 64(%rsp)
	movl	$1, 72(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	movl	$20, %edi
	call	_Z24__device_stub__Z6fdcalcii
.L11:
	call	cudaDeviceSynchronize@PLT
	movq	16(%rsp), %rdi
	addl	$10, %ebp
	addq	$10485760, %r12
	call	cudaFree@PLT
	testl	%r13d, %r13d
	je	.L10
	movq	%r15, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	movabsq	$4294967297, %r13
	call	__printf_chk@PLT
	movl	%ebx, %eax
	movl	$6, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %ebp
	imull	$6, %eax, %ebx
	sall	$20, %ebp
	movslq	%ebp, %rbp
.L13:
	movq	8(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	leaq	24(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	leaq	32(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	leaq	40(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	leaq	48(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	leaq	56(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	movl	%ebx, %edx
	movq	%r14, %rsi
	movl	$2, %edi
	movl	%eax, %ecx
	movl	%eax, %r12d
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r13, %rdx
	movl	$1, %ecx
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r13, 76(%rsp)
	movl	$1, 84(%rsp)
	movq	%r13, 64(%rsp)
	movl	$1, 72(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L12
	movl	$20, %edi
	call	_Z24__device_stub__Z6fdcalcii
.L12:
	call	cudaDeviceSynchronize@PLT
	movq	16(%rsp), %rdi
	addq	$10485760, %rbp
	addl	$60, %ebx
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	testl	%r12d, %r12d
	je	.L13
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	addq	$104, %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
.LFE2027:
	.size	main, .-main
	.section	.rodata.str1.1
.LC6:
	.string	"_Z6fdcalci"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2055:
	.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	.LC6(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z6fdcalci(%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
.LFE2055:
	.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:

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

#define mega 1048576

__global__ void fdcalc(int n)
{
   long n1 = 0;

    for (int j=0; j < 100000; j++) {
      for(int i=2; i < n; ++i) {
         n1=pow(n1,i);
         //n1=n1*i; (GF 730)
       }
     }
}

// função principal executada iniciada em CPU
int main(int argc, char const *argv[]) {
  unsigned long *dev_a;
  unsigned long *dev_b;
  unsigned long *dev_c;
  unsigned long *dev_d;
  unsigned long *dev_e;
  unsigned long *dev_f;
  int error=0;
  int i=0, mem=0, mem2=0;


  if (argc == 3) {
     mem = atoi(argv[1]);
     mem2 = atoi(argv[2]);
  } else {
     printf ("./06_mem <mem_contigua> <mem_N_contigua>`\n");
     printf ("Titan = ./06_mem 2040 12000\n");
     printf ("730   = ./06_mem 1930 1970\n");
     exit(1);
  }

  printf ("\n #####  ##### \n Alocação de Memória Global\n");
  i = mem;
  while (!error) {
     // alocação de memória na GPU 
     error = hipMalloc ((void **) &dev_a, mega*i);
     printf ("\t hipMalloc (%d MB)\tError Status %d\n", i, error);
     fdcalc <<<1,1>>>(20);
     hipDeviceSynchronize();
     hipFree(dev_a);
     i+=10;
  }

  printf ("\n #####  ##### \n Alocação de Memória Global\n");
  error=0;
  i = (int)mem2/6;
  while (!error) {
     // alocação de memória na GPU 
     error = hipMalloc ((void **) &dev_a, mega*i);
     error = hipMalloc ((void **) &dev_b, mega*i);
     error = hipMalloc ((void **) &dev_c, mega*i);
     error = hipMalloc ((void **) &dev_d, mega*i);
     error = hipMalloc ((void **) &dev_e, mega*i);
     error = hipMalloc ((void **) &dev_f, mega*i);
     printf ("\t hipMalloc (%d MB)\tError Status %d\n", i*6, error);
     fdcalc <<<1,1>>>(20);
     hipDeviceSynchronize();
     hipFree(dev_a);
     hipFree(dev_b);
     hipFree(dev_c);
     hipFree(dev_d);
     hipFree(dev_e);
     hipFree(dev_f);
     i+=10;
  }
  printf("\n");

  return 0;
}

	.text
	.file	"06_mem.hip"
	.globl	_Z21__device_stub__fdcalci      # -- Begin function _Z21__device_stub__fdcalci
	.type	_Z21__device_stub__fdcalci,@function
_Z21__device_stub__fdcalci:             # @_Z21__device_stub__fdcalci
	.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	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	16(%rsp), %rbx
	movq	%rax, (%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z6fdcalci, %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	_Z21__device_stub__fdcalci, .Lfunc_end0-_Z21__device_stub__fdcalci
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	cmpl	$3, %edi
	jne	.LBB1_10
# %bb.1:
	movq	%rsi, %r14
	movabsq	$4294967297, %rbx               # imm = 0x100000001
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, %ebp
	movq	16(%r14), %rdi
	callq	atoi
	movl	%eax, %r14d
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	movl	%ebp, %r13d
	shll	$20, %r13d
	leaq	8(%rsp), %r15
.LBB1_2:                                # =>This Inner Loop Header: Depth=1
	movslq	%r13d, %rsi
	movq	%r15, %rdi
	callq	hipMalloc
	movl	%eax, %r12d
	movl	$.L.str.4, %edi
	movl	%ebp, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	printf
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_4
# %bb.3:                                #   in Loop: Header=BB1_2 Depth=1
	movl	$20, %edi
	callq	_Z21__device_stub__fdcalci
.LBB1_4:                                #   in Loop: Header=BB1_2 Depth=1
	callq	hipDeviceSynchronize
	movq	8(%rsp), %rdi
	callq	hipFree
	addl	$10, %ebp
	addl	$10485760, %r13d                # imm = 0xA00000
	testl	%r12d, %r12d
	je	.LBB1_2
# %bb.5:
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	movslq	%r14d, %rax
	imulq	$715827883, %rax, %r13          # imm = 0x2AAAAAAB
	movq	%r13, %rax
	shrq	$63, %rax
	shrq	$32, %r13
	addl	%eax, %r13d
	leal	(,%r13,2), %eax
	leal	(%rax,%rax,2), %ebp
	shll	$20, %r13d
	leaq	24(%rsp), %r14
	leaq	16(%rsp), %r15
.LBB1_6:                                # =>This Inner Loop Header: Depth=1
	movslq	%r13d, %r12
	leaq	8(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	48(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	40(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	32(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movl	%eax, %r12d
	movl	$.L.str.4, %edi
	movl	%ebp, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	printf
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_8
# %bb.7:                                #   in Loop: Header=BB1_6 Depth=1
	movl	$20, %edi
	callq	_Z21__device_stub__fdcalci
.LBB1_8:                                #   in Loop: Header=BB1_6 Depth=1
	callq	hipDeviceSynchronize
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	48(%rsp), %rdi
	callq	hipFree
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	addl	$60, %ebp
	addl	$10485760, %r13d                # imm = 0xA00000
	testl	%r12d, %r12d
	je	.LBB1_6
# %bb.9:
	movl	$10, %edi
	callq	putchar@PLT
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_10:
	.cfi_def_cfa_offset 112
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.Lfunc_end1:
	.size	main, .Lfunc_end1-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	.LBB2_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB2_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z6fdcalci, %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_end2:
	.size	__hip_module_ctor, .Lfunc_end2-__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	.LBB3_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
.LBB3_2:
	retq
.Lfunc_end3:
	.size	__hip_module_dtor, .Lfunc_end3-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z6fdcalci,@object              # @_Z6fdcalci
	.section	.rodata,"a",@progbits
	.globl	_Z6fdcalci
	.p2align	3, 0x0
_Z6fdcalci:
	.quad	_Z21__device_stub__fdcalci
	.size	_Z6fdcalci, 8

	.type	.L.str.4,@object                # @.str.4
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.4:
	.asciz	"\t hipMalloc (%d MB)\tError Status %d\n"
	.size	.L.str.4, 37

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z6fdcalci"
	.size	.L__unnamed_1, 11

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"./06_mem <mem_contigua> <mem_N_contigua>`"
	.size	.Lstr, 42

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Titan = ./06_mem 2040 12000"
	.size	.Lstr.1, 28

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"730   = ./06_mem 1930 1970"
	.size	.Lstr.2, 27

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"\n #####  ##### \n Aloca\303\247\303\243o de Mem\303\263ria Global"
	.size	.Lstr.4, 47

	.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 _Z21__device_stub__fdcalci
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z6fdcalci
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z6fdcalci              ; -- Begin function _Z6fdcalci
	.globl	_Z6fdcalci
	.p2align	8
	.type	_Z6fdcalci,@function
_Z6fdcalci:                             ; @_Z6fdcalci
; %bb.0:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z6fdcalci
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 4
		.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 1
		.amdhsa_next_free_sgpr 1
		.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	_Z6fdcalci, .Lfunc_end0-_Z6fdcalci
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; 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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 4
    .kernarg_segment_size: 4
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z6fdcalci
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z6fdcalci.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
