Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>

void read_Tarou_Hanako(int *Tarou,int *Hanako,int n,int m);
int sum_Tarou_cards(int *Tarou,int n);
int sum_Hanako_cards(int *Hanako,int m);
int  find_cardset_exchanged(int *Tarou,int *Hanako,int n,int m,int difference,int *cards_exchanged,int bigger);

int main(void) {
	while(1){
		int n,m;
		scanf("%d %d",&n,&m);
		if(n==0 && m==0){return 0;}

		int Tarou[n];
		int Hanako[m];
		read_Tarou_Hanako(Tarou,Hanako,n,m);

		int sum_Tarou,sum_Hanako;
		sum_Tarou = sum_Tarou_cards(Tarou,n);
		sum_Hanako = sum_Hanako_cards(Hanako,m);
		int bigger;		// 1 Tarou > Hanako  2 Tarou < Hanako
		if(sum_Tarou>sum_Hanako){bigger = 1;}
		else{bigger = 0;}
		int sum;
		sum = sum_Tarou + sum_Hanako;
		if((sum % 2) != 0){printf("%d\n",-1);continue;}
		int middle;
		middle = sum / 2;
		int difference;
		difference = middle - sum_Tarou;
		if(difference<0){difference = difference * (-1);}

		int cards_exchanged[2];
		int found_or_not;
		found_or_not = find_cardset_exchanged(Tarou,Hanako,n,m,difference,cards_exchanged,bigger);
		if(found_or_not == 0){printf("%d\n",-1);continue;}

		printf("%d %d\n",cards_exchanged[0],cards_exchanged[1]);
	}

}

void read_Tarou_Hanako(int *Tarou,int *Hanako,int n,int m){
	int i;
	for(i=0;i<n;i++){
		scanf("%d",&Tarou[i]);
	}
	for(i=0;i<m;i++){
		scanf("%d",&Hanako[i]);
	}
}

int sum_Tarou_cards(int *Tarou,int n){
	int sum = 0;
	int i;
	for(i=0;i<n;i++){
		sum += Tarou[i];
	}
	return sum;
}

int sum_Hanako_cards(int *Hanako,int m){
	int sum = 0;
	int i;
	for(i=0;i<m;i++){
		sum += Hanako[i];
	}
	return sum;
}

int find_cardset_exchanged(int *Tarou,int *Hanako,int n,int m,int difference,int *cards_exchanged,int bigger){
	int i,j;
	int cardnumber_difference;
	int sum_cards_exchanged = 999;
	int tmp_sum_cards_exchanged;
	int flag = 0;

	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			if(bigger==1 && Tarou[i]<Hanako[j]){continue;}
			if(bigger==0 && Tarou[i]>Hanako[j]){continue;}
			cardnumber_difference = Tarou[i] - Hanako[j];
			tmp_sum_cards_exchanged = Tarou[i] + Hanako[j];
			if(cardnumber_difference<0){cardnumber_difference *= (-1);}
			if(cardnumber_difference == difference && tmp_sum_cards_exchanged<sum_cards_exchanged){
				flag = 1;
				sum_cards_exchanged = tmp_sum_cards_exchanged;
				cards_exchanged[0] = Tarou[i];
				cards_exchanged[1] = Hanako[j];
			}
		}
	}
	if(flag == 1){return 1;}
	else{return 0;}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
.L17:
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-128(%rbp), %rdx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-128(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	jmp	.L19
.L2:
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	-128(%rbp), %ecx
	movl	-132(%rbp), %edx
	movq	-72(%rbp), %rsi
	movq	-88(%rbp), %rax
	movq	%rax, %rdi
	call	read_Tarou_Hanako
	movl	-132(%rbp), %edx
	movq	-88(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	sum_Tarou_cards
	movl	%eax, -116(%rbp)
	movl	-128(%rbp), %edx
	movq	-72(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	sum_Hanako_cards
	movl	%eax, -112(%rbp)
	movl	-116(%rbp), %eax
	cmpl	-112(%rbp), %eax
	jle	.L10
	movl	$1, -124(%rbp)
	jmp	.L11
.L10:
	movl	$0, -124(%rbp)
.L11:
	movl	-116(%rbp), %edx
	movl	-112(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -108(%rbp)
	movl	-108(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	movl	$-1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	movl	-108(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -104(%rbp)
	movl	-104(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, -120(%rbp)
	cmpl	$0, -120(%rbp)
	jns	.L14
	negl	-120(%rbp)
.L14:
	movl	-128(%rbp), %ecx
	movl	-132(%rbp), %edi
	leaq	-64(%rbp), %rdx
	movl	-120(%rbp), %esi
	movq	-72(%rbp), %r10
	movq	-88(%rbp), %r11
	subq	$8, %rsp
	movl	-124(%rbp), %eax
	pushq	%rax
	movq	%rdx, %r9
	movl	%esi, %r8d
	movl	%edi, %edx
	movq	%r10, %rsi
	movq	%r11, %rdi
	call	find_cardset_exchanged
	addq	$16, %rsp
	movl	%eax, -100(%rbp)
	cmpl	$0, -100(%rbp)
	jne	.L15
	movl	$-1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L15:
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%rbx, %rsp
	jmp	.L17
.L13:
	movq	%rbx, %rsp
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC3:
	.string	"%d"
	.text
	.globl	read_Tarou_Hanako
	.type	read_Tarou_Hanako, @function
read_Tarou_Hanako:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	%ecx, -40(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L21
.L22:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L21:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L22
	movl	$0, -4(%rbp)
	jmp	.L23
.L24:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L23:
	movl	-4(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jl	.L24
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_Tarou_Hanako, .-read_Tarou_Hanako
	.globl	sum_Tarou_cards
	.type	sum_Tarou_cards, @function
sum_Tarou_cards:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L26
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L26:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L27
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sum_Tarou_cards, .-sum_Tarou_cards
	.globl	sum_Hanako_cards
	.type	sum_Hanako_cards, @function
sum_Hanako_cards:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L30
.L31:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L30:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L31
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sum_Hanako_cards, .-sum_Hanako_cards
	.globl	find_cardset_exchanged
	.type	find_cardset_exchanged, @function
find_cardset_exchanged:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movl	%ecx, -56(%rbp)
	movl	%r8d, -60(%rbp)
	movq	%r9, -72(%rbp)
	movl	$999, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L34
.L41:
	movl	$0, -20(%rbp)
	jmp	.L35
.L40:
	cmpl	$1, 16(%rbp)
	jne	.L36
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L44
.L36:
	cmpl	$0, 16(%rbp)
	jne	.L38
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jg	.L45
.L38:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -16(%rbp)
	jns	.L39
	negl	-16(%rbp)
.L39:
	movl	-16(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jne	.L37
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L37
	movl	$1, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rax
	movl	%edx, (%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	-72(%rbp), %rdx
	addq	$4, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L37
.L44:
	nop
	jmp	.L37
.L45:
	nop
.L37:
	addl	$1, -20(%rbp)
.L35:
	movl	-20(%rbp), %eax
	cmpl	-56(%rbp), %eax
	jl	.L40
	addl	$1, -24(%rbp)
.L34:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L41
	cmpl	$1, -8(%rbp)
	jne	.L42
	movl	$1, %eax
	jmp	.L43
.L42:
	movl	$0, %eax
.L43:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	find_cardset_exchanged, .-find_cardset_exchanged
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	read_Tarou_Hanako
	.type	read_Tarou_Hanako, @function
read_Tarou_Hanako:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	testl	%edx, %edx
	jle	.L2
	leal	-1(%rdx), %eax
	movq	%rdi, %rbx
	leaq	.LC0(%rip), %r12
	leaq	4(%rdi,%rax,4), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r14, %rbx
	jne	.L3
.L2:
	testl	%r13d, %r13d
	jle	.L1
	leal	-1(%r13), %eax
	movq	%rbp, %rbx
	leaq	.LC0(%rip), %r12
	leaq	4(%rbp,%rax,4), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %rbp
	jne	.L5
.L1:
	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
.LFE40:
	.size	read_Tarou_Hanako, .-read_Tarou_Hanako
	.p2align 4
	.globl	sum_Tarou_cards
	.type	sum_Tarou_cards, @function
sum_Tarou_cards:
.LFB41:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	testl	%esi, %esi
	jle	.L16
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%esi, %ecx
	movq	%rdi, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	16(%rdi,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rcx, %rax
	jne	.L13
	movdqa	%xmm0, %xmm1
	movl	%esi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %sil
	je	.L19
.L12:
	movslq	%ecx, %rdi
	leaq	0(,%rdi,4), %r8
	addl	(%rdx,%rdi,4), %eax
	leal	1(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L10
	addl	$2, %ecx
	addl	4(%rdx,%r8), %eax
	cmpl	%ecx, %esi
	jle	.L10
	addl	8(%rdx,%r8), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	xorl	%eax, %eax
.L10:
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	ret
.L17:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L12
	.cfi_endproc
.LFE41:
	.size	sum_Tarou_cards, .-sum_Tarou_cards
	.p2align 4
	.globl	sum_Hanako_cards
	.type	sum_Hanako_cards, @function
sum_Hanako_cards:
.LFB45:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	testl	%esi, %esi
	jle	.L26
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L27
	movl	%esi, %ecx
	movq	%rdi, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	16(%rdi,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L23:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rcx, %rax
	jne	.L23
	movdqa	%xmm0, %xmm1
	movl	%esi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %sil
	je	.L29
.L22:
	movslq	%ecx, %rdi
	leaq	0(,%rdi,4), %r8
	addl	(%rdx,%rdi,4), %eax
	leal	1(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L20
	addl	$2, %ecx
	addl	4(%rdx,%r8), %eax
	cmpl	%ecx, %esi
	jle	.L20
	addl	8(%rdx,%r8), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	xorl	%eax, %eax
.L20:
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	ret
.L27:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L22
	.cfi_endproc
.LFE45:
	.size	sum_Hanako_cards, .-sum_Hanako_cards
	.p2align 4
	.globl	find_cardset_exchanged
	.type	find_cardset_exchanged, @function
find_cardset_exchanged:
.LFB43:
	.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
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	56(%rsp), %r15d
	movq	%rsi, -16(%rsp)
	testl	%edx, %edx
	jle	.L30
	subl	$1, %edx
	movq	%rdi, %rax
	movl	%ecx, %r13d
	xorl	%r12d, %r12d
	leaq	4(%rdi,%rdx,4), %rdi
	leal	-1(%rcx), %edx
	xorl	%r14d, %r14d
	movl	$999, %ecx
	movq	%rdi, -8(%rsp)
	movq	-16(%rsp), %rdi
	leaq	4(%rdi,%rdx,4), %rdi
	.p2align 4,,10
	.p2align 3
.L43:
	testl	%r13d, %r13d
	jle	.L38
	cmpl	$1, %r15d
	je	.L45
	movq	-16(%rsp), %rsi
	testl	%r15d, %r15d
	jne	.L72
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%rax), %edx
	movl	(%rsi), %r10d
	cmpl	%edx, %r10d
	jl	.L39
	movl	%r10d, %r11d
	leal	(%r10,%rdx), %ebx
	subl	%edx, %r11d
	cmpl	%edx, %r10d
	cmove	%r14d, %r11d
	cmpl	%ecx, %ebx
	jge	.L39
	cmpl	%r8d, %r11d
	jne	.L39
	movl	%edx, (%r9)
	movl	(%rsi), %edx
	movl	%ebx, %ecx
	movl	$1, %r12d
	movl	%edx, 4(%r9)
.L39:
	addq	$4, %rsi
	cmpq	%rdi, %rsi
	jne	.L34
.L38:
	addq	$4, %rax
	cmpq	-8(%rsp), %rax
	jne	.L43
.L30:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movl	%r12d, %eax
	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
	.p2align 4,,10
	.p2align 3
.L45:
	.cfi_restore_state
	movq	-16(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L33:
	movl	(%rax), %esi
	movl	(%rdx), %r10d
	cmpl	%r10d, %esi
	jl	.L42
	movl	%esi, %ebx
	leal	(%rsi,%r10), %r11d
	subl	%r10d, %ebx
	cmpl	%r8d, %ebx
	jne	.L42
	cmpl	%ecx, %r11d
	jge	.L42
	movl	%esi, (%r9)
	movl	(%rdx), %ecx
	movl	$1, %r12d
	movl	%ecx, 4(%r9)
	movl	%r11d, %ecx
.L42:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L33
	addq	$4, %rax
	cmpq	-8(%rsp), %rax
	jne	.L43
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%rsi, %r10
	.p2align 4,,10
	.p2align 3
.L37:
	movl	(%rax), %edx
	movl	(%r10), %esi
	movl	%edx, %r11d
	movl	%esi, %ebp
	leal	(%rdx,%rsi), %ebx
	subl	%edx, %ebp
	subl	%esi, %r11d
	cmovs	%ebp, %r11d
	cmpl	%ebx, %ecx
	jle	.L36
	cmpl	%r11d, %r8d
	jne	.L36
	movl	%edx, (%r9)
	movl	(%r10), %edx
	movl	%ebx, %ecx
	movl	$1, %r12d
	movl	%edx, 4(%r9)
.L36:
	addq	$4, %r10
	cmpq	%rdi, %r10
	jne	.L37
	addq	$4, %rax
	cmpq	-8(%rsp), %rax
	jne	.L43
	jmp	.L30
	.cfi_endproc
.LFE43:
	.size	find_cardset_exchanged, .-find_cardset_exchanged
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$72, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-68(%rbp), %rax
	movq	%rax, -112(%rbp)
	leaq	-72(%rbp), %rax
	movq	%rax, -104(%rbp)
	.p2align 4,,10
	.p2align 3
.L74:
	movq	-112(%rbp), %rdx
	movq	-104(%rbp), %rsi
	xorl	%eax, %eax
	movq	%rsp, -96(%rbp)
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jne	.L75
	movl	-68(%rbp), %eax
	movl	%eax, -84(%rbp)
	testl	%eax, %eax
	je	.L131
	movslq	-84(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rsp, %r14
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L103
.L132:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L132
.L103:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L104
	orq	$0, -8(%rsp,%rdx)
.L104:
	movq	%rsp, %r13
.L83:
	movl	-84(%rbp), %eax
	testl	%eax, %eax
	jg	.L85
	movl	-72(%rbp), %r10d
	movl	-68(%rbp), %r11d
	.p2align 4,,10
	.p2align 3
.L87:
	xorl	%edx, %edx
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	testl	%r11d, %r11d
	jg	.L101
	jmp	.L99
	.p2align 4,,10
	.p2align 3
.L75:
	movslq	%eax, %rdx
	movq	%rsp, %rsi
	leaq	15(,%rdx,4), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L78
.L133:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L133
.L78:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L79
	orq	$0, -8(%rsp,%rcx)
.L79:
	movslq	-68(%rbp), %rcx
	movq	%rsp, %rdi
	movq	%rsp, %rdx
	movq	%rdx, %r14
	movl	%ecx, -84(%rbp)
	leaq	15(,%rcx,4), %rcx
	movq	%rcx, %rsi
	andq	$-4096, %rcx
	subq	%rcx, %rdi
	andq	$-16, %rsi
	cmpq	%rdi, %rsp
	je	.L81
.L134:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L134
.L81:
	andl	$4095, %esi
	subq	%rsi, %rsp
	testq	%rsi, %rsi
	je	.L82
	orq	$0, -8(%rsp,%rsi)
.L82:
	movq	%rsp, %r13
	testl	%eax, %eax
	jle	.L83
	movl	%eax, %eax
	movq	%rdx, %r15
	leaq	(%rdx,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L84:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	cmpq	%r12, %r15
	jne	.L84
	movl	-84(%rbp), %esi
	testl	%esi, %esi
	jle	.L89
.L85:
	movl	-84(%rbp), %eax
	movq	%r13, %r15
	subl	$1, %eax
	leaq	4(%r13,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L88:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	cmpq	%r12, %r15
	jne	.L88
.L89:
	movl	-72(%rbp), %r10d
	movl	-68(%rbp), %r11d
	testl	%r10d, %r10d
	jle	.L87
	leal	-1(%r10), %eax
	cmpl	$2, %eax
	jbe	.L107
	movl	%r10d, %edx
	movq	%r14, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	salq	$4, %rdx
	addq	%r14, %rdx
	.p2align 4,,10
	.p2align 3
.L91:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L91
	movdqa	%xmm0, %xmm1
	movl	%r10d, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %r10b
	je	.L92
.L90:
	movslq	%eax, %rcx
	leaq	0(,%rcx,4), %rsi
	addl	(%r14,%rcx,4), %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %r10d
	jle	.L92
	addl	$2, %eax
	addl	4(%r14,%rsi), %edx
	cmpl	%eax, %r10d
	jle	.L92
	addl	8(%r14,%rsi), %edx
.L92:
	testl	%r11d, %r11d
	jle	.L108
.L101:
	testl	%r11d, %r11d
	movl	$1, %esi
	cmovg	%r11d, %esi
	cmpl	$3, %r11d
	jle	.L109
	movl	%esi, %ecx
	pxor	%xmm0, %xmm0
	movq	%r13, %rax
	shrl	$2, %ecx
	salq	$4, %rcx
	addq	%r13, %rcx
	.p2align 4,,10
	.p2align 3
.L95:
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	paddd	%xmm3, %xmm0
	cmpq	%rax, %rcx
	jne	.L95
	movdqa	%xmm0, %xmm1
	movl	%esi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	andl	$3, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	je	.L96
.L94:
	movslq	%ecx, %rsi
	leaq	0(,%rsi,4), %rdi
	addl	0(%r13,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%r11d, %esi
	jge	.L96
	addl	$2, %ecx
	addl	4(%r13,%rdi), %eax
	cmpl	%r11d, %ecx
	jge	.L96
	addl	8(%r13,%rdi), %eax
.L96:
	leal	(%rdx,%rax), %ecx
.L93:
	cmpl	%edx, %eax
	setl	%al
	movzbl	%al, %eax
	testb	$1, %cl
	jne	.L100
	movl	%ecx, %r8d
	shrl	$31, %r8d
	addl	%ecx, %r8d
	movl	%edx, %ecx
	sarl	%r8d
	subl	%r8d, %ecx
	subl	%edx, %r8d
	cmovs	%ecx, %r8d
.L99:
	subq	$8, %rsp
	movl	%r11d, %ecx
	movl	%r10d, %edx
	pushq	%rax
	leaq	-64(%rbp), %r9
	movq	%r13, %rsi
	movq	%r14, %rdi
	call	find_cardset_exchanged
	popq	%rdx
	popq	%rcx
	testl	%eax, %eax
	je	.L100
	movl	-60(%rbp), %ecx
	movl	-64(%rbp), %edx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-96(%rbp), %rsp
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L100:
	movl	$-1, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-96(%rbp), %rsp
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L108:
	movl	%edx, %ecx
	xorl	%eax, %eax
	jmp	.L93
.L109:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L94
.L107:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L90
.L131:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L135
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L135:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	read_Tarou_Hanako
	.type	read_Tarou_Hanako, @function
read_Tarou_Hanako:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	testl	%edx, %edx
	jle	.L2
	leal	-1(%rdx), %eax
	movq	%rdi, %rbx
	leaq	.LC0(%rip), %r12
	leaq	4(%rdi,%rax,4), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r14, %rbx
	jne	.L3
.L2:
	testl	%r13d, %r13d
	jle	.L1
	leal	-1(%r13), %eax
	movq	%rbp, %rbx
	leaq	.LC0(%rip), %r12
	leaq	4(%rbp,%rax,4), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %rbp
	jne	.L5
.L1:
	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
.LFE40:
	.size	read_Tarou_Hanako, .-read_Tarou_Hanako
	.p2align 4
	.globl	sum_Tarou_cards
	.type	sum_Tarou_cards, @function
sum_Tarou_cards:
.LFB41:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	testl	%esi, %esi
	jle	.L16
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%esi, %ecx
	movq	%rdi, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	16(%rdi,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rcx, %rax
	jne	.L13
	movdqa	%xmm0, %xmm1
	movl	%esi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %sil
	je	.L19
.L12:
	movslq	%ecx, %rdi
	leaq	0(,%rdi,4), %r8
	addl	(%rdx,%rdi,4), %eax
	leal	1(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L10
	addl	$2, %ecx
	addl	4(%rdx,%r8), %eax
	cmpl	%ecx, %esi
	jle	.L10
	addl	8(%rdx,%r8), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	xorl	%eax, %eax
.L10:
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	ret
.L17:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L12
	.cfi_endproc
.LFE41:
	.size	sum_Tarou_cards, .-sum_Tarou_cards
	.p2align 4
	.globl	sum_Hanako_cards
	.type	sum_Hanako_cards, @function
sum_Hanako_cards:
.LFB45:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	testl	%esi, %esi
	jle	.L26
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L27
	movl	%esi, %ecx
	movq	%rdi, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	16(%rdi,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L23:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rcx, %rax
	jne	.L23
	movdqa	%xmm0, %xmm1
	movl	%esi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %sil
	je	.L29
.L22:
	movslq	%ecx, %rdi
	leaq	0(,%rdi,4), %r8
	addl	(%rdx,%rdi,4), %eax
	leal	1(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L20
	addl	$2, %ecx
	addl	4(%rdx,%r8), %eax
	cmpl	%ecx, %esi
	jle	.L20
	addl	8(%rdx,%r8), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	xorl	%eax, %eax
.L20:
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	ret
.L27:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L22
	.cfi_endproc
.LFE45:
	.size	sum_Hanako_cards, .-sum_Hanako_cards
	.p2align 4
	.globl	find_cardset_exchanged
	.type	find_cardset_exchanged, @function
find_cardset_exchanged:
.LFB43:
	.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
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	56(%rsp), %r15d
	movq	%rsi, -16(%rsp)
	testl	%edx, %edx
	jle	.L30
	subl	$1, %edx
	movq	%rdi, %rax
	movl	%ecx, %r13d
	xorl	%r12d, %r12d
	leaq	4(%rdi,%rdx,4), %rdi
	leal	-1(%rcx), %edx
	xorl	%r14d, %r14d
	movl	$999, %ecx
	movq	%rdi, -8(%rsp)
	movq	-16(%rsp), %rdi
	leaq	4(%rdi,%rdx,4), %rdi
	.p2align 4,,10
	.p2align 3
.L43:
	testl	%r13d, %r13d
	jle	.L38
	cmpl	$1, %r15d
	je	.L45
	movq	-16(%rsp), %rsi
	testl	%r15d, %r15d
	jne	.L72
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%rax), %edx
	movl	(%rsi), %r10d
	cmpl	%edx, %r10d
	jl	.L39
	movl	%r10d, %r11d
	leal	(%r10,%rdx), %ebx
	subl	%edx, %r11d
	cmpl	%edx, %r10d
	cmove	%r14d, %r11d
	cmpl	%ecx, %ebx
	jge	.L39
	cmpl	%r8d, %r11d
	jne	.L39
	movl	%edx, (%r9)
	movl	(%rsi), %edx
	movl	%ebx, %ecx
	movl	$1, %r12d
	movl	%edx, 4(%r9)
.L39:
	addq	$4, %rsi
	cmpq	%rdi, %rsi
	jne	.L34
.L38:
	addq	$4, %rax
	cmpq	-8(%rsp), %rax
	jne	.L43
.L30:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movl	%r12d, %eax
	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
	.p2align 4,,10
	.p2align 3
.L45:
	.cfi_restore_state
	movq	-16(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L33:
	movl	(%rax), %esi
	movl	(%rdx), %r10d
	cmpl	%r10d, %esi
	jl	.L42
	movl	%esi, %ebx
	leal	(%rsi,%r10), %r11d
	subl	%r10d, %ebx
	cmpl	%r8d, %ebx
	jne	.L42
	cmpl	%ecx, %r11d
	jge	.L42
	movl	%esi, (%r9)
	movl	(%rdx), %ecx
	movl	$1, %r12d
	movl	%ecx, 4(%r9)
	movl	%r11d, %ecx
.L42:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L33
	addq	$4, %rax
	cmpq	-8(%rsp), %rax
	jne	.L43
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%rsi, %r10
	.p2align 4,,10
	.p2align 3
.L37:
	movl	(%rax), %edx
	movl	(%r10), %esi
	movl	%edx, %r11d
	movl	%esi, %ebp
	leal	(%rdx,%rsi), %ebx
	subl	%edx, %ebp
	subl	%esi, %r11d
	cmovs	%ebp, %r11d
	cmpl	%ebx, %ecx
	jle	.L36
	cmpl	%r11d, %r8d
	jne	.L36
	movl	%edx, (%r9)
	movl	(%r10), %edx
	movl	%ebx, %ecx
	movl	$1, %r12d
	movl	%edx, 4(%r9)
.L36:
	addq	$4, %r10
	cmpq	%rdi, %r10
	jne	.L37
	addq	$4, %rax
	cmpq	-8(%rsp), %rax
	jne	.L43
	jmp	.L30
	.cfi_endproc
.LFE43:
	.size	find_cardset_exchanged, .-find_cardset_exchanged
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$72, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-68(%rbp), %rax
	movq	%rax, -112(%rbp)
	leaq	-72(%rbp), %rax
	movq	%rax, -104(%rbp)
	.p2align 4,,10
	.p2align 3
.L74:
	movq	-112(%rbp), %rdx
	movq	-104(%rbp), %rsi
	xorl	%eax, %eax
	movq	%rsp, -96(%rbp)
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jne	.L75
	movl	-68(%rbp), %eax
	movl	%eax, -84(%rbp)
	testl	%eax, %eax
	je	.L131
	movslq	-84(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rsp, %r14
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L103
.L132:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L132
.L103:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L104
	orq	$0, -8(%rsp,%rdx)
.L104:
	movq	%rsp, %r13
.L83:
	movl	-84(%rbp), %eax
	testl	%eax, %eax
	jg	.L85
	movl	-72(%rbp), %r10d
	movl	-68(%rbp), %r11d
	.p2align 4,,10
	.p2align 3
.L87:
	xorl	%edx, %edx
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	testl	%r11d, %r11d
	jg	.L101
	jmp	.L99
	.p2align 4,,10
	.p2align 3
.L75:
	movslq	%eax, %rdx
	movq	%rsp, %rsi
	leaq	15(,%rdx,4), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L78
.L133:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L133
.L78:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L79
	orq	$0, -8(%rsp,%rcx)
.L79:
	movslq	-68(%rbp), %rcx
	movq	%rsp, %rdi
	movq	%rsp, %rdx
	movq	%rdx, %r14
	movl	%ecx, -84(%rbp)
	leaq	15(,%rcx,4), %rcx
	movq	%rcx, %rsi
	andq	$-4096, %rcx
	subq	%rcx, %rdi
	andq	$-16, %rsi
	cmpq	%rdi, %rsp
	je	.L81
.L134:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L134
.L81:
	andl	$4095, %esi
	subq	%rsi, %rsp
	testq	%rsi, %rsi
	je	.L82
	orq	$0, -8(%rsp,%rsi)
.L82:
	movq	%rsp, %r13
	testl	%eax, %eax
	jle	.L83
	movl	%eax, %eax
	movq	%rdx, %r15
	leaq	(%rdx,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L84:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	cmpq	%r12, %r15
	jne	.L84
	movl	-84(%rbp), %esi
	testl	%esi, %esi
	jle	.L89
.L85:
	movl	-84(%rbp), %eax
	movq	%r13, %r15
	subl	$1, %eax
	leaq	4(%r13,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L88:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	cmpq	%r12, %r15
	jne	.L88
.L89:
	movl	-72(%rbp), %r10d
	movl	-68(%rbp), %r11d
	testl	%r10d, %r10d
	jle	.L87
	leal	-1(%r10), %eax
	cmpl	$2, %eax
	jbe	.L107
	movl	%r10d, %edx
	movq	%r14, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	salq	$4, %rdx
	addq	%r14, %rdx
	.p2align 4,,10
	.p2align 3
.L91:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L91
	movdqa	%xmm0, %xmm1
	movl	%r10d, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %r10b
	je	.L92
.L90:
	movslq	%eax, %rcx
	leaq	0(,%rcx,4), %rsi
	addl	(%r14,%rcx,4), %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %r10d
	jle	.L92
	addl	$2, %eax
	addl	4(%r14,%rsi), %edx
	cmpl	%eax, %r10d
	jle	.L92
	addl	8(%r14,%rsi), %edx
.L92:
	testl	%r11d, %r11d
	jle	.L108
.L101:
	testl	%r11d, %r11d
	movl	$1, %esi
	cmovg	%r11d, %esi
	cmpl	$3, %r11d
	jle	.L109
	movl	%esi, %ecx
	pxor	%xmm0, %xmm0
	movq	%r13, %rax
	shrl	$2, %ecx
	salq	$4, %rcx
	addq	%r13, %rcx
	.p2align 4,,10
	.p2align 3
.L95:
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	paddd	%xmm3, %xmm0
	cmpq	%rax, %rcx
	jne	.L95
	movdqa	%xmm0, %xmm1
	movl	%esi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	andl	$3, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	je	.L96
.L94:
	movslq	%ecx, %rsi
	leaq	0(,%rsi,4), %rdi
	addl	0(%r13,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%r11d, %esi
	jge	.L96
	addl	$2, %ecx
	addl	4(%r13,%rdi), %eax
	cmpl	%r11d, %ecx
	jge	.L96
	addl	8(%r13,%rdi), %eax
.L96:
	leal	(%rdx,%rax), %ecx
.L93:
	cmpl	%edx, %eax
	setl	%al
	movzbl	%al, %eax
	testb	$1, %cl
	jne	.L100
	movl	%ecx, %r8d
	shrl	$31, %r8d
	addl	%ecx, %r8d
	movl	%edx, %ecx
	sarl	%r8d
	subl	%r8d, %ecx
	subl	%edx, %r8d
	cmovs	%ecx, %r8d
.L99:
	subq	$8, %rsp
	movl	%r11d, %ecx
	movl	%r10d, %edx
	pushq	%rax
	leaq	-64(%rbp), %r9
	movq	%r13, %rsi
	movq	%r14, %rdi
	call	find_cardset_exchanged
	popq	%rdx
	popq	%rcx
	testl	%eax, %eax
	je	.L100
	movl	-60(%rbp), %ecx
	movl	-64(%rbp), %edx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-96(%rbp), %rsp
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L100:
	movl	$-1, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-96(%rbp), %rsp
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L108:
	movl	%edx, %ecx
	xorl	%eax, %eax
	jmp	.L93
.L109:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L94
.L107:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L90
.L131:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L135
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L135:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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 <stdio.h>
#include <stdlib.h>

void read_Tarou_Hanako(int *Tarou,int *Hanako,int n,int m);
int sum_Tarou_cards(int *Tarou,int n);
int sum_Hanako_cards(int *Hanako,int m);
int  find_cardset_exchanged(int *Tarou,int *Hanako,int n,int m,int difference,int *cards_exchanged,int bigger);

int main(void) {
	while(1){
		int n,m;
		scanf("%d %d",&n,&m);
		if(n==0 && m==0){return 0;}

		int Tarou[n];
		int Hanako[m];
		read_Tarou_Hanako(Tarou,Hanako,n,m);

		int sum_Tarou,sum_Hanako;
		sum_Tarou = sum_Tarou_cards(Tarou,n);
		sum_Hanako = sum_Hanako_cards(Hanako,m);
		int bigger;		// 1 Tarou > Hanako  2 Tarou < Hanako
		if(sum_Tarou>sum_Hanako){bigger = 1;}
		else{bigger = 0;}
		int sum;
		sum = sum_Tarou + sum_Hanako;
		if((sum % 2) != 0){printf("%d\n",-1);continue;}
		int middle;
		middle = sum / 2;
		int difference;
		difference = middle - sum_Tarou;
		if(difference<0){difference = difference * (-1);}

		int cards_exchanged[2];
		int found_or_not;
		found_or_not = find_cardset_exchanged(Tarou,Hanako,n,m,difference,cards_exchanged,bigger);
		if(found_or_not == 0){printf("%d\n",-1);continue;}

		printf("%d %d\n",cards_exchanged[0],cards_exchanged[1]);
	}

}

void read_Tarou_Hanako(int *Tarou,int *Hanako,int n,int m){
	int i;
	for(i=0;i<n;i++){
		scanf("%d",&Tarou[i]);
	}
	for(i=0;i<m;i++){
		scanf("%d",&Hanako[i]);
	}
}

int sum_Tarou_cards(int *Tarou,int n){
	int sum = 0;
	int i;
	for(i=0;i<n;i++){
		sum += Tarou[i];
	}
	return sum;
}

int sum_Hanako_cards(int *Hanako,int m){
	int sum = 0;
	int i;
	for(i=0;i<m;i++){
		sum += Hanako[i];
	}
	return sum;
}

int find_cardset_exchanged(int *Tarou,int *Hanako,int n,int m,int difference,int *cards_exchanged,int bigger){
	int i,j;
	int cardnumber_difference;
	int sum_cards_exchanged = 999;
	int tmp_sum_cards_exchanged;
	int flag = 0;

	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			if(bigger==1 && Tarou[i]<Hanako[j]){continue;}
			if(bigger==0 && Tarou[i]>Hanako[j]){continue;}
			cardnumber_difference = Tarou[i] - Hanako[j];
			tmp_sum_cards_exchanged = Tarou[i] + Hanako[j];
			if(cardnumber_difference<0){cardnumber_difference *= (-1);}
			if(cardnumber_difference == difference && tmp_sum_cards_exchanged<sum_cards_exchanged){
				flag = 1;
				sum_cards_exchanged = tmp_sum_cards_exchanged;
				cards_exchanged[0] = Tarou[i];
				cards_exchanged[1] = Hanako[j];
			}
		}
	}
	if(flag == 1){return 1;}
	else{return 0;}
}
2 2
1
5
4
7
6 5
3
9
5
2
3
3
12
2
7
3
5
4 5
10
0
3
8
1
9
6
0
6
7 4
1
1
2
1
2
1
4
2
3
4
3
2 3
1
1
2
2
2
0 0
 2 2
1
5
4
7
6 5
3
9
5
2
3
3
12
2
7
3
5
4 5
10
0
3
8
1
9
6
0
6
7 4
1
1
2
1
2
1
4
2
3
4
6
2 3
1
1
2
2
2
0 0
 2 2
1
5
4
7
6 5
3
9
7
2
3
3
12
2
7
3
5
4 5
10
0
3
8
1
9
6
0
6
7 4
1
1
2
1
2
1
4
2
3
4
6
2 3
1
1
2
2
2
0 0
 2 2
1
5
4
7
6 5
3
9
7
2
3
3
12
2
7
3
5
4 5
10
0
2
8
1
9
6
0
6
7 4
1
1
2
1
2
1
4
2
3
4
6
2 3
1
1
2
2
2
0 0
 2 2
1
5
7
7
6 5
2
9
7
2
3
3
12
2
7
3
5
4 5
10
0
2
8
1
9
6
0
6
7 4
1
1
2
1
2
1
4
2
3
4
6
2 3
1
1
2
2
2
0 0
 2 2
1
5
4
7
6 5
3
9
5
2
3
3
11
2
7
3
5
4 5
10
0
3
8
1
9
6
0
6
7 4
1
1
2
1
2
1
4
2
3
4
6
2 3
1
1
2
2
2
0 0
 2 2
1
5
3
7
6 5
2
9
7
2
3
3
24
2
7
3
5
4 5
10
0
2
8
1
9
6
0
6
7 4
1
1
2
1
2
1
4
2
3
4
6
2 3
1
1
2
2
2
0 0
 2 2
1
5
3
7
6 5
2
9
7
2
3
3
24
2
7
3
5
4 5
10
0
2
8
1
9
6
0
6
7 4
1
1
2
1
2
1
4
2
2
4
6
2 3
1
1
2
2
2
0 0
 2 2
1
5
11
7
6 5
2
9
7
2
3
3
24
2
7
3
1
4 5
10
0
2
8
1
9
6
0
6
7 4
1
1
2
1
0
1
6
2
3
4
6
2 3
1
1
2
2
2
0 0
 2 2
1
5
3
7
6 5
2
9
7
2
3
3
24
2
7
3
5
4 5
10
0
2
8
1
9
6
0
6
7 4
1
1
2
1
2
1
4
2
2
4
6
2 3
1
1
4
2
2
0 0

-1
3 5
-1
2 2
-1
 -1
3 5
-1
-1
-1
 -1
2 3
-1
-1
-1
 -1
2 3
0 1
-1
-1
 -1
-1
0 1
-1
-1
 -1
-1
-1
-1
-1
 1 3
-1
0 1
-1
-1
 1 3
-1
0 1
1 2
-1
 1 7
-1
0 1
-1
-1
 1 3
-1
0 1
1 2
1 4

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>

void read_Tarou_Hanako(int *Tarou,int *Hanako,int n,int m);
int sum_Tarou_cards(int *Tarou,int n);
int sum_Hanako_cards(int *Hanako,int m);
int  find_cardset_exchanged(int *Tarou,int *Hanako,int n,int m,int difference,int *cards_exchanged,int bigger);

int main(void) {
	while(1){
		int n,m;
		scanf("%d %d",&n,&m);
		if(n==0 && m==0){return 0;}

		int Tarou[n];
		int Hanako[m];
		read_Tarou_Hanako(Tarou,Hanako,n,m);

		int sum_Tarou,sum_Hanako;
		sum_Tarou = sum_Tarou_cards(Tarou,n);
		sum_Hanako = sum_Hanako_cards(Hanako,m);
		int bigger;		// 1 Tarou > Hanako  2 Tarou < Hanako
		if(sum_Tarou>sum_Hanako){bigger = 1;}
		else{bigger = 0;}
		int sum;
		sum = sum_Tarou + sum_Hanako;
		if((sum % 2) != 0){printf("%d\n",-1);continue;}
		int middle;
		middle = sum / 2;
		int difference;
		difference = middle - sum_Tarou;
		if(difference<0){difference = difference * (-1);}

		int cards_exchanged[2];
		int found_or_not;
		found_or_not = find_cardset_exchanged(Tarou,Hanako,n,m,difference,cards_exchanged,bigger);
		if(found_or_not == 0){printf("%d\n",-1);continue;}

		printf("%d %d\n",cards_exchanged[0],cards_exchanged[1]);
	}

}

void read_Tarou_Hanako(int *Tarou,int *Hanako,int n,int m){
	int i;
	for(i=0;i<n;i++){
		scanf("%d",&Tarou[i]);
	}
	for(i=0;i<m;i++){
		scanf("%d",&Hanako[i]);
	}
}

int sum_Tarou_cards(int *Tarou,int n){
	int sum = 0;
	int i;
	for(i=0;i<n;i++){
		sum += Tarou[i];
	}
	return sum;
}

int sum_Hanako_cards(int *Hanako,int m){
	int sum = 0;
	int i;
	for(i=0;i<m;i++){
		sum += Hanako[i];
	}
	return sum;
}

int find_cardset_exchanged(int *Tarou,int *Hanako,int n,int m,int difference,int *cards_exchanged,int bigger){
	int i,j;
	int cardnumber_difference;
	int sum_cards_exchanged = 999;
	int tmp_sum_cards_exchanged;
	int flag = 0;

	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			if(bigger==1 && Tarou[i]<Hanako[j]){continue;}
			if(bigger==0 && Tarou[i]>Hanako[j]){continue;}
			cardnumber_difference = Tarou[i] - Hanako[j];
			tmp_sum_cards_exchanged = Tarou[i] + Hanako[j];
			if(cardnumber_difference<0){cardnumber_difference *= (-1);}
			if(cardnumber_difference == difference && tmp_sum_cards_exchanged<sum_cards_exchanged){
				flag = 1;
				sum_cards_exchanged = tmp_sum_cards_exchanged;
				cards_exchanged[0] = Tarou[i];
				cards_exchanged[1] = Hanako[j];
			}
		}
	}
	if(flag == 1){return 1;}
	else{return 0;}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
.L17:
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-128(%rbp), %rdx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-128(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	jmp	.L19
.L2:
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	-128(%rbp), %ecx
	movl	-132(%rbp), %edx
	movq	-72(%rbp), %rsi
	movq	-88(%rbp), %rax
	movq	%rax, %rdi
	call	read_Tarou_Hanako
	movl	-132(%rbp), %edx
	movq	-88(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	sum_Tarou_cards
	movl	%eax, -116(%rbp)
	movl	-128(%rbp), %edx
	movq	-72(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	sum_Hanako_cards
	movl	%eax, -112(%rbp)
	movl	-116(%rbp), %eax
	cmpl	-112(%rbp), %eax
	jle	.L10
	movl	$1, -124(%rbp)
	jmp	.L11
.L10:
	movl	$0, -124(%rbp)
.L11:
	movl	-116(%rbp), %edx
	movl	-112(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -108(%rbp)
	movl	-108(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	movl	$-1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	movl	-108(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -104(%rbp)
	movl	-104(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, -120(%rbp)
	cmpl	$0, -120(%rbp)
	jns	.L14
	negl	-120(%rbp)
.L14:
	movl	-128(%rbp), %ecx
	movl	-132(%rbp), %edi
	leaq	-64(%rbp), %rdx
	movl	-120(%rbp), %esi
	movq	-72(%rbp), %r10
	movq	-88(%rbp), %r11
	subq	$8, %rsp
	movl	-124(%rbp), %eax
	pushq	%rax
	movq	%rdx, %r9
	movl	%esi, %r8d
	movl	%edi, %edx
	movq	%r10, %rsi
	movq	%r11, %rdi
	call	find_cardset_exchanged
	addq	$16, %rsp
	movl	%eax, -100(%rbp)
	cmpl	$0, -100(%rbp)
	jne	.L15
	movl	$-1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L15:
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%rbx, %rsp
	jmp	.L17
.L13:
	movq	%rbx, %rsp
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC3:
	.string	"%d"
	.text
	.globl	read_Tarou_Hanako
	.type	read_Tarou_Hanako, @function
read_Tarou_Hanako:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	%ecx, -40(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L21
.L22:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L21:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L22
	movl	$0, -4(%rbp)
	jmp	.L23
.L24:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L23:
	movl	-4(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jl	.L24
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_Tarou_Hanako, .-read_Tarou_Hanako
	.globl	sum_Tarou_cards
	.type	sum_Tarou_cards, @function
sum_Tarou_cards:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L26
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L26:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L27
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sum_Tarou_cards, .-sum_Tarou_cards
	.globl	sum_Hanako_cards
	.type	sum_Hanako_cards, @function
sum_Hanako_cards:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L30
.L31:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L30:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L31
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sum_Hanako_cards, .-sum_Hanako_cards
	.globl	find_cardset_exchanged
	.type	find_cardset_exchanged, @function
find_cardset_exchanged:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movl	%ecx, -56(%rbp)
	movl	%r8d, -60(%rbp)
	movq	%r9, -72(%rbp)
	movl	$999, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L34
.L41:
	movl	$0, -20(%rbp)
	jmp	.L35
.L40:
	cmpl	$1, 16(%rbp)
	jne	.L36
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L44
.L36:
	cmpl	$0, 16(%rbp)
	jne	.L38
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jg	.L45
.L38:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -16(%rbp)
	jns	.L39
	negl	-16(%rbp)
.L39:
	movl	-16(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jne	.L37
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L37
	movl	$1, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rax
	movl	%edx, (%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	-72(%rbp), %rdx
	addq	$4, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L37
.L44:
	nop
	jmp	.L37
.L45:
	nop
.L37:
	addl	$1, -20(%rbp)
.L35:
	movl	-20(%rbp), %eax
	cmpl	-56(%rbp), %eax
	jl	.L40
	addl	$1, -24(%rbp)
.L34:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L41
	cmpl	$1, -8(%rbp)
	jne	.L42
	movl	$1, %eax
	jmp	.L43
.L42:
	movl	$0, %eax
.L43:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	find_cardset_exchanged, .-find_cardset_exchanged
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
.L17:
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-128(%rbp), %rdx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-128(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	jmp	.L19
.L2:
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	-128(%rbp), %ecx
	movl	-132(%rbp), %edx
	movq	-72(%rbp), %rsi
	movq	-88(%rbp), %rax
	movq	%rax, %rdi
	call	read_Tarou_Hanako
	movl	-132(%rbp), %edx
	movq	-88(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	sum_Tarou_cards
	movl	%eax, -116(%rbp)
	movl	-128(%rbp), %edx
	movq	-72(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	sum_Hanako_cards
	movl	%eax, -112(%rbp)
	movl	-116(%rbp), %eax
	cmpl	-112(%rbp), %eax
	jle	.L10
	movl	$1, -124(%rbp)
	jmp	.L11
.L10:
	movl	$0, -124(%rbp)
.L11:
	movl	-116(%rbp), %edx
	movl	-112(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -108(%rbp)
	movl	-108(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	movl	$-1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	movl	-108(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -104(%rbp)
	movl	-104(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, -120(%rbp)
	cmpl	$0, -120(%rbp)
	jns	.L14
	negl	-120(%rbp)
.L14:
	movl	-128(%rbp), %ecx
	movl	-132(%rbp), %edi
	leaq	-64(%rbp), %rdx
	movl	-120(%rbp), %esi
	movq	-72(%rbp), %r10
	movq	-88(%rbp), %r11
	subq	$8, %rsp
	movl	-124(%rbp), %eax
	pushq	%rax
	movq	%rdx, %r9
	movl	%esi, %r8d
	movl	%edi, %edx
	movq	%r10, %rsi
	movq	%r11, %rdi
	call	find_cardset_exchanged
	addq	$16, %rsp
	movl	%eax, -100(%rbp)
	cmpl	$0, -100(%rbp)
	jne	.L15
	movl	$-1, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L15:
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%rbx, %rsp
	jmp	.L17
.L13:
	movq	%rbx, %rsp
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC3:
	.string	"%d"
	.text
	.globl	read_Tarou_Hanako
	.type	read_Tarou_Hanako, @function
read_Tarou_Hanako:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	%ecx, -40(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L21
.L22:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L21:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L22
	movl	$0, -4(%rbp)
	jmp	.L23
.L24:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L23:
	movl	-4(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jl	.L24
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_Tarou_Hanako, .-read_Tarou_Hanako
	.globl	sum_Tarou_cards
	.type	sum_Tarou_cards, @function
sum_Tarou_cards:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L26
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L26:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L27
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sum_Tarou_cards, .-sum_Tarou_cards
	.globl	sum_Hanako_cards
	.type	sum_Hanako_cards, @function
sum_Hanako_cards:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L30
.L31:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L30:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L31
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sum_Hanako_cards, .-sum_Hanako_cards
	.globl	find_cardset_exchanged
	.type	find_cardset_exchanged, @function
find_cardset_exchanged:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movl	%ecx, -56(%rbp)
	movl	%r8d, -60(%rbp)
	movq	%r9, -72(%rbp)
	movl	$999, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L34
.L41:
	movl	$0, -20(%rbp)
	jmp	.L35
.L40:
	cmpl	$1, 16(%rbp)
	jne	.L36
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L44
.L36:
	cmpl	$0, 16(%rbp)
	jne	.L38
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jg	.L45
.L38:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -16(%rbp)
	jns	.L39
	negl	-16(%rbp)
.L39:
	movl	-16(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jne	.L37
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L37
	movl	$1, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rax
	movl	%edx, (%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	-72(%rbp), %rdx
	addq	$4, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L37
.L44:
	nop
	jmp	.L37
.L45:
	nop
.L37:
	addl	$1, -20(%rbp)
.L35:
	movl	-20(%rbp), %eax
	cmpl	-56(%rbp), %eax
	jl	.L40
	addl	$1, -24(%rbp)
.L34:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L41
	cmpl	$1, -8(%rbp)
	jne	.L42
	movl	$1, %eax
	jmp	.L43
.L42:
	movl	$0, %eax
.L43:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	find_cardset_exchanged, .-find_cardset_exchanged
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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:
