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(void){
    int a,b,c,d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    
    if((a-b)*(a-c)*(a-d)*(b-c)*(b-d)*(c-d))
    {
        if(a==1 || a==4 || a==7 || a==9)
        {
        if(b==1 || b==4 || b==7 || b==9)
        {
        if(c==1 || c==4 || c==7 || c==9)
        {
        if(d==1 || d==4 || d==7 || d==9)
        {
            printf("YES");
            return 0;
        }
        }
        }
        }
    }
    printf("NO");
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.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
	leaq	-12(%rbp), %rsi
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	movl	-16(%rbp), %ecx
	subl	%ecx, %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L2
	movl	-24(%rbp), %eax
	cmpl	$1, %eax
	je	.L3
	movl	-24(%rbp), %eax
	cmpl	$4, %eax
	je	.L3
	movl	-24(%rbp), %eax
	cmpl	$7, %eax
	je	.L3
	movl	-24(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L3:
	movl	-20(%rbp), %eax
	cmpl	$1, %eax
	je	.L4
	movl	-20(%rbp), %eax
	cmpl	$4, %eax
	je	.L4
	movl	-20(%rbp), %eax
	cmpl	$7, %eax
	je	.L4
	movl	-20(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L4:
	movl	-16(%rbp), %eax
	cmpl	$1, %eax
	je	.L5
	movl	-16(%rbp), %eax
	cmpl	$4, %eax
	je	.L5
	movl	-16(%rbp), %eax
	cmpl	$7, %eax
	je	.L5
	movl	-16(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L5:
	movl	-12(%rbp), %eax
	cmpl	$1, %eax
	je	.L6
	movl	-12(%rbp), %eax
	cmpl	$4, %eax
	je	.L6
	movl	-12(%rbp), %eax
	cmpl	$7, %eax
	je	.L6
	movl	-12(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L6:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L8
.L2:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L8:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	20(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ecx
	movl	12(%rsp), %edx
	movl	16(%rsp), %esi
	movl	20(%rsp), %edi
	movl	%ecx, %eax
	movl	%ecx, %r8d
	subl	%esi, %r8d
	subl	%edx, %eax
	imull	%r8d, %eax
	movl	%ecx, %r8d
	subl	%edi, %r8d
	imull	%r8d, %eax
	movl	%edx, %r8d
	subl	%esi, %r8d
	imull	%r8d, %eax
	movl	%edx, %r8d
	subl	%edi, %r8d
	imull	%r8d, %eax
	movl	%esi, %r8d
	subl	%edi, %r8d
	imull	%r8d, %eax
	testl	%eax, %eax
	je	.L2
	cmpl	$9, %ecx
	ja	.L2
	movl	$658, %eax
	movq	%rax, %r9
	shrq	%cl, %r9
	movq	%r9, %rcx
	andb	$1, %cl
	jne	.L22
.L2:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L3:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L22:
	.cfi_restore_state
	cmpl	$9, %edx
	ja	.L2
	movl	%edx, %ecx
	movq	%rax, %r10
	shrq	%cl, %r10
	movq	%r10, %rdx
	andb	$1, %dl
	je	.L2
	cmpl	$9, %esi
	ja	.L2
	movq	%rax, %rdx
	movl	%esi, %ecx
	shrq	%cl, %rdx
	andb	$1, %dl
	je	.L2
	cmpl	$9, %edi
	ja	.L2
	movl	%edi, %ecx
	shrq	%cl, %rax
	testb	$1, %al
	je	.L2
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L23:
	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	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	20(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ecx
	movl	12(%rsp), %edx
	movl	16(%rsp), %esi
	movl	20(%rsp), %edi
	movl	%ecx, %eax
	movl	%ecx, %r8d
	subl	%esi, %r8d
	subl	%edx, %eax
	imull	%r8d, %eax
	movl	%ecx, %r8d
	subl	%edi, %r8d
	imull	%r8d, %eax
	movl	%edx, %r8d
	subl	%esi, %r8d
	imull	%r8d, %eax
	movl	%edx, %r8d
	subl	%edi, %r8d
	imull	%r8d, %eax
	movl	%esi, %r8d
	subl	%edi, %r8d
	imull	%r8d, %eax
	testl	%eax, %eax
	je	.L2
	cmpl	$9, %ecx
	ja	.L2
	movl	$658, %eax
	movq	%rax, %r9
	shrq	%cl, %r9
	movq	%r9, %rcx
	andb	$1, %cl
	jne	.L22
.L2:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L3:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L22:
	.cfi_restore_state
	cmpl	$9, %edx
	ja	.L2
	movl	%edx, %ecx
	movq	%rax, %r10
	shrq	%cl, %r10
	movq	%r10, %rdx
	andb	$1, %dl
	je	.L2
	cmpl	$9, %esi
	ja	.L2
	movq	%rax, %rdx
	movl	%esi, %ecx
	shrq	%cl, %rdx
	andb	$1, %dl
	je	.L2
	cmpl	$9, %edi
	ja	.L2
	movl	%edi, %ecx
	shrq	%cl, %rax
	testb	$1, %al
	je	.L2
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L23:
	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(void){
    int a,b,c,d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    
    if((a-b)*(a-c)*(a-d)*(b-c)*(b-d)*(c-d))
    {
        if(a==1 || a==4 || a==7 || a==9)
        {
        if(b==1 || b==4 || b==7 || b==9)
        {
        if(c==1 || c==4 || c==7 || c==9)
        {
        if(d==1 || d==4 || d==7 || d==9)
        {
            printf("YES");
            return 0;
        }
        }
        }
        }
    }
    printf("NO");
    return 0;
}

1 9 13 4
 1 2 3 1
 4 9 0 13
 0 7 9 4
 1 9 13 3
 1 3 3 1
 3 9 0 13
 1 12 9 4
 1 9 13 0
 1 2 3 2

NO NO NO NO NO NO NO NO NO NO
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(void){
    int a,b,c,d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    
    if((a-b)*(a-c)*(a-d)*(b-c)*(b-d)*(c-d))
    {
        if(a==1 || a==4 || a==7 || a==9)
        {
        if(b==1 || b==4 || b==7 || b==9)
        {
        if(c==1 || c==4 || c==7 || c==9)
        {
        if(d==1 || d==4 || d==7 || d==9)
        {
            printf("YES");
            return 0;
        }
        }
        }
        }
    }
    printf("NO");
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.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
	leaq	-12(%rbp), %rsi
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	movl	-16(%rbp), %ecx
	subl	%ecx, %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L2
	movl	-24(%rbp), %eax
	cmpl	$1, %eax
	je	.L3
	movl	-24(%rbp), %eax
	cmpl	$4, %eax
	je	.L3
	movl	-24(%rbp), %eax
	cmpl	$7, %eax
	je	.L3
	movl	-24(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L3:
	movl	-20(%rbp), %eax
	cmpl	$1, %eax
	je	.L4
	movl	-20(%rbp), %eax
	cmpl	$4, %eax
	je	.L4
	movl	-20(%rbp), %eax
	cmpl	$7, %eax
	je	.L4
	movl	-20(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L4:
	movl	-16(%rbp), %eax
	cmpl	$1, %eax
	je	.L5
	movl	-16(%rbp), %eax
	cmpl	$4, %eax
	je	.L5
	movl	-16(%rbp), %eax
	cmpl	$7, %eax
	je	.L5
	movl	-16(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L5:
	movl	-12(%rbp), %eax
	cmpl	$1, %eax
	je	.L6
	movl	-12(%rbp), %eax
	cmpl	$4, %eax
	je	.L6
	movl	-12(%rbp), %eax
	cmpl	$7, %eax
	je	.L6
	movl	-12(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L6:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L8
.L2:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L8:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	"YES"
.LC2:
	.string	"NO"
	.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
	leaq	-12(%rbp), %rsi
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	movl	-16(%rbp), %ecx
	subl	%ecx, %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %ecx
	subl	%ecx, %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L2
	movl	-24(%rbp), %eax
	cmpl	$1, %eax
	je	.L3
	movl	-24(%rbp), %eax
	cmpl	$4, %eax
	je	.L3
	movl	-24(%rbp), %eax
	cmpl	$7, %eax
	je	.L3
	movl	-24(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L3:
	movl	-20(%rbp), %eax
	cmpl	$1, %eax
	je	.L4
	movl	-20(%rbp), %eax
	cmpl	$4, %eax
	je	.L4
	movl	-20(%rbp), %eax
	cmpl	$7, %eax
	je	.L4
	movl	-20(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L4:
	movl	-16(%rbp), %eax
	cmpl	$1, %eax
	je	.L5
	movl	-16(%rbp), %eax
	cmpl	$4, %eax
	je	.L5
	movl	-16(%rbp), %eax
	cmpl	$7, %eax
	je	.L5
	movl	-16(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L5:
	movl	-12(%rbp), %eax
	cmpl	$1, %eax
	je	.L6
	movl	-12(%rbp), %eax
	cmpl	$4, %eax
	je	.L6
	movl	-12(%rbp), %eax
	cmpl	$7, %eax
	je	.L6
	movl	-12(%rbp), %eax
	cmpl	$9, %eax
	jne	.L2
.L6:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L8
.L2:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L8:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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:
