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>
#include<string.h>
#include<stdlib.h>
#include<math.h>

int main(){

  int n;
  int a,b,c,d;

  scanf("%d", &n);

  d = n % 10;
  c = (n/10) % 10;
  b = (n/100) % 10;
  a = n/1000;

  if(a + b + c + d == 7){
    printf("%d+%d+%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a + b + c - d == 7){
    printf("%d+%d+%d-%d=7\n", a, b, c, d);
    return 0;
  }

  if(a + b - c + d == 7){
    printf("%d+%d-%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a + b - c - d == 7){
    printf("%d+%d-%d-%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b + c + d == 7){
    printf("%d-%d+%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b + c - d == 7){
    printf("%d-%d+%d-%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b - c + d == 7){
    printf("%d-%d-%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b - c - d == 7){
    printf("%d-%d-%d-%d=7\n", a, b, c, d);
    return 0;
  }

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d+%d+%d+%d=7\n"
.LC2:
	.string	"%d+%d+%d-%d=7\n"
.LC3:
	.string	"%d+%d-%d+%d=7\n"
.LC4:
	.string	"%d+%d-%d-%d=7\n"
.LC5:
	.string	"%d-%d+%d+%d=7\n"
.LC6:
	.string	"%d-%d+%d-%d=7\n"
.LC7:
	.string	"%d-%d-%d+%d=7\n"
.LC8:
	.string	"%d-%d-%d-%d=7\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -24(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -20(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -16(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L2
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L2:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L4
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L4:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	subl	-20(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L5
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L5:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	subl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L6
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L6:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L7
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L7:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L8
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L8:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L9
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L9:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L10
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L10:
	movl	$0, %eax
.L11:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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"
.LC1:
	.string	"%d+%d+%d+%d=7\n"
.LC2:
	.string	"%d+%d+%d-%d=7\n"
.LC3:
	.string	"%d+%d-%d+%d=7\n"
.LC4:
	.string	"%d+%d-%d-%d=7\n"
.LC5:
	.string	"%d-%d+%d+%d=7\n"
.LC6:
	.string	"%d-%d+%d-%d=7\n"
.LC7:
	.string	"%d-%d-%d+%d=7\n"
.LC8:
	.string	"%d-%d-%d-%d=7\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	imulq	$1717986919, %rax, %r9
	movl	%eax, %esi
	movq	%rax, %rdi
	sarl	$31, %esi
	sarq	$34, %r9
	subl	%esi, %r9d
	movslq	%r9d, %r8
	movq	%r8, %rdx
	leal	(%r8,%r8,4), %ecx
	imulq	$1717986919, %r8, %r8
	addl	%ecx, %ecx
	subl	%ecx, %edi
	movl	%edx, %ecx
	sarl	$31, %ecx
	movl	%edi, %r9d
	sarq	$34, %r8
	subl	%ecx, %r8d
	leal	(%r8,%r8,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	movl	%edx, %r8d
	imulq	$1374389535, %rax, %rdx
	sarq	$37, %rdx
	subl	%esi, %edx
	movslq	%edx, %rcx
	movl	%edx, %edi
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %edi
	sarq	$34, %rcx
	subl	%edi, %ecx
	leal	(%rcx,%rcx,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	movl	%edx, %ecx
	imulq	$274877907, %rax, %rdx
	sarq	$38, %rdx
	subl	%esi, %edx
	leal	(%rcx,%rdx), %eax
	leal	(%rax,%r8), %esi
	leal	(%rsi,%r9), %edi
	cmpl	$7, %edi
	je	.L13
	subl	%r9d, %esi
	cmpl	$7, %esi
	je	.L14
	subl	%r8d, %eax
	leal	(%rax,%r9), %esi
	cmpl	$7, %esi
	je	.L15
	subl	%r9d, %eax
	cmpl	$7, %eax
	je	.L16
	movl	%edx, %eax
	subl	%ecx, %eax
	leal	(%rax,%r8), %esi
	leal	(%rsi,%r9), %edi
	cmpl	$7, %edi
	je	.L17
	subl	%r9d, %esi
	cmpl	$7, %esi
	je	.L18
	subl	%r8d, %eax
	leal	(%rax,%r9), %esi
	cmpl	$7, %esi
	je	.L19
	subl	%r9d, %eax
	cmpl	$7, %eax
	je	.L20
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L13:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L14:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L15:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L16:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L17:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L19:
	leaq	.LC7(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L20:
	leaq	.LC8(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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"
.LC1:
	.string	"%d+%d+%d+%d=7\n"
.LC2:
	.string	"%d+%d+%d-%d=7\n"
.LC3:
	.string	"%d+%d-%d+%d=7\n"
.LC4:
	.string	"%d+%d-%d-%d=7\n"
.LC5:
	.string	"%d-%d+%d+%d=7\n"
.LC6:
	.string	"%d-%d+%d-%d=7\n"
.LC7:
	.string	"%d-%d-%d+%d=7\n"
.LC8:
	.string	"%d-%d-%d-%d=7\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	imulq	$1717986919, %rax, %r9
	movl	%eax, %esi
	movq	%rax, %rdi
	sarl	$31, %esi
	sarq	$34, %r9
	subl	%esi, %r9d
	movslq	%r9d, %r8
	movq	%r8, %rdx
	leal	(%r8,%r8,4), %ecx
	imulq	$1717986919, %r8, %r8
	addl	%ecx, %ecx
	subl	%ecx, %edi
	movl	%edx, %ecx
	sarl	$31, %ecx
	movl	%edi, %r9d
	sarq	$34, %r8
	subl	%ecx, %r8d
	leal	(%r8,%r8,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	movl	%edx, %r8d
	imulq	$1374389535, %rax, %rdx
	sarq	$37, %rdx
	subl	%esi, %edx
	movslq	%edx, %rcx
	movl	%edx, %edi
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %edi
	sarq	$34, %rcx
	subl	%edi, %ecx
	leal	(%rcx,%rcx,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	movl	%edx, %ecx
	imulq	$274877907, %rax, %rdx
	sarq	$38, %rdx
	subl	%esi, %edx
	leal	(%rcx,%rdx), %eax
	leal	(%rax,%r8), %esi
	leal	(%rsi,%r9), %edi
	cmpl	$7, %edi
	je	.L13
	subl	%r9d, %esi
	cmpl	$7, %esi
	je	.L14
	subl	%r8d, %eax
	leal	(%rax,%r9), %esi
	cmpl	$7, %esi
	je	.L15
	subl	%r9d, %eax
	cmpl	$7, %eax
	je	.L16
	movl	%edx, %eax
	subl	%ecx, %eax
	leal	(%rax,%r8), %esi
	leal	(%rsi,%r9), %edi
	cmpl	$7, %edi
	je	.L17
	subl	%r9d, %esi
	cmpl	$7, %esi
	je	.L18
	subl	%r8d, %eax
	leal	(%rax,%r9), %esi
	cmpl	$7, %esi
	je	.L19
	subl	%r9d, %eax
	cmpl	$7, %eax
	je	.L20
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L13:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L14:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L15:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L16:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L17:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L19:
	leaq	.LC7(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L20:
	leaq	.LC8(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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>
#include<string.h>
#include<stdlib.h>
#include<math.h>

int main(){

  int n;
  int a,b,c,d;

  scanf("%d", &n);

  d = n % 10;
  c = (n/10) % 10;
  b = (n/100) % 10;
  a = n/1000;

  if(a + b + c + d == 7){
    printf("%d+%d+%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a + b + c - d == 7){
    printf("%d+%d+%d-%d=7\n", a, b, c, d);
    return 0;
  }

  if(a + b - c + d == 7){
    printf("%d+%d-%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a + b - c - d == 7){
    printf("%d+%d-%d-%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b + c + d == 7){
    printf("%d-%d+%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b + c - d == 7){
    printf("%d-%d+%d-%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b - c + d == 7){
    printf("%d-%d-%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b - c - d == 7){
    printf("%d-%d-%d-%d=7\n", a, b, c, d);
    return 0;
  }

  return 0;
}
2364
 1114
 2005
 1455
 1152
 3246
 6120
 2768
 1183
 1024

2+3+6-4=7
 1+1+1+4=7
 2+0+0+5=7
 1-4+5+5=7
 1-1+5+2=7
 3+2-4+6=7
 6-1+2+0=7
 2+7+6-8=7
 1+1+8-3=7
 1+0+2+4=7

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>
#include<string.h>
#include<stdlib.h>
#include<math.h>

int main(){

  int n;
  int a,b,c,d;

  scanf("%d", &n);

  d = n % 10;
  c = (n/10) % 10;
  b = (n/100) % 10;
  a = n/1000;

  if(a + b + c + d == 7){
    printf("%d+%d+%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a + b + c - d == 7){
    printf("%d+%d+%d-%d=7\n", a, b, c, d);
    return 0;
  }

  if(a + b - c + d == 7){
    printf("%d+%d-%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a + b - c - d == 7){
    printf("%d+%d-%d-%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b + c + d == 7){
    printf("%d-%d+%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b + c - d == 7){
    printf("%d-%d+%d-%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b - c + d == 7){
    printf("%d-%d-%d+%d=7\n", a, b, c, d);
    return 0;
  }

  if(a - b - c - d == 7){
    printf("%d-%d-%d-%d=7\n", a, b, c, d);
    return 0;
  }

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d+%d+%d+%d=7\n"
.LC2:
	.string	"%d+%d+%d-%d=7\n"
.LC3:
	.string	"%d+%d-%d+%d=7\n"
.LC4:
	.string	"%d+%d-%d-%d=7\n"
.LC5:
	.string	"%d-%d+%d+%d=7\n"
.LC6:
	.string	"%d-%d+%d-%d=7\n"
.LC7:
	.string	"%d-%d-%d+%d=7\n"
.LC8:
	.string	"%d-%d-%d-%d=7\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -24(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -20(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -16(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L2
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L2:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L4
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L4:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	subl	-20(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L5
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L5:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	subl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L6
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L6:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L7
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L7:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L8
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L8:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L9
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L9:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L10
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L10:
	movl	$0, %eax
.L11:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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"
.LC1:
	.string	"%d+%d+%d+%d=7\n"
.LC2:
	.string	"%d+%d+%d-%d=7\n"
.LC3:
	.string	"%d+%d-%d+%d=7\n"
.LC4:
	.string	"%d+%d-%d-%d=7\n"
.LC5:
	.string	"%d-%d+%d+%d=7\n"
.LC6:
	.string	"%d-%d+%d-%d=7\n"
.LC7:
	.string	"%d-%d-%d+%d=7\n"
.LC8:
	.string	"%d-%d-%d-%d=7\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -24(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -20(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -16(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L2
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L2:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L4
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L4:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	subl	-20(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L5
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L5:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	subl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L6
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L6:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L7
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L7:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L8
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L8:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$7, %eax
	jne	.L9
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L9:
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L10
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L11
.L10:
	movl	$0, %eax
.L11:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
