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

```c
// AOJ Volume2 0226

#include <stdio.h>

int main(void)
{
    int r, a;
    int rn[4], an[4];
    int h, b;
    int i, j;
    
    while (1){
        scanf("%d%d", &r, &a);
        if (r == 0 && a == 0){
            break;
        }
        
        for (i = 0; i < 4; i++){
            rn[i] = r % 10;
            r /= 10;
            an[i] = a % 10;
            a /= 10;
        }
        
        h = b = 0;
        for (i = 0; i < 4; i++){
            for (j = 0; j < 4; j++){
                if (i == j && rn[i] == an[j]){
                    h++;
                }
                else if (i != j && rn[i] == an[j]){
                    b++;
                }
            }
        }
        printf("%d %d\n", h, b);
    }
    return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-68(%rbp), %eax
	testl	%eax, %eax
	je	.L16
.L2:
	movl	$0, -56(%rbp)
	jmp	.L4
.L5:
	movl	-72(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -72(%rbp)
	movl	-68(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -32(%rbp,%rax,4)
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
	addl	$1, -56(%rbp)
.L4:
	cmpl	$3, -56(%rbp)
	jle	.L5
	movl	$0, -60(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -64(%rbp)
	movl	$0, -56(%rbp)
	jmp	.L6
.L11:
	movl	$0, -52(%rbp)
	jmp	.L7
.L10:
	movl	-56(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jne	.L8
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L8
	addl	$1, -64(%rbp)
	jmp	.L9
.L8:
	movl	-56(%rbp), %eax
	cmpl	-52(%rbp), %eax
	je	.L9
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L9
	addl	$1, -60(%rbp)
.L9:
	addl	$1, -52(%rbp)
.L7:
	cmpl	$3, -52(%rbp)
	jle	.L10
	addl	$1, -56(%rbp)
.L6:
	cmpl	$3, -56(%rbp)
	jle	.L11
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
```

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%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r12
	movq	%rsp, %rbp
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%eax, %r14
	movl	%eax, %ecx
	movslq	%edx, %r9
	imulq	$1717986919, %r14, %r14
	sarl	$31, %ecx
	imulq	$1717986919, %r9, %r9
	sarq	$34, %r14
	subl	%ecx, %r14d
	sarq	$34, %r9
	movslq	%r14d, %r11
	leal	(%r11,%r11,4), %esi
	movq	%r11, %rcx
	addl	%esi, %esi
	imulq	$1717986919, %r11, %r11
	subl	%esi, %eax
	movl	%eax, %r14d
	movl	%edx, %eax
	sarl	$31, %eax
	sarq	$34, %r11
	subl	%eax, %r9d
	movslq	%r9d, %r8
	leal	(%r8,%r8,4), %esi
	movq	%r8, %rax
	addl	%esi, %esi
	imulq	$1717986919, %r8, %r8
	subl	%esi, %edx
	movl	%edx, %r9d
	movl	%ecx, %edx
	sarl	$31, %edx
	sarq	$34, %r8
	subl	%edx, %r11d
	movslq	%r11d, %r10
	leal	(%r10,%r10,4), %esi
	movq	%r10, %rdx
	addl	%esi, %esi
	imulq	$1717986919, %r10, %r10
	subl	%esi, %ecx
	movl	%ecx, %r11d
	movl	%eax, %ecx
	sarl	$31, %ecx
	sarq	$34, %r10
	subl	%ecx, %r8d
	movslq	%r8d, %rdi
	leal	(%rdi,%rdi,4), %esi
	movq	%rdi, %rcx
	addl	%esi, %esi
	imulq	$1717986919, %rdi, %rdi
	subl	%esi, %eax
	movl	%eax, %r8d
	movl	%edx, %eax
	sarl	$31, %eax
	sarq	$34, %rdi
	subl	%eax, %r10d
	leal	(%r10,%r10,4), %esi
	movl	%r10d, %eax
	addl	%esi, %esi
	subl	%esi, %edx
	movl	%edx, %r10d
	movl	%ecx, %edx
	sarl	$31, %edx
	subl	%edx, %edi
	leal	(%rdi,%rdi,4), %esi
	movl	%edi, %edx
	movl	%ecx, %edi
	movl	%eax, %ecx
	addl	%esi, %esi
	sarl	$31, %ecx
	subl	%esi, %edi
	movslq	%eax, %rsi
	imulq	$1717986919, %rsi, %rsi
	sarq	$34, %rsi
	subl	%ecx, %esi
	leal	(%rsi,%rsi,4), %r15d
	movl	%esi, %ecx
	addl	%r15d, %r15d
	movl	%ecx, (%rsp)
	movl	%edx, %ecx
	subl	%r15d, %eax
	sarl	$31, %ecx
	movl	%eax, %esi
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %r15d
	movl	%eax, %ecx
	movl	%edx, %eax
	xorl	%edx, %edx
	addl	%r15d, %r15d
	movl	%ecx, 4(%rsp)
	subl	%r15d, %eax
	cmpl	%r9d, %r14d
	sete	%dl
	xorl	%ecx, %ecx
	cmpl	%r8d, %r14d
	sete	%cl
	xorl	%r15d, %r15d
	cmpl	%edi, %r14d
	sete	%r15b
	addl	%r15d, %ecx
	cmpl	%eax, %r14d
	sete	%r14b
	movzbl	%r14b, %r14d
	addl	%r14d, %ecx
	xorl	%r14d, %r14d
	cmpl	%r11d, %r9d
	sete	%r14b
	addl	%r14d, %ecx
	xorl	%r14d, %r14d
	cmpl	%r8d, %r11d
	sete	%r14b
	addl	%r14d, %edx
	xorl	%r14d, %r14d
	cmpl	%edi, %r11d
	sete	%r14b
	addl	%r14d, %ecx
	cmpl	%eax, %r11d
	sete	%r11b
	movzbl	%r11b, %r11d
	addl	%r11d, %ecx
	xorl	%r11d, %r11d
	cmpl	%r10d, %r9d
	sete	%r11b
	addl	%r11d, %ecx
	xorl	%r11d, %r11d
	cmpl	%r10d, %r8d
	sete	%r11b
	addl	%r11d, %ecx
	xorl	%r11d, %r11d
	cmpl	%edi, %r10d
	sete	%r11b
	addl	%r11d, %edx
	cmpl	%eax, %r10d
	sete	%r10b
	movzbl	%r10b, %r10d
	addl	%r10d, %ecx
	cmpl	%esi, %r9d
	sete	%r9b
	movzbl	%r9b, %r9d
	addl	%r9d, %ecx
	cmpl	%esi, %r8d
	sete	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %ecx
	cmpl	%esi, %edi
	sete	%dil
	movzbl	%dil, %edi
	addl	%edi, %ecx
	cmpl	%eax, %esi
	movl	$1, %edi
	movq	%r13, %rsi
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	movq	%r12, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movl	4(%rsp), %edx
	movl	%eax, %edi
	orl	%edx, %edi
	jne	.L21
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$24, %rsp
	.cfi_remember_state
	.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
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r12
	movq	%rsp, %rbp
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%eax, %r14
	movl	%eax, %ecx
	movslq	%edx, %r9
	imulq	$1717986919, %r14, %r14
	sarl	$31, %ecx
	imulq	$1717986919, %r9, %r9
	sarq	$34, %r14
	subl	%ecx, %r14d
	sarq	$34, %r9
	movslq	%r14d, %r11
	leal	(%r11,%r11,4), %esi
	movq	%r11, %rcx
	addl	%esi, %esi
	imulq	$1717986919, %r11, %r11
	subl	%esi, %eax
	movl	%eax, %r14d
	movl	%edx, %eax
	sarl	$31, %eax
	sarq	$34, %r11
	subl	%eax, %r9d
	movslq	%r9d, %r8
	leal	(%r8,%r8,4), %esi
	movq	%r8, %rax
	addl	%esi, %esi
	imulq	$1717986919, %r8, %r8
	subl	%esi, %edx
	movl	%edx, %r9d
	movl	%ecx, %edx
	sarl	$31, %edx
	sarq	$34, %r8
	subl	%edx, %r11d
	movslq	%r11d, %r10
	leal	(%r10,%r10,4), %esi
	movq	%r10, %rdx
	addl	%esi, %esi
	imulq	$1717986919, %r10, %r10
	subl	%esi, %ecx
	movl	%ecx, %r11d
	movl	%eax, %ecx
	sarl	$31, %ecx
	sarq	$34, %r10
	subl	%ecx, %r8d
	movslq	%r8d, %rdi
	leal	(%rdi,%rdi,4), %esi
	movq	%rdi, %rcx
	addl	%esi, %esi
	imulq	$1717986919, %rdi, %rdi
	subl	%esi, %eax
	movl	%eax, %r8d
	movl	%edx, %eax
	sarl	$31, %eax
	sarq	$34, %rdi
	subl	%eax, %r10d
	leal	(%r10,%r10,4), %esi
	movl	%r10d, %eax
	addl	%esi, %esi
	subl	%esi, %edx
	movl	%edx, %r10d
	movl	%ecx, %edx
	sarl	$31, %edx
	subl	%edx, %edi
	leal	(%rdi,%rdi,4), %esi
	movl	%edi, %edx
	movl	%ecx, %edi
	movl	%eax, %ecx
	addl	%esi, %esi
	sarl	$31, %ecx
	subl	%esi, %edi
	movslq	%eax, %rsi
	imulq	$1717986919, %rsi, %rsi
	sarq	$34, %rsi
	subl	%ecx, %esi
	leal	(%rsi,%rsi,4), %r15d
	movl	%esi, %ecx
	addl	%r15d, %r15d
	movl	%ecx, (%rsp)
	movl	%edx, %ecx
	subl	%r15d, %eax
	sarl	$31, %ecx
	movl	%eax, %esi
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %r15d
	movl	%eax, %ecx
	movl	%edx, %eax
	xorl	%edx, %edx
	addl	%r15d, %r15d
	movl	%ecx, 4(%rsp)
	subl	%r15d, %eax
	cmpl	%r9d, %r14d
	sete	%dl
	xorl	%ecx, %ecx
	cmpl	%r8d, %r14d
	sete	%cl
	xorl	%r15d, %r15d
	cmpl	%edi, %r14d
	sete	%r15b
	addl	%r15d, %ecx
	cmpl	%eax, %r14d
	sete	%r14b
	movzbl	%r14b, %r14d
	addl	%r14d, %ecx
	xorl	%r14d, %r14d
	cmpl	%r11d, %r9d
	sete	%r14b
	addl	%r14d, %ecx
	xorl	%r14d, %r14d
	cmpl	%r8d, %r11d
	sete	%r14b
	addl	%r14d, %edx
	xorl	%r14d, %r14d
	cmpl	%edi, %r11d
	sete	%r14b
	addl	%r14d, %ecx
	cmpl	%eax, %r11d
	sete	%r11b
	movzbl	%r11b, %r11d
	addl	%r11d, %ecx
	xorl	%r11d, %r11d
	cmpl	%r10d, %r9d
	sete	%r11b
	addl	%r11d, %ecx
	xorl	%r11d, %r11d
	cmpl	%r10d, %r8d
	sete	%r11b
	addl	%r11d, %ecx
	xorl	%r11d, %r11d
	cmpl	%edi, %r10d
	sete	%r11b
	addl	%r11d, %edx
	cmpl	%eax, %r10d
	sete	%r10b
	movzbl	%r10b, %r10d
	addl	%r10d, %ecx
	cmpl	%esi, %r9d
	sete	%r9b
	movzbl	%r9b, %r9d
	addl	%r9d, %ecx
	cmpl	%esi, %r8d
	sete	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %ecx
	cmpl	%esi, %edi
	sete	%dil
	movzbl	%dil, %edi
	addl	%edi, %ecx
	cmpl	%eax, %esi
	movl	$1, %edi
	movq	%r13, %rsi
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	movq	%r12, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movl	4(%rsp), %edx
	movl	%eax, %edi
	orl	%edx, %edi
	jne	.L21
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$24, %rsp
	.cfi_remember_state
	.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
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

// AOJ Volume2 0226

#include <stdio.h>

int main(void)
{
    int r, a;
    int rn[4], an[4];
    int h, b;
    int i, j;
    
    while (1){
        scanf("%d%d", &r, &a);
        if (r == 0 && a == 0){
            break;
        }
        
        for (i = 0; i < 4; i++){
            rn[i] = r % 10;
            r /= 10;
            an[i] = a % 10;
            a /= 10;
        }
        
        h = b = 0;
        for (i = 0; i < 4; i++){
            for (j = 0; j < 4; j++){
                if (i == j && rn[i] == an[j]){
                    h++;
                }
                else if (i != j && rn[i] == an[j]){
                    b++;
                }
            }
        }
        printf("%d %d\n", h, b);
    }
    return (0);
}
1234 10660
1234 1354
1234 1234
1230 1023
0123 1234
0 0
 1234 10660
1964 1354
1234 1234
1230 1023
0123 1234
0 0
 1234 10660
2242 1354
1234 1234
1230 1023
0123 1234
0 0
 1234 5678
1234 1354
1234 1200
1230 1023
0123 1234
0 0
 1234 10660
2242 1354
1234 1234
1230 1023
0123 1884
0 0
 1234 5678
1234 1354
1234 1234
1957 1023
0123 1234
0 0
 1234 10660
3108 1354
1234 1234
1230 1023
0123 1884
0 0
 1234 10976
2102 1354
1234 1234
1230 1849
0123 1234
0 0
 1234 10660
1964 1354
1234 1234
1344 1023
0123 1234
0 0
 1234 10976
2102 1354
1234 1234
1230 1849
0123 1863
0 0

0 0
2 1
4 0
1 3
0 3
 0 0
2 0
4 0
1 3
0 3
 0 0
0 1
4 0
1 3
0 3
 0 0
2 1
2 0
1 3
0 3
 0 0
0 1
4 0
1 3
0 1
 0 0
2 1
4 0
1 0
0 3
 0 0
0 2
4 0
1 3
0 1
 0 0
0 1
4 0
1 0
0 3
 0 0
2 0
4 0
1 1
0 3
 0 0
0 1
4 0
1 0
1 1

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

```c
// AOJ Volume2 0226

#include <stdio.h>

int main(void)
{
    int r, a;
    int rn[4], an[4];
    int h, b;
    int i, j;
    
    while (1){
        scanf("%d%d", &r, &a);
        if (r == 0 && a == 0){
            break;
        }
        
        for (i = 0; i < 4; i++){
            rn[i] = r % 10;
            r /= 10;
            an[i] = a % 10;
            a /= 10;
        }
        
        h = b = 0;
        for (i = 0; i < 4; i++){
            for (j = 0; j < 4; j++){
                if (i == j && rn[i] == an[j]){
                    h++;
                }
                else if (i != j && rn[i] == an[j]){
                    b++;
                }
            }
        }
        printf("%d %d\n", h, b);
    }
    return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-68(%rbp), %eax
	testl	%eax, %eax
	je	.L16
.L2:
	movl	$0, -56(%rbp)
	jmp	.L4
.L5:
	movl	-72(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -72(%rbp)
	movl	-68(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -32(%rbp,%rax,4)
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
	addl	$1, -56(%rbp)
.L4:
	cmpl	$3, -56(%rbp)
	jle	.L5
	movl	$0, -60(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -64(%rbp)
	movl	$0, -56(%rbp)
	jmp	.L6
.L11:
	movl	$0, -52(%rbp)
	jmp	.L7
.L10:
	movl	-56(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jne	.L8
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L8
	addl	$1, -64(%rbp)
	jmp	.L9
.L8:
	movl	-56(%rbp), %eax
	cmpl	-52(%rbp), %eax
	je	.L9
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L9
	addl	$1, -60(%rbp)
.L9:
	addl	$1, -52(%rbp)
.L7:
	cmpl	$3, -52(%rbp)
	jle	.L10
	addl	$1, -56(%rbp)
.L6:
	cmpl	$3, -56(%rbp)
	jle	.L11
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
```

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 %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-68(%rbp), %eax
	testl	%eax, %eax
	je	.L16
.L2:
	movl	$0, -56(%rbp)
	jmp	.L4
.L5:
	movl	-72(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -72(%rbp)
	movl	-68(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -32(%rbp,%rax,4)
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
	addl	$1, -56(%rbp)
.L4:
	cmpl	$3, -56(%rbp)
	jle	.L5
	movl	$0, -60(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -64(%rbp)
	movl	$0, -56(%rbp)
	jmp	.L6
.L11:
	movl	$0, -52(%rbp)
	jmp	.L7
.L10:
	movl	-56(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jne	.L8
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L8
	addl	$1, -64(%rbp)
	jmp	.L9
.L8:
	movl	-56(%rbp), %eax
	cmpl	-52(%rbp), %eax
	je	.L9
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L9
	addl	$1, -60(%rbp)
.L9:
	addl	$1, -52(%rbp)
.L7:
	cmpl	$3, -52(%rbp)
	jle	.L10
	addl	$1, -56(%rbp)
.L6:
	cmpl	$3, -56(%rbp)
	jle	.L11
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
