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

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

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))


SINT32 main() {
    SINT32 n;
    scanf("%d",&n);


    SINT32 ans = 0;

    SINT8 A[1001] = {'0'};
    scanf("%s",A);

    SINT8 B[1001] = {'1'};
    scanf("%s",B);

    SINT8 C[1001] = {'2'};
    scanf("%s",C);


    for (SINT32 i = 0; i < n; i++) {
        if (A[i] == B[i]) {
            if (C[i] == B[i]) {

            } else {
                ans = ans + 1;
            }

        } else {
            if (C[i] == B[i]) {
                ans = ans + 1;
            } else {
                if (C[i] == A[i]) {
                    ans = ans + 1;
                } else {
ans = ans + 2;
                }

            }

        }
    }




    printf("%d\n",ans);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$3064, %rsp
	.cfi_def_cfa_offset 3104
	movq	%fs:40, %rax
	movq	%rax, 3048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbp
	leaq	1024(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	leaq	32(%rsp), %rdi
	movq	%rbp, %rsi
	movq	$48, 16(%rsp)
	movl	$123, %ecx
	rep stosq
	movq	$0, 24(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	movq	%rbx, %rsi
	leaq	1040(%rsp), %rdi
	movq	$49, 1024(%rsp)
	rep stosq
	movq	$0, 1032(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	leaq	2048(%rsp), %rdi
	rep stosq
	leaq	2032(%rsp), %r12
	movq	$50, 2032(%rsp)
	movq	$0, 2040(%rsp)
	movq	%r12, %rsi
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r8
	testl	%r8d, %r8d
	jle	.L9
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	%dil, %sil
	je	.L13
	movl	%edx, %esi
	xorl	%edx, %edx
	cmpb	%dil, %cl
	setne	%dl
	leal	1(%rdx,%rsi), %edx
.L4:
	addq	$1, %rax
	cmpq	%r8, %rax
	je	.L2
.L7:
	movzbl	0(%rbp,%rax), %ecx
	movzbl	(%rbx,%rax), %esi
	movzbl	(%r12,%rax), %edi
	cmpb	%sil, %cl
	jne	.L3
	cmpb	%dil, %cl
	setne	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %edx
	cmpq	%r8, %rax
	jne	.L7
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	3048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$3064, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L4
.L9:
	xorl	%edx, %edx
	jmp	.L2
.L14:
	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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$3064, %rsp
	.cfi_def_cfa_offset 3104
	movq	%fs:40, %rax
	movq	%rax, 3048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbp
	leaq	1024(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	leaq	32(%rsp), %rdi
	movq	%rbp, %rsi
	movq	$48, 16(%rsp)
	movl	$123, %ecx
	rep stosq
	movq	$0, 24(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	movq	%rbx, %rsi
	leaq	1040(%rsp), %rdi
	movq	$49, 1024(%rsp)
	rep stosq
	movq	$0, 1032(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	leaq	2048(%rsp), %rdi
	rep stosq
	leaq	2032(%rsp), %r12
	movq	$50, 2032(%rsp)
	movq	$0, 2040(%rsp)
	movq	%r12, %rsi
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r8
	testl	%r8d, %r8d
	jle	.L9
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	%dil, %sil
	je	.L13
	movl	%edx, %esi
	xorl	%edx, %edx
	cmpb	%dil, %cl
	setne	%dl
	leal	1(%rdx,%rsi), %edx
.L4:
	addq	$1, %rax
	cmpq	%r8, %rax
	je	.L2
.L7:
	movzbl	0(%rbp,%rax), %ecx
	movzbl	(%rbx,%rax), %esi
	movzbl	(%r12,%rax), %edi
	cmpb	%sil, %cl
	jne	.L3
	cmpb	%dil, %cl
	setne	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %edx
	cmpq	%r8, %rax
	jne	.L7
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	3048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$3064, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L4
.L9:
	xorl	%edx, %edx
	jmp	.L2
.L14:
	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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$3064, %rsp
	.cfi_def_cfa_offset 3104
	movq	%fs:40, %rax
	movq	%rax, 3048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbp
	leaq	1024(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	leaq	32(%rsp), %rdi
	movq	%rbp, %rsi
	movq	$48, 16(%rsp)
	movl	$123, %ecx
	rep stosq
	movq	$0, 24(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	movq	%rbx, %rsi
	leaq	1040(%rsp), %rdi
	movq	$49, 1024(%rsp)
	rep stosq
	movq	$0, 1032(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	leaq	2048(%rsp), %rdi
	rep stosq
	leaq	2032(%rsp), %r12
	movq	$50, 2032(%rsp)
	movq	$0, 2040(%rsp)
	movq	%r12, %rsi
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r8
	testl	%r8d, %r8d
	jle	.L9
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	%dil, %sil
	je	.L13
	movl	%edx, %esi
	xorl	%edx, %edx
	cmpb	%dil, %cl
	setne	%dl
	leal	1(%rdx,%rsi), %edx
.L4:
	addq	$1, %rax
	cmpq	%r8, %rax
	je	.L2
.L7:
	movzbl	0(%rbp,%rax), %ecx
	movzbl	(%rbx,%rax), %esi
	movzbl	(%r12,%rax), %edi
	cmpb	%sil, %cl
	jne	.L3
	cmpb	%dil, %cl
	setne	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %edx
	cmpq	%r8, %rax
	jne	.L7
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	3048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$3064, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L4
.L9:
	xorl	%edx, %edx
	jmp	.L2
.L14:
	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:
```
```c
#include <stdio.h>
#include <stdlib.h>

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))


SINT32 main() {
    SINT32 n;
    scanf("%d",&n);


    SINT32 ans = 0;

    SINT8 A[1001] = {'0'};
    scanf("%s",A);

    SINT8 B[1001] = {'1'};
    scanf("%s",B);

    SINT8 C[1001] = {'2'};
    scanf("%s",C);


    for (SINT32 i = 0; i < n; i++) {
        if (A[i] == B[i]) {
            if (C[i] == B[i]) {

            } else {
                ans = ans + 1;
            }

        } else {
            if (C[i] == B[i]) {
                ans = ans + 1;
            } else {
                if (C[i] == A[i]) {
                    ans = ans + 1;
                } else {
ans = ans + 2;
                }

            }

        }
    }




    printf("%d\n",ans);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))


SINT32 main() {
    SINT32 n;
    scanf("%d",&n);


    SINT32 ans = 0;

    SINT8 A[1001] = {'0'};
    scanf("%s",A);

    SINT8 B[1001] = {'1'};
    scanf("%s",B);

    SINT8 C[1001] = {'2'};
    scanf("%s",C);


    for (SINT32 i = 0; i < n; i++) {
        if (A[i] == B[i]) {
            if (C[i] == B[i]) {

            } else {
                ans = ans + 1;
            }

        } else {
            if (C[i] == B[i]) {
                ans = ans + 1;
            } else {
                if (C[i] == A[i]) {
                    ans = ans + 1;
                } else {
ans = ans + 2;
                }

            }

        }
    }




    printf("%d\n",ans);
	return 0;
}```

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.
Optimized Assembly Code:

9
cifferent
different
different
 4
west
east
w`it
 7
ukoknez
touitsu
program
 9
cjfferent
different
different
 4
wesu
east
w`it
 9
cjfferent
different
tnereffid
 4
wetu
east
w`it
 7
ukoknez
ustiunt
program
 9
tnereffic
cifferent
tnereffid
 4
wetv
`est
tiaw

1
 4
 13
 2
 5
 10
 6
 12
 9
 7

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

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

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))


SINT32 main() {
    SINT32 n;
    scanf("%d",&n);


    SINT32 ans = 0;

    SINT8 A[1001] = {'0'};
    scanf("%s",A);

    SINT8 B[1001] = {'1'};
    scanf("%s",B);

    SINT8 C[1001] = {'2'};
    scanf("%s",C);


    for (SINT32 i = 0; i < n; i++) {
        if (A[i] == B[i]) {
            if (C[i] == B[i]) {

            } else {
                ans = ans + 1;
            }

        } else {
            if (C[i] == B[i]) {
                ans = ans + 1;
            } else {
                if (C[i] == A[i]) {
                    ans = ans + 1;
                } else {
ans = ans + 2;
                }

            }

        }
    }




    printf("%d\n",ans);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$3064, %rsp
	.cfi_def_cfa_offset 3104
	movq	%fs:40, %rax
	movq	%rax, 3048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbp
	leaq	1024(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	leaq	32(%rsp), %rdi
	movq	%rbp, %rsi
	movq	$48, 16(%rsp)
	movl	$123, %ecx
	rep stosq
	movq	$0, 24(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	movq	%rbx, %rsi
	leaq	1040(%rsp), %rdi
	movq	$49, 1024(%rsp)
	rep stosq
	movq	$0, 1032(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	leaq	2048(%rsp), %rdi
	rep stosq
	leaq	2032(%rsp), %r12
	movq	$50, 2032(%rsp)
	movq	$0, 2040(%rsp)
	movq	%r12, %rsi
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r8
	testl	%r8d, %r8d
	jle	.L9
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	%dil, %sil
	je	.L13
	movl	%edx, %esi
	xorl	%edx, %edx
	cmpb	%dil, %cl
	setne	%dl
	leal	1(%rdx,%rsi), %edx
.L4:
	addq	$1, %rax
	cmpq	%r8, %rax
	je	.L2
.L7:
	movzbl	0(%rbp,%rax), %ecx
	movzbl	(%rbx,%rax), %esi
	movzbl	(%r12,%rax), %edi
	cmpb	%sil, %cl
	jne	.L3
	cmpb	%dil, %cl
	setne	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %edx
	cmpq	%r8, %rax
	jne	.L7
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	3048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$3064, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L4
.L9:
	xorl	%edx, %edx
	jmp	.L2
.L14:
	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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$3064, %rsp
	.cfi_def_cfa_offset 3104
	movq	%fs:40, %rax
	movq	%rax, 3048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbp
	leaq	1024(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	leaq	32(%rsp), %rdi
	movq	%rbp, %rsi
	movq	$48, 16(%rsp)
	movl	$123, %ecx
	rep stosq
	movq	$0, 24(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	movq	%rbx, %rsi
	leaq	1040(%rsp), %rdi
	movq	$49, 1024(%rsp)
	rep stosq
	movq	$0, 1032(%rsp)
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movq	%r12, %rax
	movl	$123, %ecx
	leaq	2048(%rsp), %rdi
	rep stosq
	leaq	2032(%rsp), %r12
	movq	$50, 2032(%rsp)
	movq	$0, 2040(%rsp)
	movq	%r12, %rsi
	movb	$0, (%rdi)
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r8
	testl	%r8d, %r8d
	jle	.L9
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	%dil, %sil
	je	.L13
	movl	%edx, %esi
	xorl	%edx, %edx
	cmpb	%dil, %cl
	setne	%dl
	leal	1(%rdx,%rsi), %edx
.L4:
	addq	$1, %rax
	cmpq	%r8, %rax
	je	.L2
.L7:
	movzbl	0(%rbp,%rax), %ecx
	movzbl	(%rbx,%rax), %esi
	movzbl	(%r12,%rax), %edi
	cmpb	%sil, %cl
	jne	.L3
	cmpb	%dil, %cl
	setne	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %edx
	cmpq	%r8, %rax
	jne	.L7
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	3048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$3064, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L4
.L9:
	xorl	%edx, %edx
	jmp	.L2
.L14:
	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:
```