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()
{

    long long a, b, c, d, e, max, min, sum, i;

    scanf("%lld %lld", &a, &b);
    
    d = e = b;

    for(i = 1; i < a; i++){
	scanf("%lld", &c);
	if(c > b) b = c;
        if(c < d) d =c;
        e += c;
	}
    max = b;
    min = d;
    sum = e;

    printf("%d %d %lld\n", min, max, sum);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$1, (%rsp)
	movq	8(%rsp), %r12
	jle	.L7
	movq	%r12, %rbp
	movl	$1, %ebx
	leaq	16(%rsp), %r14
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movq	8(%rsp), %rcx
	cmpq	%rcx, %rax
	jle	.L3
	cmpq	%rax, %r12
	movq	%rax, 8(%rsp)
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	(%rsp), %rbx
	jl	.L5
	movq	%rax, %rcx
.L2:
	xorl	%eax, %eax
	movq	%rbp, %r8
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$32, %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
	cmpq	%rax, %r12
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	%rbx, (%rsp)
	jg	.L5
	jmp	.L2
.L7:
	movq	%r12, %rcx
	movq	%r12, %rbp
	jmp	.L2
.L10:
	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	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$1, (%rsp)
	movq	8(%rsp), %r12
	jle	.L7
	movq	%r12, %rbp
	movl	$1, %ebx
	leaq	16(%rsp), %r14
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movq	8(%rsp), %rcx
	cmpq	%rcx, %rax
	jle	.L3
	cmpq	%rax, %r12
	movq	%rax, 8(%rsp)
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	(%rsp), %rbx
	jl	.L5
	movq	%rax, %rcx
.L2:
	xorl	%eax, %eax
	movq	%rbp, %r8
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$32, %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
	cmpq	%rax, %r12
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	%rbx, (%rsp)
	jg	.L5
	jmp	.L2
.L7:
	movq	%r12, %rcx
	movq	%r12, %rbp
	jmp	.L2
.L10:
	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	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$1, (%rsp)
	movq	8(%rsp), %r12
	jle	.L7
	movq	%r12, %rbp
	movl	$1, %ebx
	leaq	16(%rsp), %r14
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movq	8(%rsp), %rcx
	cmpq	%rcx, %rax
	jle	.L3
	cmpq	%rax, %r12
	movq	%rax, 8(%rsp)
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	(%rsp), %rbx
	jl	.L5
	movq	%rax, %rcx
.L2:
	xorl	%eax, %eax
	movq	%rbp, %r8
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$32, %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
	cmpq	%rax, %r12
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	%rbx, (%rsp)
	jg	.L5
	jmp	.L2
.L7:
	movq	%r12, %rcx
	movq	%r12, %rbp
	jmp	.L2
.L10:
	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()
{

    long long a, b, c, d, e, max, min, sum, i;

    scanf("%lld %lld", &a, &b);
    
    d = e = b;

    for(i = 1; i < a; i++){
	scanf("%lld", &c);
	if(c > b) b = c;
        if(c < d) d =c;
        e += c;
	}
    max = b;
    min = d;
    sum = e;

    printf("%d %d %lld\n", min, max, sum);
    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()
{

    long long a, b, c, d, e, max, min, sum, i;

    scanf("%lld %lld", &a, &b);
    
    d = e = b;

    for(i = 1; i < a; i++){
	scanf("%lld", &c);
	if(c > b) b = c;
        if(c < d) d =c;
        e += c;
	}
    max = b;
    min = d;
    sum = e;

    printf("%d %d %lld\n", min, max, sum);
    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:

5
13 1 5 4 17
 5
13 1 5 7 17
 5
13 0 5 7 17
 5
13 0 7 7 17
 5
23 0 7 7 17
 5
23 0 0 7 17
 5
23 0 0 4 17
 5
43 0 0 4 17
 5
43 0 0 4 18
 5
43 0 -1 4 18

1 17 40
 1 17 43
 0 17 42
 0 17 44
 0 23 54
 0 23 47
 0 23 44
 0 43 64
 0 43 65
 -1 43 64

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()
{

    long long a, b, c, d, e, max, min, sum, i;

    scanf("%lld %lld", &a, &b);
    
    d = e = b;

    for(i = 1; i < a; i++){
	scanf("%lld", &c);
	if(c > b) b = c;
        if(c < d) d =c;
        e += c;
	}
    max = b;
    min = d;
    sum = e;

    printf("%d %d %lld\n", min, max, sum);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$1, (%rsp)
	movq	8(%rsp), %r12
	jle	.L7
	movq	%r12, %rbp
	movl	$1, %ebx
	leaq	16(%rsp), %r14
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movq	8(%rsp), %rcx
	cmpq	%rcx, %rax
	jle	.L3
	cmpq	%rax, %r12
	movq	%rax, 8(%rsp)
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	(%rsp), %rbx
	jl	.L5
	movq	%rax, %rcx
.L2:
	xorl	%eax, %eax
	movq	%rbp, %r8
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$32, %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
	cmpq	%rax, %r12
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	%rbx, (%rsp)
	jg	.L5
	jmp	.L2
.L7:
	movq	%r12, %rcx
	movq	%r12, %rbp
	jmp	.L2
.L10:
	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	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$1, (%rsp)
	movq	8(%rsp), %r12
	jle	.L7
	movq	%r12, %rbp
	movl	$1, %ebx
	leaq	16(%rsp), %r14
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movq	8(%rsp), %rcx
	cmpq	%rcx, %rax
	jle	.L3
	cmpq	%rax, %r12
	movq	%rax, 8(%rsp)
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	(%rsp), %rbx
	jl	.L5
	movq	%rax, %rcx
.L2:
	xorl	%eax, %eax
	movq	%rbp, %r8
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$32, %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
	cmpq	%rax, %r12
	cmovg	%rax, %r12
	addq	%rax, %rbp
	addq	$1, %rbx
	cmpq	%rbx, (%rsp)
	jg	.L5
	jmp	.L2
.L7:
	movq	%r12, %rcx
	movq	%r12, %rbp
	jmp	.L2
.L10:
	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:
```