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

```c
#include<stdio.h>
int main(){
	int i,n,x,y,h,w,l,L,W;
	long long sum=0;
	for(;scanf("%d",&n)&&n;sum=0){
		for(i=0;i<n;i++){
			scanf("%d %d %d %d",&x,&y,&h,&w);
			l=x+y+h;
			if(l<=60)L=0;else if(l<=80)L=1;else if(l<=100)L=2;else if(l<=120)L=3;else if(l<=140)L=4;else if(l<=160)L=5;else L=6;
			if(w<=2)W=0;else if(w<=5)W=1;else if(w<=10)W=2;else if(w<=15)W=3;else if(w<=20)W=4;else if(w<=25)W=5;else W=6;
			if(L<W)L=W;
			if(L==0)sum+=(long long)600;else if(L==1)sum+=(long long)800;else if(L==2)sum+=(long long)1000;else if(L==3)sum+=(long long)1200;else if(L==4)sum+=(long long)1400;else if(L==5)sum+=(long long)1600;
		}
		printf("%lld\n",sum);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%d"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -16(%rbp)
	jmp	.L2
.L27:
	movl	$0, -32(%rbp)
	jmp	.L3
.L25:
	leaq	-36(%rbp), %rsi
	leaq	-40(%rbp), %rcx
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	cmpl	$60, -20(%rbp)
	jg	.L4
	movl	$0, -28(%rbp)
	jmp	.L5
.L4:
	cmpl	$80, -20(%rbp)
	jg	.L6
	movl	$1, -28(%rbp)
	jmp	.L5
.L6:
	cmpl	$100, -20(%rbp)
	jg	.L7
	movl	$2, -28(%rbp)
	jmp	.L5
.L7:
	cmpl	$120, -20(%rbp)
	jg	.L8
	movl	$3, -28(%rbp)
	jmp	.L5
.L8:
	cmpl	$140, -20(%rbp)
	jg	.L9
	movl	$4, -28(%rbp)
	jmp	.L5
.L9:
	cmpl	$160, -20(%rbp)
	jg	.L10
	movl	$5, -28(%rbp)
	jmp	.L5
.L10:
	movl	$6, -28(%rbp)
.L5:
	movl	-36(%rbp), %eax
	cmpl	$2, %eax
	jg	.L11
	movl	$0, -24(%rbp)
	jmp	.L12
.L11:
	movl	-36(%rbp), %eax
	cmpl	$5, %eax
	jg	.L13
	movl	$1, -24(%rbp)
	jmp	.L12
.L13:
	movl	-36(%rbp), %eax
	cmpl	$10, %eax
	jg	.L14
	movl	$2, -24(%rbp)
	jmp	.L12
.L14:
	movl	-36(%rbp), %eax
	cmpl	$15, %eax
	jg	.L15
	movl	$3, -24(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	cmpl	$20, %eax
	jg	.L16
	movl	$4, -24(%rbp)
	jmp	.L12
.L16:
	movl	-36(%rbp), %eax
	cmpl	$25, %eax
	jg	.L17
	movl	$5, -24(%rbp)
	jmp	.L12
.L17:
	movl	$6, -24(%rbp)
.L12:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L18
	movl	-24(%rbp), %eax
	movl	%eax, -28(%rbp)
.L18:
	cmpl	$0, -28(%rbp)
	jne	.L19
	addq	$600, -16(%rbp)
	jmp	.L20
.L19:
	cmpl	$1, -28(%rbp)
	jne	.L21
	addq	$800, -16(%rbp)
	jmp	.L20
.L21:
	cmpl	$2, -28(%rbp)
	jne	.L22
	addq	$1000, -16(%rbp)
	jmp	.L20
.L22:
	cmpl	$3, -28(%rbp)
	jne	.L23
	addq	$1200, -16(%rbp)
	jmp	.L20
.L23:
	cmpl	$4, -28(%rbp)
	jne	.L24
	addq	$1400, -16(%rbp)
	jmp	.L20
.L24:
	cmpl	$5, -28(%rbp)
	jne	.L20
	addq	$1600, -16(%rbp)
.L20:
	addl	$1, -32(%rbp)
.L3:
	movl	-52(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L25
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	$0, -16(%rbp)
.L2:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L26
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L27
.L26:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	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 %d %d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%d"
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L19
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L19
	movl	$0, %r12d
	jle	.L20
	xorl	%r14d, %r14d
	leaq	36(%rsp), %r15
	leaq	32(%rsp), %r13
	leaq	28(%rsp), %rbp
	leaq	24(%rsp), %rbx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L52:
	cmpl	$80, %eax
	jle	.L4
	cmpl	$100, %eax
	jle	.L5
	cmpl	$120, %eax
	jle	.L6
	cmpl	$140, %eax
	jle	.L7
	cmpl	$160, %eax
	jg	.L50
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jle	.L12
	cmpl	$5, %eax
	jg	.L51
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1600, %r12
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, %r14d
	cmpl	%r14d, 20(%rsp)
	jle	.L20
.L18:
	movq	%r15, %r8
	movq	%r13, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addl	24(%rsp), %eax
	addl	32(%rsp), %eax
	cmpl	$60, %eax
	jg	.L52
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jle	.L21
.L22:
	cmpl	$5, %eax
	jle	.L17
.L48:
	movl	$3, %ecx
	movl	$2, %edx
	movl	$5, %edi
	movl	$4, %esi
.L28:
	cmpl	$10, %eax
	jle	.L10
	cmpl	$15, %eax
	jle	.L30
	cmpl	$20, %eax
	jle	.L31
	movl	%edi, %edx
	cmpl	$25, %eax
	jg	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	$5, %edx
	ja	.L11
	leaq	.L13(%rip), %rcx
	movslq	(%rcx,%rdx,4), %rax
	addq	%rcx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L13:
	.long	.L11-.L13
	.long	.L17-.L13
	.long	.L16-.L13
	.long	.L15-.L13
	.long	.L14-.L13
	.long	.L12-.L13
	.section	.text.startup
	.p2align 4,,10
	.p2align 3
.L7:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jg	.L53
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$1400, %r12
	addl	$1, %r14d
	cmpl	%r14d, 20(%rsp)
	jg	.L18
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r12, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jg	.L54
.L15:
	addq	$1200, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L21:
	addq	$600, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L4:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jg	.L22
.L17:
	addq	$800, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jg	.L55
.L16:
	addq	$1000, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%ecx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L54:
	cmpl	$5, %eax
	jle	.L15
	movl	$3, %ecx
	movl	$3, %edx
	movl	$5, %edi
	movl	$4, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L55:
	cmpl	$5, %eax
	jle	.L16
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L31:
	movl	%esi, %edx
	jmp	.L10
.L53:
	cmpl	$5, %eax
	jle	.L14
	movl	$4, %ecx
	movl	$4, %edx
	movl	$5, %edi
	movl	$4, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L50:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jle	.L11
	cmpl	$5, %eax
	jle	.L11
	movl	$6, %ecx
	movl	$6, %edx
	movl	$6, %edi
	movl	$6, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L19:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$56, %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
.L51:
	.cfi_restore_state
	movl	$5, %ecx
	movl	$5, %edx
	movl	$5, %edi
	movl	$5, %esi
	jmp	.L28
.L56:
	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 %d %d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%d"
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L19
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L19
	movl	$0, %r12d
	jle	.L20
	xorl	%r14d, %r14d
	leaq	36(%rsp), %r15
	leaq	32(%rsp), %r13
	leaq	28(%rsp), %rbp
	leaq	24(%rsp), %rbx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L52:
	cmpl	$80, %eax
	jle	.L4
	cmpl	$100, %eax
	jle	.L5
	cmpl	$120, %eax
	jle	.L6
	cmpl	$140, %eax
	jle	.L7
	cmpl	$160, %eax
	jg	.L50
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jle	.L12
	cmpl	$5, %eax
	jg	.L51
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1600, %r12
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, %r14d
	cmpl	%r14d, 20(%rsp)
	jle	.L20
.L18:
	movq	%r15, %r8
	movq	%r13, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addl	24(%rsp), %eax
	addl	32(%rsp), %eax
	cmpl	$60, %eax
	jg	.L52
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jle	.L21
.L22:
	cmpl	$5, %eax
	jle	.L17
.L48:
	movl	$3, %ecx
	movl	$2, %edx
	movl	$5, %edi
	movl	$4, %esi
.L28:
	cmpl	$10, %eax
	jle	.L10
	cmpl	$15, %eax
	jle	.L30
	cmpl	$20, %eax
	jle	.L31
	movl	%edi, %edx
	cmpl	$25, %eax
	jg	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	$5, %edx
	ja	.L11
	leaq	.L13(%rip), %rcx
	movslq	(%rcx,%rdx,4), %rax
	addq	%rcx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L13:
	.long	.L11-.L13
	.long	.L17-.L13
	.long	.L16-.L13
	.long	.L15-.L13
	.long	.L14-.L13
	.long	.L12-.L13
	.section	.text.startup
	.p2align 4,,10
	.p2align 3
.L7:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jg	.L53
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$1400, %r12
	addl	$1, %r14d
	cmpl	%r14d, 20(%rsp)
	jg	.L18
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r12, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jg	.L54
.L15:
	addq	$1200, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L21:
	addq	$600, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L4:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jg	.L22
.L17:
	addq	$800, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jg	.L55
.L16:
	addq	$1000, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%ecx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L54:
	cmpl	$5, %eax
	jle	.L15
	movl	$3, %ecx
	movl	$3, %edx
	movl	$5, %edi
	movl	$4, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L55:
	cmpl	$5, %eax
	jle	.L16
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L31:
	movl	%esi, %edx
	jmp	.L10
.L53:
	cmpl	$5, %eax
	jle	.L14
	movl	$4, %ecx
	movl	$4, %edx
	movl	$5, %edi
	movl	$4, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L50:
	movl	36(%rsp), %eax
	cmpl	$2, %eax
	jle	.L11
	cmpl	$5, %eax
	jle	.L11
	movl	$6, %ecx
	movl	$6, %edx
	movl	$6, %edi
	movl	$6, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L19:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$56, %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
.L51:
	.cfi_restore_state
	movl	$5, %ecx
	movl	$5, %edx
	movl	$5, %edi
	movl	$5, %esi
	jmp	.L28
.L56:
	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:

#include<stdio.h>
int main(){
	int i,n,x,y,h,w,l,L,W;
	long long sum=0;
	for(;scanf("%d",&n)&&n;sum=0){
		for(i=0;i<n;i++){
			scanf("%d %d %d %d",&x,&y,&h,&w);
			l=x+y+h;
			if(l<=60)L=0;else if(l<=80)L=1;else if(l<=100)L=2;else if(l<=120)L=3;else if(l<=140)L=4;else if(l<=160)L=5;else L=6;
			if(w<=2)W=0;else if(w<=5)W=1;else if(w<=10)W=2;else if(w<=15)W=3;else if(w<=20)W=4;else if(w<=25)W=5;else W=6;
			if(L<W)L=W;
			if(L==0)sum+=(long long)600;else if(L==1)sum+=(long long)800;else if(L==2)sum+=(long long)1000;else if(L==3)sum+=(long long)1200;else if(L==4)sum+=(long long)1400;else if(L==5)sum+=(long long)1600;
		}
		printf("%lld\n",sum);
	}
	return 0;
}
2
50 25 5 5
80 60 10 30
3
10 7 25 24
5 8 12 5
30 30 30 18
0
 2
50 25 5 5
80 60 10 30
3
10 7 25 24
5 8 12 5
30 30 30 3
0
 2
50 25 5 5
135 60 10 30
3
10 7 25 24
5 8 13 5
30 30 30 14
0
 2
50 36 5 5
135 60 8 30
3
10 8 25 24
5 1 13 5
30 30 30 14
0
 2
74 2 5 5
80 82 1 0
0
7 2 0 24
2 -1 12 3
30 30 -1 11
0
 2
74 2 3 5
115 94 1 0
0
7 2 0 24
2 -1 12 3
54 30 -2 11
0
 2
50 34 5 5
80 60 10 30
3
10 15 25 24
5 8 12 5
30 30 30 18
0
 2
50 1 5 2
80 60 10 30
3
10 15 25 24
5 8 12 5
30 30 30 18
0
 2
86 25 5 5
135 60 10 30
3
10 8 25 24
5 8 13 5
30 30 30 14
0
 2
51 1 5 5
80 95 3 30
3
10 15 25 47
2 12 12 3
30 30 30 11
0

800
3800
 800
3400
 800
3600
 1000
3600
 1000
 800
 1000
3800
 600
3800
 1200
3600
 800
2000

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

```c
#include<stdio.h>
int main(){
	int i,n,x,y,h,w,l,L,W;
	long long sum=0;
	for(;scanf("%d",&n)&&n;sum=0){
		for(i=0;i<n;i++){
			scanf("%d %d %d %d",&x,&y,&h,&w);
			l=x+y+h;
			if(l<=60)L=0;else if(l<=80)L=1;else if(l<=100)L=2;else if(l<=120)L=3;else if(l<=140)L=4;else if(l<=160)L=5;else L=6;
			if(w<=2)W=0;else if(w<=5)W=1;else if(w<=10)W=2;else if(w<=15)W=3;else if(w<=20)W=4;else if(w<=25)W=5;else W=6;
			if(L<W)L=W;
			if(L==0)sum+=(long long)600;else if(L==1)sum+=(long long)800;else if(L==2)sum+=(long long)1000;else if(L==3)sum+=(long long)1200;else if(L==4)sum+=(long long)1400;else if(L==5)sum+=(long long)1600;
		}
		printf("%lld\n",sum);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%d"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -16(%rbp)
	jmp	.L2
.L27:
	movl	$0, -32(%rbp)
	jmp	.L3
.L25:
	leaq	-36(%rbp), %rsi
	leaq	-40(%rbp), %rcx
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	cmpl	$60, -20(%rbp)
	jg	.L4
	movl	$0, -28(%rbp)
	jmp	.L5
.L4:
	cmpl	$80, -20(%rbp)
	jg	.L6
	movl	$1, -28(%rbp)
	jmp	.L5
.L6:
	cmpl	$100, -20(%rbp)
	jg	.L7
	movl	$2, -28(%rbp)
	jmp	.L5
.L7:
	cmpl	$120, -20(%rbp)
	jg	.L8
	movl	$3, -28(%rbp)
	jmp	.L5
.L8:
	cmpl	$140, -20(%rbp)
	jg	.L9
	movl	$4, -28(%rbp)
	jmp	.L5
.L9:
	cmpl	$160, -20(%rbp)
	jg	.L10
	movl	$5, -28(%rbp)
	jmp	.L5
.L10:
	movl	$6, -28(%rbp)
.L5:
	movl	-36(%rbp), %eax
	cmpl	$2, %eax
	jg	.L11
	movl	$0, -24(%rbp)
	jmp	.L12
.L11:
	movl	-36(%rbp), %eax
	cmpl	$5, %eax
	jg	.L13
	movl	$1, -24(%rbp)
	jmp	.L12
.L13:
	movl	-36(%rbp), %eax
	cmpl	$10, %eax
	jg	.L14
	movl	$2, -24(%rbp)
	jmp	.L12
.L14:
	movl	-36(%rbp), %eax
	cmpl	$15, %eax
	jg	.L15
	movl	$3, -24(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	cmpl	$20, %eax
	jg	.L16
	movl	$4, -24(%rbp)
	jmp	.L12
.L16:
	movl	-36(%rbp), %eax
	cmpl	$25, %eax
	jg	.L17
	movl	$5, -24(%rbp)
	jmp	.L12
.L17:
	movl	$6, -24(%rbp)
.L12:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L18
	movl	-24(%rbp), %eax
	movl	%eax, -28(%rbp)
.L18:
	cmpl	$0, -28(%rbp)
	jne	.L19
	addq	$600, -16(%rbp)
	jmp	.L20
.L19:
	cmpl	$1, -28(%rbp)
	jne	.L21
	addq	$800, -16(%rbp)
	jmp	.L20
.L21:
	cmpl	$2, -28(%rbp)
	jne	.L22
	addq	$1000, -16(%rbp)
	jmp	.L20
.L22:
	cmpl	$3, -28(%rbp)
	jne	.L23
	addq	$1200, -16(%rbp)
	jmp	.L20
.L23:
	cmpl	$4, -28(%rbp)
	jne	.L24
	addq	$1400, -16(%rbp)
	jmp	.L20
.L24:
	cmpl	$5, -28(%rbp)
	jne	.L20
	addq	$1600, -16(%rbp)
.L20:
	addl	$1, -32(%rbp)
.L3:
	movl	-52(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L25
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	$0, -16(%rbp)
.L2:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L26
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L27
.L26:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	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 %d %d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%d"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -16(%rbp)
	jmp	.L2
.L27:
	movl	$0, -32(%rbp)
	jmp	.L3
.L25:
	leaq	-36(%rbp), %rsi
	leaq	-40(%rbp), %rcx
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	cmpl	$60, -20(%rbp)
	jg	.L4
	movl	$0, -28(%rbp)
	jmp	.L5
.L4:
	cmpl	$80, -20(%rbp)
	jg	.L6
	movl	$1, -28(%rbp)
	jmp	.L5
.L6:
	cmpl	$100, -20(%rbp)
	jg	.L7
	movl	$2, -28(%rbp)
	jmp	.L5
.L7:
	cmpl	$120, -20(%rbp)
	jg	.L8
	movl	$3, -28(%rbp)
	jmp	.L5
.L8:
	cmpl	$140, -20(%rbp)
	jg	.L9
	movl	$4, -28(%rbp)
	jmp	.L5
.L9:
	cmpl	$160, -20(%rbp)
	jg	.L10
	movl	$5, -28(%rbp)
	jmp	.L5
.L10:
	movl	$6, -28(%rbp)
.L5:
	movl	-36(%rbp), %eax
	cmpl	$2, %eax
	jg	.L11
	movl	$0, -24(%rbp)
	jmp	.L12
.L11:
	movl	-36(%rbp), %eax
	cmpl	$5, %eax
	jg	.L13
	movl	$1, -24(%rbp)
	jmp	.L12
.L13:
	movl	-36(%rbp), %eax
	cmpl	$10, %eax
	jg	.L14
	movl	$2, -24(%rbp)
	jmp	.L12
.L14:
	movl	-36(%rbp), %eax
	cmpl	$15, %eax
	jg	.L15
	movl	$3, -24(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	cmpl	$20, %eax
	jg	.L16
	movl	$4, -24(%rbp)
	jmp	.L12
.L16:
	movl	-36(%rbp), %eax
	cmpl	$25, %eax
	jg	.L17
	movl	$5, -24(%rbp)
	jmp	.L12
.L17:
	movl	$6, -24(%rbp)
.L12:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L18
	movl	-24(%rbp), %eax
	movl	%eax, -28(%rbp)
.L18:
	cmpl	$0, -28(%rbp)
	jne	.L19
	addq	$600, -16(%rbp)
	jmp	.L20
.L19:
	cmpl	$1, -28(%rbp)
	jne	.L21
	addq	$800, -16(%rbp)
	jmp	.L20
.L21:
	cmpl	$2, -28(%rbp)
	jne	.L22
	addq	$1000, -16(%rbp)
	jmp	.L20
.L22:
	cmpl	$3, -28(%rbp)
	jne	.L23
	addq	$1200, -16(%rbp)
	jmp	.L20
.L23:
	cmpl	$4, -28(%rbp)
	jne	.L24
	addq	$1400, -16(%rbp)
	jmp	.L20
.L24:
	cmpl	$5, -28(%rbp)
	jne	.L20
	addq	$1600, -16(%rbp)
.L20:
	addl	$1, -32(%rbp)
.L3:
	movl	-52(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L25
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	$0, -16(%rbp)
.L2:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L26
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L27
.L26:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	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:
