#include<iostream>
#include <stdio.h>
using namespace std;
int main()
{
    FILE* f;
    //FILE* f1;
    int64_t num;
    int64_t k=0;
    int64_t sum=0;
    int64_t results[1000000];
    f=fopen("22.txt","r");
    //f1=fopen("18norepeat.txt","w");
    for(int64_t i=0;!feof(f);i++)
    {
        k=0;
        fscanf(f, "%ld", &num);
        if(!feof(f))
        {
            for(int t=0;t<sum;t++)
            {
                if(num==results[t])
                {
                    k=1;
                    //cout<<num<<endl;
                    break;
                }
            }
            if(k==0)
            {
                results[sum]=num;
                sum=sum+1;
            }
        }
    }
    fclose(f);
    f=fopen("22.txt","w");
    for(int64_t i=0;i<sum;i++)
    {
        fprintf(f,"%ld ",results[i]);
    }
    cout<<"sum:"<<sum<<endl;
    fclose(f);
    //fclose(f1);
    return 0;
}
	.file	"tmpxft_0027a64f_00000000-6_main.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3638:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3638:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"r"
.LC1:
	.string	"22.txt"
.LC2:
	.string	"%ld"
.LC3:
	.string	"w"
.LC4:
	.string	"%ld "
.LC5:
	.string	"sum:"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3635:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-7999488(%rsp), %r11
	.cfi_def_cfa 11, 7999528
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$536, %rsp
	.cfi_def_cfa_offset 8000064
	leaq	.LC1(%rip), %r12
	leaq	.LC0(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	leaq	.LC2(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 8000008(%rsp)
	xorl	%eax, %eax
	call	fopen@PLT
	movq	%rax, %rbp
.L3:
	movq	%rbp, %rdi
	call	feof@PLT
	testl	%eax, %eax
	jne	.L16
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movq	%rsp, %rdx
	movq	%r13, %rsi
	call	__isoc23_fscanf@PLT
	movq	%rbp, %rdi
	call	feof@PLT
	testl	%eax, %eax
	jne	.L3
	movq	(%rsp), %rdx
	xorl	%eax, %eax
	leaq	8(%rsp), %rcx
.L5:
	cmpq	%rax, %rbx
	jle	.L17
	incq	%rax
	cmpq	%rdx, -8(%rcx,%rax,8)
	jne	.L5
	jmp	.L3
.L16:
	movq	%rbp, %rdi
	leaq	.LC4(%rip), %r13
	call	fclose@PLT
	movq	%r12, %rdi
	leaq	.LC3(%rip), %rsi
	xorl	%r12d, %r12d
	call	fopen@PLT
	movq	%rax, %rbp
.L9:
	cmpq	%r12, %rbx
	jle	.L18
	movq	8(%rsp,%r12,8), %rcx
	movq	%r13, %rdx
	movl	$2, %esi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	incq	%r12
	call	__fprintf_chk@PLT
	jmp	.L9
.L18:
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rbx, %rsi
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movq	%rbp, %rdi
	call	fclose@PLT
	movq	8000008(%rsp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L17:
	movq	%rdx, 8(%rsp,%rbx,8)
	incq	%rbx
	jmp	.L3
.L11:
	addq	$8000024, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.LFE3635:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3661:
	.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
.LFE3661:
	.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<iostream>
#include <stdio.h>
using namespace std;
int main()
{
    FILE* f;
    //FILE* f1;
    int64_t num;
    int64_t k=0;
    int64_t sum=0;
    int64_t results[1000000];
    f=fopen("22.txt","r");
    //f1=fopen("18norepeat.txt","w");
    for(int64_t i=0;!feof(f);i++)
    {
        k=0;
        fscanf(f, "%ld", &num);
        if(!feof(f))
        {
            for(int t=0;t<sum;t++)
            {
                if(num==results[t])
                {
                    k=1;
                    //cout<<num<<endl;
                    break;
                }
            }
            if(k==0)
            {
                results[sum]=num;
                sum=sum+1;
            }
        }
    }
    fclose(f);
    f=fopen("22.txt","w");
    for(int64_t i=0;i<sum;i++)
    {
        fprintf(f,"%ld ",results[i]);
    }
    cout<<"sum:"<<sum<<endl;
    fclose(f);
    //fclose(f1);
    return 0;
}
	.text
	.file	"main.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$8000016, %rsp                  # imm = 0x7A1210
	.cfi_def_cfa_offset 8000048
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	feof
	testl	%eax, %eax
	je	.LBB0_6
# %bb.1:
	xorl	%ebx, %ebx
	jmp	.LBB0_2
.LBB0_6:                                # %.lr.ph30.preheader
	leaq	8(%rsp), %r15
	xorl	%ebx, %ebx
.LBB0_7:                                # %.lr.ph30
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_11 Depth 2
	movl	$.L.str.2, %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movq	%r14, %rdi
	callq	feof
	testl	%eax, %eax
	jne	.LBB0_13
# %bb.8:                                # %.preheader
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	8(%rsp), %rax
	testq	%rbx, %rbx
	jle	.LBB0_12
# %bb.9:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB0_7 Depth=1
	xorl	%ecx, %ecx
.LBB0_11:                               # %.lr.ph
                                        #   Parent Loop BB0_7 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpq	16(%rsp,%rcx,8), %rax
	je	.LBB0_13
# %bb.10:                               #   in Loop: Header=BB0_11 Depth=2
	incq	%rcx
	cmpq	%rcx, %rbx
	jne	.LBB0_11
.LBB0_12:                               # %.critedge
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	%rax, 16(%rsp,%rbx,8)
	incq	%rbx
.LBB0_13:                               # %.loopexit
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	callq	feof
	testl	%eax, %eax
	je	.LBB0_7
.LBB0_2:                                # %._crit_edge
	movq	%r14, %rdi
	callq	fclose
	movl	$.L.str, %edi
	movl	$.L.str.3, %esi
	callq	fopen
	movq	%rax, %r14
	testq	%rbx, %rbx
	jle	.LBB0_5
# %bb.3:                                # %.lr.ph33.preheader
	xorl	%r15d, %r15d
.LBB0_4:                                # %.lr.ph33
                                        # =>This Inner Loop Header: Depth=1
	movq	16(%rsp,%r15,8), %rdx
	movl	$.L.str.4, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	incq	%r15
	cmpq	%r15, %rbx
	jne	.LBB0_4
.LBB0_5:                                # %._crit_edge34
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$4, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movq	%rbx, %rsi
	callq	_ZNSo9_M_insertIlEERSoT_
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%r14, %rdi
	callq	fclose
	xorl	%eax, %eax
	addq	$8000016, %rsp                  # imm = 0x7A1210
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	main, .Lfunc_end0-main
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"22.txt"
	.size	.L.str, 7

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"r"
	.size	.L.str.1, 2

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%ld"
	.size	.L.str.2, 4

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"%ld "
	.size	.L.str.4, 5

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"sum:"
	.size	.L.str.5, 5

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