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

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
//#include<string.h>
//#include<time.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)

int main() {
	int n,m,a,b,ans,c;
	fscanf(stdin, "%d%d", &n, &m);
	ans = c = m;
	while (n--) {
		fscanf(stdin, "%d%d", &a, &b);
		if (c < 0) continue;
		c += a - b;
		if (c < 0) ans = 0;
		if (ans < c) ans = c;
	}
	P(d, ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rax
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-28(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L2
.L5:
	movq	stdin(%rip), %rax
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	cmpl	$0, -12(%rbp)
	jns	.L3
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	subl	%edx, %eax
	addl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jns	.L4
	movl	$0, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L2
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
.L2:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L5
	movq	stdout(%rip), %rax
	movl	-16(%rbp), %edx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	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\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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rsi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	12(%rsp), %rcx
	call	__isoc99_fscanf@PLT
	movl	8(%rsp), %eax
	movl	12(%rsp), %ebx
	leal	-1(%rax), %edx
	movl	%ebx, %r12d
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L5:
	movq	stdin(%rip), %rdi
	xorl	%eax, %eax
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	call	__isoc99_fscanf@PLT
	testl	%ebx, %ebx
	js	.L3
	addl	16(%rsp), %ebx
	subl	20(%rsp), %ebx
	cmovs	%r15d, %r12d
	movl	8(%rsp), %eax
	cmpl	%ebx, %r12d
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	cmovl	%ebx, %r12d
	testl	%eax, %eax
	jne	.L5
.L2:
	movq	stdout(%rip), %rdi
	xorl	%eax, %eax
	movl	%r12d, %ecx
	movl	$1, %esi
	leaq	.LC1(%rip), %rdx
	call	__fprintf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
.L16:
	movq	stdin(%rip), %rdi
	movq	%r13, %rdx
	movq	%r14, %rcx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	jne	.L16
	jmp	.L2
.L15:
	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\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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rsi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	12(%rsp), %rcx
	call	__isoc99_fscanf@PLT
	movl	8(%rsp), %eax
	movl	12(%rsp), %ebx
	leal	-1(%rax), %edx
	movl	%ebx, %r12d
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L5:
	movq	stdin(%rip), %rdi
	xorl	%eax, %eax
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	call	__isoc99_fscanf@PLT
	testl	%ebx, %ebx
	js	.L3
	addl	16(%rsp), %ebx
	subl	20(%rsp), %ebx
	cmovs	%r15d, %r12d
	movl	8(%rsp), %eax
	cmpl	%ebx, %r12d
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	cmovl	%ebx, %r12d
	testl	%eax, %eax
	jne	.L5
.L2:
	movq	stdout(%rip), %rdi
	xorl	%eax, %eax
	movl	%r12d, %ecx
	movl	$1, %esi
	leaq	.LC1(%rip), %rdx
	call	__fprintf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
.L16:
	movq	stdin(%rip), %rdi
	movq	%r13, %rdx
	movq	%r14, %rcx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	jne	.L16
	jmp	.L2
.L15:
	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:

#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
//#include<string.h>
//#include<time.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)

int main() {
	int n,m,a,b,ans,c;
	fscanf(stdin, "%d%d", &n, &m);
	ans = c = m;
	while (n--) {
		fscanf(stdin, "%d%d", &a, &b);
		if (c < 0) continue;
		c += a - b;
		if (c < 0) ans = 0;
		if (ans < c) ans = c;
	}
	P(d, ans);
	return 0;
}
3
2
2 3
2 3
4 1

3

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

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
//#include<string.h>
//#include<time.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)

int main() {
	int n,m,a,b,ans,c;
	fscanf(stdin, "%d%d", &n, &m);
	ans = c = m;
	while (n--) {
		fscanf(stdin, "%d%d", &a, &b);
		if (c < 0) continue;
		c += a - b;
		if (c < 0) ans = 0;
		if (ans < c) ans = c;
	}
	P(d, ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rax
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-28(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L2
.L5:
	movq	stdin(%rip), %rax
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	cmpl	$0, -12(%rbp)
	jns	.L3
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	subl	%edx, %eax
	addl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jns	.L4
	movl	$0, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L2
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
.L2:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L5
	movq	stdout(%rip), %rax
	movl	-16(%rbp), %edx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	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.
val
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rax
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-28(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L2
.L5:
	movq	stdin(%rip), %rax
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	cmpl	$0, -12(%rbp)
	jns	.L3
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	subl	%edx, %eax
	addl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jns	.L4
	movl	$0, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L2
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
.L2:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L5
	movq	stdout(%rip), %rax
	movl	-16(%rbp), %edx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	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:
