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 <string.h>

int main(void) {
	int N;
	char s[128];
	char t[128];
	int i;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%127s", s) != 1) return 1;
	if (scanf("%127s", t) != 1) return 1;
	for (i = N; i > 0; i--) {
		if (strncmp(s + N - i, t, i) == 0) {
			printf("%d\n", N + N - i);
			return 0;
		}
	}
	printf("%d\n", N + N);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%127s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
.L4:
	movl	$1, %r12d
.L1:
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	addq	$312, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.L2:
	.cfi_restore_state
	leaq	32(%rsp), %rbx
	leaq	.LC1(%rip), %rbp
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	leaq	160(%rsp), %r14
	xorl	%eax, %eax
	movq	%rbp, %rdi
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	movslq	28(%rsp), %rax
	xorl	%r15d, %r15d
	movq	%rax, 8(%rsp)
	movq	%rax, %r13
	jmp	.L5
.L6:
	movq	8(%rsp), %rdx
	leaq	(%rbx,%r15), %rdi
	movq	%r14, %rsi
	subq	%r15, %rdx
	addq	$1, %r15
	call	strncmp@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L12
.L5:
	movl	%r13d, %ebp
	subl	%r15d, %ebp
	testl	%ebp, %ebp
	jg	.L6
	leal	(%r13,%r13), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L1
.L12:
	leal	(%r13,%r13), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subl	%ebp, %edx
	call	__printf_chk@PLT
	jmp	.L1
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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	"%127s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
.L4:
	movl	$1, %r12d
.L1:
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	addq	$312, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.L2:
	.cfi_restore_state
	leaq	32(%rsp), %rbx
	leaq	.LC1(%rip), %rbp
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	leaq	160(%rsp), %r14
	xorl	%eax, %eax
	movq	%rbp, %rdi
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	movslq	28(%rsp), %rax
	xorl	%r15d, %r15d
	movq	%rax, 8(%rsp)
	movq	%rax, %r13
	jmp	.L5
.L6:
	movq	8(%rsp), %rdx
	leaq	(%rbx,%r15), %rdi
	movq	%r14, %rsi
	subq	%r15, %rdx
	addq	$1, %r15
	call	strncmp@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L12
.L5:
	movl	%r13d, %ebp
	subl	%r15d, %ebp
	testl	%ebp, %ebp
	jg	.L6
	leal	(%r13,%r13), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L1
.L12:
	leal	(%r13,%r13), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subl	%ebp, %edx
	call	__printf_chk@PLT
	jmp	.L1
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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	"%127s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
.L4:
	movl	$1, %r12d
.L1:
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	addq	$312, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.L2:
	.cfi_restore_state
	leaq	32(%rsp), %rbx
	leaq	.LC1(%rip), %rbp
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	leaq	160(%rsp), %r14
	xorl	%eax, %eax
	movq	%rbp, %rdi
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	movslq	28(%rsp), %rax
	xorl	%r15d, %r15d
	movq	%rax, 8(%rsp)
	movq	%rax, %r13
	jmp	.L5
.L6:
	movq	8(%rsp), %rdx
	leaq	(%rbx,%r15), %rdi
	movq	%r14, %rsi
	subq	%r15, %rdx
	addq	$1, %r15
	call	strncmp@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L12
.L5:
	movl	%r13d, %ebp
	subl	%r15d, %ebp
	testl	%ebp, %ebp
	jg	.L6
	leal	(%r13,%r13), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L1
.L12:
	leal	(%r13,%r13), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subl	%ebp, %edx
	call	__printf_chk@PLT
	jmp	.L1
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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 <string.h>

int main(void) {
	int N;
	char s[128];
	char t[128];
	int i;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%127s", s) != 1) return 1;
	if (scanf("%127s", t) != 1) return 1;
	for (i = N; i > 0; i--) {
		if (strncmp(s + N - i, t, i) == 0) {
			printf("%d\n", N + N - i);
			return 0;
		}
	}
	printf("%d\n", N + N);
	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 <string.h>

int main(void) {
	int N;
	char s[128];
	char t[128];
	int i;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%127s", s) != 1) return 1;
	if (scanf("%127s", t) != 1) return 1;
	for (i = N; i > 0; i--) {
		if (strncmp(s + N - i, t, i) == 0) {
			printf("%d\n", N + N - i);
			return 0;
		}
	}
	printf("%d\n", N + N);
	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:

3
abc
cce
 1
a
{
 4
expr
expq
 3
cba
cec
 4
expr
rxep
 3
abc
cec
 1
`
z
 4
expr
epxq
 1
`
{
 4
expr
pexq

5
 2
 8
 6
 7
 5
 2
 8
 2
 8

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 <string.h>

int main(void) {
	int N;
	char s[128];
	char t[128];
	int i;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%127s", s) != 1) return 1;
	if (scanf("%127s", t) != 1) return 1;
	for (i = N; i > 0; i--) {
		if (strncmp(s + N - i, t, i) == 0) {
			printf("%d\n", N + N - i);
			return 0;
		}
	}
	printf("%d\n", N + N);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%127s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
.L4:
	movl	$1, %r12d
.L1:
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	addq	$312, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.L2:
	.cfi_restore_state
	leaq	32(%rsp), %rbx
	leaq	.LC1(%rip), %rbp
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	leaq	160(%rsp), %r14
	xorl	%eax, %eax
	movq	%rbp, %rdi
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	movslq	28(%rsp), %rax
	xorl	%r15d, %r15d
	movq	%rax, 8(%rsp)
	movq	%rax, %r13
	jmp	.L5
.L6:
	movq	8(%rsp), %rdx
	leaq	(%rbx,%r15), %rdi
	movq	%r14, %rsi
	subq	%r15, %rdx
	addq	$1, %r15
	call	strncmp@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L12
.L5:
	movl	%r13d, %ebp
	subl	%r15d, %ebp
	testl	%ebp, %ebp
	jg	.L6
	leal	(%r13,%r13), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L1
.L12:
	leal	(%r13,%r13), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subl	%ebp, %edx
	call	__printf_chk@PLT
	jmp	.L1
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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	"%127s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
.L4:
	movl	$1, %r12d
.L1:
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	addq	$312, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.L2:
	.cfi_restore_state
	leaq	32(%rsp), %rbx
	leaq	.LC1(%rip), %rbp
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	leaq	160(%rsp), %r14
	xorl	%eax, %eax
	movq	%rbp, %rdi
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	movslq	28(%rsp), %rax
	xorl	%r15d, %r15d
	movq	%rax, 8(%rsp)
	movq	%rax, %r13
	jmp	.L5
.L6:
	movq	8(%rsp), %rdx
	leaq	(%rbx,%r15), %rdi
	movq	%r14, %rsi
	subq	%r15, %rdx
	addq	$1, %r15
	call	strncmp@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L12
.L5:
	movl	%r13d, %ebp
	subl	%r15d, %ebp
	testl	%ebp, %ebp
	jg	.L6
	leal	(%r13,%r13), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L1
.L12:
	leal	(%r13,%r13), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subl	%ebp, %edx
	call	__printf_chk@PLT
	jmp	.L1
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
```