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>

int main(){
  
  int n,i,j,max=-1,min=1000,sum;
  int subject[5];
  while(1){
    max=-1;
    min=1000;
    scanf("%d",&n);
    if(n==0){
      break;
    } 
    for(i=0;i<n;i++){
      sum=0;
      for(j=0;j<5;j++){
	
	scanf("%d",&subject[j]);
	sum+=subject[j];	
      }	
      if(sum>max){
	max = sum;
      }
      if(sum<min){
	min= sum;
      }   
    }
    printf("%d %d\n",max,min);  
  }
  return 0;  
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	movq	24(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$1000, %r13d
	movl	$-1, %r12d
	jle	.L3
	movl	$0, 12(%rsp)
	leaq	68(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	16(%rsp), %r14
	xorl	%r15d, %r15d
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r14
	call	__isoc99_scanf@PLT
	addl	-4(%r14), %r15d
	cmpq	%rbp, %r14
	jne	.L4
	cmpl	%r15d, %r12d
	cmovl	%r15d, %r12d
	cmpl	%r15d, %r13d
	cmovg	%r15d, %r13d
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	cmpl	%eax, 44(%rsp)
	jg	.L5
.L3:
	movl	%r13d, %ecx
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L6
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$88, %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
.L13:
	.cfi_restore_state
	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:
```

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	"%d %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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	movq	24(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$1000, %r13d
	movl	$-1, %r12d
	jle	.L3
	movl	$0, 12(%rsp)
	leaq	68(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	16(%rsp), %r14
	xorl	%r15d, %r15d
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r14
	call	__isoc99_scanf@PLT
	addl	-4(%r14), %r15d
	cmpq	%rbp, %r14
	jne	.L4
	cmpl	%r15d, %r12d
	cmovl	%r15d, %r12d
	cmpl	%r15d, %r13d
	cmovg	%r15d, %r13d
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	cmpl	%eax, 44(%rsp)
	jg	.L5
.L3:
	movl	%r13d, %ecx
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L6
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$88, %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
.L13:
	.cfi_restore_state
	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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	movq	24(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$1000, %r13d
	movl	$-1, %r12d
	jle	.L3
	movl	$0, 12(%rsp)
	leaq	68(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	16(%rsp), %r14
	xorl	%r15d, %r15d
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r14
	call	__isoc99_scanf@PLT
	addl	-4(%r14), %r15d
	cmpq	%rbp, %r14
	jne	.L4
	cmpl	%r15d, %r12d
	cmovl	%r15d, %r12d
	cmpl	%r15d, %r13d
	cmovg	%r15d, %r13d
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	cmpl	%eax, 44(%rsp)
	jg	.L5
.L3:
	movl	%r13d, %ecx
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L6
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$88, %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
.L13:
	.cfi_restore_state
	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:
```
```c
#include <stdio.h>

int main(){
  
  int n,i,j,max=-1,min=1000,sum;
  int subject[5];
  while(1){
    max=-1;
    min=1000;
    scanf("%d",&n);
    if(n==0){
      break;
    } 
    for(i=0;i<n;i++){
      sum=0;
      for(j=0;j<5;j++){
	
	scanf("%d",&subject[j]);
	sum+=subject[j];	
      }	
      if(sum>max){
	max = sum;
      }
      if(sum<min){
	min= sum;
      }   
    }
    printf("%d %d\n",max,min);  
  }
  return 0;  
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(){
  
  int n,i,j,max=-1,min=1000,sum;
  int subject[5];
  while(1){
    max=-1;
    min=1000;
    scanf("%d",&n);
    if(n==0){
      break;
    } 
    for(i=0;i<n;i++){
      sum=0;
      for(j=0;j<5;j++){
	
	scanf("%d",&subject[j]);
	sum+=subject[j];	
      }	
      if(sum>max){
	max = sum;
      }
      if(sum<min){
	min= sum;
      }   
    }
    printf("%d %d\n",max,min);  
  }
  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
49 50 87 78 41
27 61 100 45 84
28 36 40 95 66
2
100 100 100 100 100
0 0 0 0 0
1
89 90 85 93 82
0

317 265
500 0
439 439

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>

int main(){
  
  int n,i,j,max=-1,min=1000,sum;
  int subject[5];
  while(1){
    max=-1;
    min=1000;
    scanf("%d",&n);
    if(n==0){
      break;
    } 
    for(i=0;i<n;i++){
      sum=0;
      for(j=0;j<5;j++){
	
	scanf("%d",&subject[j]);
	sum+=subject[j];	
      }	
      if(sum>max){
	max = sum;
      }
      if(sum<min){
	min= sum;
      }   
    }
    printf("%d %d\n",max,min);  
  }
  return 0;  
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	movq	24(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$1000, %r13d
	movl	$-1, %r12d
	jle	.L3
	movl	$0, 12(%rsp)
	leaq	68(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	16(%rsp), %r14
	xorl	%r15d, %r15d
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r14
	call	__isoc99_scanf@PLT
	addl	-4(%r14), %r15d
	cmpq	%rbp, %r14
	jne	.L4
	cmpl	%r15d, %r12d
	cmovl	%r15d, %r12d
	cmpl	%r15d, %r13d
	cmovg	%r15d, %r13d
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	cmpl	%eax, 44(%rsp)
	jg	.L5
.L3:
	movl	%r13d, %ecx
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L6
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$88, %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
.L13:
	.cfi_restore_state
	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:
```

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	"%d %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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	movq	24(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	$1000, %r13d
	movl	$-1, %r12d
	jle	.L3
	movl	$0, 12(%rsp)
	leaq	68(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	16(%rsp), %r14
	xorl	%r15d, %r15d
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r14
	call	__isoc99_scanf@PLT
	addl	-4(%r14), %r15d
	cmpq	%rbp, %r14
	jne	.L4
	cmpl	%r15d, %r12d
	cmovl	%r15d, %r12d
	cmpl	%r15d, %r13d
	cmovg	%r15d, %r13d
	addl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	cmpl	%eax, 44(%rsp)
	jg	.L5
.L3:
	movl	%r13d, %ecx
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L6
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$88, %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
.L13:
	.cfi_restore_state
	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:
```