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

```c

main(){
    int w,h,n,i;
    scanf("%d %d %d",&w,&h,&n);
    int x,y;
    scanf("%d %d",&x,&y);
    int tempx,tempy,xx,yy,cnt=0;
    for(i=1;i<n;i++){
        scanf("%d %d",&tempx,&tempy);
        xx=tempx-x;
        yy=tempy-y;
        while(xx>0&&yy>0){
            xx--;
            yy--;
            cnt++;
        }
        while(xx<0&&yy<0){
            xx++;
            yy++;
            cnt++;
        }
        while(xx>0){
            xx--;
            cnt++;
        }
        while(xx<0){
            xx++;
            cnt++;
        }
        while(yy>0){
            yy--;
            cnt++;
        }
        while(yy<0){
            yy++;
            cnt++;
        }
        x=tempx;
        y=tempy;
       
    }
    printf("%d\n",cnt);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	scanf@PLT
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	movq	%rbx, %rdi
	leaq	24(%rsp), %rsi
	call	scanf@PLT
	cmpl	$1, 20(%rsp)
	jle	.L2
	movl	$1, %r14d
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	call	scanf@PLT
	movl	36(%rsp), %r8d
	movl	32(%rsp), %edi
	movl	%r8d, %ecx
	subl	28(%rsp), %ecx
	movl	%edi, %esi
	subl	24(%rsp), %esi
	testl	%ecx, %ecx
	jle	.L3
	testl	%esi, %esi
	jle	.L3
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	subl	$1, %eax
	movl	%esi, %edx
	subl	$1, %ecx
	subl	%eax, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jle	.L10
	testl	%ecx, %ecx
	jg	.L4
.L6:
	testl	%eax, %eax
	jle	.L10
	addl	%eax, %edx
.L11:
	testl	%ecx, %ecx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L39:
	leal	(%rdx,%rcx), %r13d
.L13:
	movl	%edi, 24(%rsp)
	addl	$1, %r14d
	movl	%r8d, 28(%rsp)
	cmpl	%r14d, 20(%rsp)
	jg	.L14
.L2:
	xorl	%eax, %eax
	movl	%r13d, %esi
	leaq	.LC2(%rip), %rdi
	call	printf@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	testl	%ecx, %esi
	jns	.L18
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addl	$1, %ecx
	movl	%eax, %edx
	subl	%esi, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jns	.L9
	testl	%ecx, %ecx
	js	.L7
.L9:
	testl	%eax, %eax
	je	.L12
	subl	%eax, %edx
.L40:
	testl	%ecx, %ecx
	jg	.L39
.L12:
	movl	%edx, %r13d
	subl	%ecx, %r13d
	testl	%ecx, %ecx
	cmove	%edx, %r13d
	jmp	.L13
.L10:
	je	.L11
	subl	%eax, %edx
	jmp	.L40
.L18:
	movl	%r13d, %edx
	movl	%esi, %eax
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	scanf@PLT
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	movq	%rbx, %rdi
	leaq	24(%rsp), %rsi
	call	scanf@PLT
	cmpl	$1, 20(%rsp)
	jle	.L2
	movl	$1, %r14d
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	call	scanf@PLT
	movl	36(%rsp), %r8d
	movl	32(%rsp), %edi
	movl	%r8d, %ecx
	subl	28(%rsp), %ecx
	movl	%edi, %esi
	subl	24(%rsp), %esi
	testl	%ecx, %ecx
	jle	.L3
	testl	%esi, %esi
	jle	.L3
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	subl	$1, %eax
	movl	%esi, %edx
	subl	$1, %ecx
	subl	%eax, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jle	.L10
	testl	%ecx, %ecx
	jg	.L4
.L6:
	testl	%eax, %eax
	jle	.L10
	addl	%eax, %edx
.L11:
	testl	%ecx, %ecx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L39:
	leal	(%rdx,%rcx), %r13d
.L13:
	movl	%edi, 24(%rsp)
	addl	$1, %r14d
	movl	%r8d, 28(%rsp)
	cmpl	%r14d, 20(%rsp)
	jg	.L14
.L2:
	xorl	%eax, %eax
	movl	%r13d, %esi
	leaq	.LC2(%rip), %rdi
	call	printf@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	testl	%ecx, %esi
	jns	.L18
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addl	$1, %ecx
	movl	%eax, %edx
	subl	%esi, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jns	.L9
	testl	%ecx, %ecx
	js	.L7
.L9:
	testl	%eax, %eax
	je	.L12
	subl	%eax, %edx
.L40:
	testl	%ecx, %ecx
	jg	.L39
.L12:
	movl	%edx, %r13d
	subl	%ecx, %r13d
	testl	%ecx, %ecx
	cmove	%edx, %r13d
	jmp	.L13
.L10:
	je	.L11
	subl	%eax, %edx
	jmp	.L40
.L18:
	movl	%r13d, %edx
	movl	%esi, %eax
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	scanf@PLT
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	movq	%rbx, %rdi
	leaq	24(%rsp), %rsi
	call	scanf@PLT
	cmpl	$1, 20(%rsp)
	jle	.L2
	movl	$1, %r14d
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	call	scanf@PLT
	movl	36(%rsp), %r8d
	movl	32(%rsp), %edi
	movl	%r8d, %ecx
	subl	28(%rsp), %ecx
	movl	%edi, %esi
	subl	24(%rsp), %esi
	testl	%ecx, %ecx
	jle	.L3
	testl	%esi, %esi
	jle	.L3
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	subl	$1, %eax
	movl	%esi, %edx
	subl	$1, %ecx
	subl	%eax, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jle	.L10
	testl	%ecx, %ecx
	jg	.L4
.L6:
	testl	%eax, %eax
	jle	.L10
	addl	%eax, %edx
.L11:
	testl	%ecx, %ecx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L39:
	leal	(%rdx,%rcx), %r13d
.L13:
	movl	%edi, 24(%rsp)
	addl	$1, %r14d
	movl	%r8d, 28(%rsp)
	cmpl	%r14d, 20(%rsp)
	jg	.L14
.L2:
	xorl	%eax, %eax
	movl	%r13d, %esi
	leaq	.LC2(%rip), %rdi
	call	printf@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	testl	%ecx, %esi
	jns	.L18
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addl	$1, %ecx
	movl	%eax, %edx
	subl	%esi, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jns	.L9
	testl	%ecx, %ecx
	js	.L7
.L9:
	testl	%eax, %eax
	je	.L12
	subl	%eax, %edx
.L40:
	testl	%ecx, %ecx
	jg	.L39
.L12:
	movl	%edx, %r13d
	subl	%ecx, %r13d
	testl	%ecx, %ecx
	cmove	%edx, %r13d
	jmp	.L13
.L10:
	je	.L11
	subl	%eax, %edx
	jmp	.L40
.L18:
	movl	%r13d, %edx
	movl	%esi, %eax
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.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:
```
```c

main(){
    int w,h,n,i;
    scanf("%d %d %d",&w,&h,&n);
    int x,y;
    scanf("%d %d",&x,&y);
    int tempx,tempy,xx,yy,cnt=0;
    for(i=1;i<n;i++){
        scanf("%d %d",&tempx,&tempy);
        xx=tempx-x;
        yy=tempy-y;
        while(xx>0&&yy>0){
            xx--;
            yy--;
            cnt++;
        }
        while(xx<0&&yy<0){
            xx++;
            yy++;
            cnt++;
        }
        while(xx>0){
            xx--;
            cnt++;
        }
        while(xx<0){
            xx++;
            cnt++;
        }
        while(yy>0){
            yy--;
            cnt++;
        }
        while(yy<0){
            yy++;
            cnt++;
        }
        x=tempx;
        y=tempy;
       
    }
    printf("%d\n",cnt);
    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c

main(){
    int w,h,n,i;
    scanf("%d %d %d",&w,&h,&n);
    int x,y;
    scanf("%d %d",&x,&y);
    int tempx,tempy,xx,yy,cnt=0;
    for(i=1;i<n;i++){
        scanf("%d %d",&tempx,&tempy);
        xx=tempx-x;
        yy=tempy-y;
        while(xx>0&&yy>0){
            xx--;
            yy--;
            cnt++;
        }
        while(xx<0&&yy<0){
            xx++;
            yy++;
            cnt++;
        }
        while(xx>0){
            xx--;
            cnt++;
        }
        while(xx<0){
            xx++;
            cnt++;
        }
        while(yy>0){
            yy--;
            cnt++;
        }
        while(yy<0){
            yy++;
            cnt++;
        }
        x=tempx;
        y=tempy;
       
    }
    printf("%d\n",cnt);
    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:

4 3 3
1 1
3 3
4 1

5

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

```c

main(){
    int w,h,n,i;
    scanf("%d %d %d",&w,&h,&n);
    int x,y;
    scanf("%d %d",&x,&y);
    int tempx,tempy,xx,yy,cnt=0;
    for(i=1;i<n;i++){
        scanf("%d %d",&tempx,&tempy);
        xx=tempx-x;
        yy=tempy-y;
        while(xx>0&&yy>0){
            xx--;
            yy--;
            cnt++;
        }
        while(xx<0&&yy<0){
            xx++;
            yy++;
            cnt++;
        }
        while(xx>0){
            xx--;
            cnt++;
        }
        while(xx<0){
            xx++;
            cnt++;
        }
        while(yy>0){
            yy--;
            cnt++;
        }
        while(yy<0){
            yy++;
            cnt++;
        }
        x=tempx;
        y=tempy;
       
    }
    printf("%d\n",cnt);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	scanf@PLT
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	movq	%rbx, %rdi
	leaq	24(%rsp), %rsi
	call	scanf@PLT
	cmpl	$1, 20(%rsp)
	jle	.L2
	movl	$1, %r14d
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	call	scanf@PLT
	movl	36(%rsp), %r8d
	movl	32(%rsp), %edi
	movl	%r8d, %ecx
	subl	28(%rsp), %ecx
	movl	%edi, %esi
	subl	24(%rsp), %esi
	testl	%ecx, %ecx
	jle	.L3
	testl	%esi, %esi
	jle	.L3
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	subl	$1, %eax
	movl	%esi, %edx
	subl	$1, %ecx
	subl	%eax, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jle	.L10
	testl	%ecx, %ecx
	jg	.L4
.L6:
	testl	%eax, %eax
	jle	.L10
	addl	%eax, %edx
.L11:
	testl	%ecx, %ecx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L39:
	leal	(%rdx,%rcx), %r13d
.L13:
	movl	%edi, 24(%rsp)
	addl	$1, %r14d
	movl	%r8d, 28(%rsp)
	cmpl	%r14d, 20(%rsp)
	jg	.L14
.L2:
	xorl	%eax, %eax
	movl	%r13d, %esi
	leaq	.LC2(%rip), %rdi
	call	printf@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	testl	%ecx, %esi
	jns	.L18
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addl	$1, %ecx
	movl	%eax, %edx
	subl	%esi, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jns	.L9
	testl	%ecx, %ecx
	js	.L7
.L9:
	testl	%eax, %eax
	je	.L12
	subl	%eax, %edx
.L40:
	testl	%ecx, %ecx
	jg	.L39
.L12:
	movl	%edx, %r13d
	subl	%ecx, %r13d
	testl	%ecx, %ecx
	cmove	%edx, %r13d
	jmp	.L13
.L10:
	je	.L11
	subl	%eax, %edx
	jmp	.L40
.L18:
	movl	%r13d, %edx
	movl	%esi, %eax
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	scanf@PLT
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	movq	%rbx, %rdi
	leaq	24(%rsp), %rsi
	call	scanf@PLT
	cmpl	$1, 20(%rsp)
	jle	.L2
	movl	$1, %r14d
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	call	scanf@PLT
	movl	36(%rsp), %r8d
	movl	32(%rsp), %edi
	movl	%r8d, %ecx
	subl	28(%rsp), %ecx
	movl	%edi, %esi
	subl	24(%rsp), %esi
	testl	%ecx, %ecx
	jle	.L3
	testl	%esi, %esi
	jle	.L3
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	subl	$1, %eax
	movl	%esi, %edx
	subl	$1, %ecx
	subl	%eax, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jle	.L10
	testl	%ecx, %ecx
	jg	.L4
.L6:
	testl	%eax, %eax
	jle	.L10
	addl	%eax, %edx
.L11:
	testl	%ecx, %ecx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L39:
	leal	(%rdx,%rcx), %r13d
.L13:
	movl	%edi, 24(%rsp)
	addl	$1, %r14d
	movl	%r8d, 28(%rsp)
	cmpl	%r14d, 20(%rsp)
	jg	.L14
.L2:
	xorl	%eax, %eax
	movl	%r13d, %esi
	leaq	.LC2(%rip), %rdi
	call	printf@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	testl	%ecx, %esi
	jns	.L18
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addl	$1, %ecx
	movl	%eax, %edx
	subl	%esi, %edx
	addl	%r13d, %edx
	testl	%eax, %eax
	jns	.L9
	testl	%ecx, %ecx
	js	.L7
.L9:
	testl	%eax, %eax
	je	.L12
	subl	%eax, %edx
.L40:
	testl	%ecx, %ecx
	jg	.L39
.L12:
	movl	%edx, %r13d
	subl	%ecx, %r13d
	testl	%ecx, %ecx
	cmove	%edx, %r13d
	jmp	.L13
.L10:
	je	.L11
	subl	%eax, %edx
	jmp	.L40
.L18:
	movl	%r13d, %edx
	movl	%esi, %eax
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.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:
```