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>
#define MAX(x,y)	((x)>(y)?(x):(y))
#define MAX3(x,y,z)	((x)>(MAX(y,z)) ? (x):(MAX(y,z)))

int main(){
  int a, b, c, k, sum1=0, sum2=0;
  scanf("%d%d%d%d", &a, &b, &c, &k);
  sum1 = MAX3(a,b,c);
  sum2 = (a+b+c) - sum1;
  while(k>0){
    sum1 *= 2;
    k--;
  }
  printf("%d", sum1+sum2);
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d"
	.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	.LC1(%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	16(%rsp), %ecx
	movl	12(%rsp), %edx
	movl	8(%rsp), %esi
	movl	20(%rsp), %edi
	cmpl	%edx, %ecx
	movl	%edx, %eax
	cmovge	%ecx, %eax
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	addl	%esi, %edx
	addl	%ecx, %edx
	subl	%eax, %edx
	testl	%edi, %edi
	jle	.L2
	cmpl	$1, %edi
	je	.L3
	movq	.LC0(%rip), %xmm0
	movl	%edi, %esi
	xorl	%ecx, %ecx
	shrl	%esi
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %ecx
	pslld	$1, %xmm0
	cmpl	%ecx, %esi
	jne	.L4
	movd	%xmm0, %esi
	pshufd	$0xe5, %xmm0, %xmm1
	movd	%xmm1, %ecx
	imull	%esi, %ecx
	imull	%ecx, %eax
	andl	$1, %edi
	je	.L5
.L3:
	addl	%eax, %eax
.L5:
	movl	$0, 20(%rsp)
.L2:
	addl	%eax, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	1
	.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
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d"
	.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	.LC1(%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	16(%rsp), %ecx
	movl	12(%rsp), %edx
	movl	8(%rsp), %esi
	movl	20(%rsp), %edi
	cmpl	%edx, %ecx
	movl	%edx, %eax
	cmovge	%ecx, %eax
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	addl	%esi, %edx
	addl	%ecx, %edx
	subl	%eax, %edx
	testl	%edi, %edi
	jle	.L2
	cmpl	$1, %edi
	je	.L3
	movq	.LC0(%rip), %xmm0
	movl	%edi, %esi
	xorl	%ecx, %ecx
	shrl	%esi
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %ecx
	pslld	$1, %xmm0
	cmpl	%ecx, %esi
	jne	.L4
	movd	%xmm0, %esi
	pshufd	$0xe5, %xmm0, %xmm1
	movd	%xmm1, %ecx
	imull	%esi, %ecx
	imull	%ecx, %eax
	andl	$1, %edi
	je	.L5
.L3:
	addl	%eax, %eax
.L5:
	movl	$0, 20(%rsp)
.L2:
	addl	%eax, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	1
	.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
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d"
	.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	.LC1(%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	16(%rsp), %ecx
	movl	12(%rsp), %edx
	movl	8(%rsp), %esi
	movl	20(%rsp), %edi
	cmpl	%edx, %ecx
	movl	%edx, %eax
	cmovge	%ecx, %eax
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	addl	%esi, %edx
	addl	%ecx, %edx
	subl	%eax, %edx
	testl	%edi, %edi
	jle	.L2
	cmpl	$1, %edi
	je	.L3
	movq	.LC0(%rip), %xmm0
	movl	%edi, %esi
	xorl	%ecx, %ecx
	shrl	%esi
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %ecx
	pslld	$1, %xmm0
	cmpl	%ecx, %esi
	jne	.L4
	movd	%xmm0, %esi
	pshufd	$0xe5, %xmm0, %xmm1
	movd	%xmm1, %ecx
	imull	%esi, %ecx
	imull	%ecx, %eax
	andl	$1, %edi
	je	.L5
.L3:
	addl	%eax, %eax
.L5:
	movl	$0, 20(%rsp)
.L2:
	addl	%eax, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	1
	.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>
#define MAX(x,y)	((x)>(y)?(x):(y))
#define MAX3(x,y,z)	((x)>(MAX(y,z)) ? (x):(MAX(y,z)))

int main(){
  int a, b, c, k, sum1=0, sum2=0;
  scanf("%d%d%d%d", &a, &b, &c, &k);
  sum1 = MAX3(a,b,c);
  sum2 = (a+b+c) - sum1;
  while(k>0){
    sum1 *= 2;
    k--;
  }
  printf("%d", sum1+sum2);
  return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#define MAX(x,y)	((x)>(y)?(x):(y))
#define MAX3(x,y,z)	((x)>(MAX(y,z)) ? (x):(MAX(y,z)))

int main(){
  int a, b, c, k, sum1=0, sum2=0;
  scanf("%d%d%d%d", &a, &b, &c, &k);
  sum1 = MAX3(a,b,c);
  sum2 = (a+b+c) - sum1;
  while(k>0){
    sum1 *= 2;
    k--;
  }
  printf("%d", sum1+sum2);
  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:

7 3 11
1
 3 3 4
4
 7 5 11
1
 3 3 4
0
 7 5 11
0
 4 3 4
0
 10 5 11
0
 4 3 1
0
 10 5 21
0
 4 1 1
0

32 70 34 10 23 11 26 8 36 6
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>
#define MAX(x,y)	((x)>(y)?(x):(y))
#define MAX3(x,y,z)	((x)>(MAX(y,z)) ? (x):(MAX(y,z)))

int main(){
  int a, b, c, k, sum1=0, sum2=0;
  scanf("%d%d%d%d", &a, &b, &c, &k);
  sum1 = MAX3(a,b,c);
  sum2 = (a+b+c) - sum1;
  while(k>0){
    sum1 *= 2;
    k--;
  }
  printf("%d", sum1+sum2);
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d"
	.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	.LC1(%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	16(%rsp), %ecx
	movl	12(%rsp), %edx
	movl	8(%rsp), %esi
	movl	20(%rsp), %edi
	cmpl	%edx, %ecx
	movl	%edx, %eax
	cmovge	%ecx, %eax
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	addl	%esi, %edx
	addl	%ecx, %edx
	subl	%eax, %edx
	testl	%edi, %edi
	jle	.L2
	cmpl	$1, %edi
	je	.L3
	movq	.LC0(%rip), %xmm0
	movl	%edi, %esi
	xorl	%ecx, %ecx
	shrl	%esi
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %ecx
	pslld	$1, %xmm0
	cmpl	%ecx, %esi
	jne	.L4
	movd	%xmm0, %esi
	pshufd	$0xe5, %xmm0, %xmm1
	movd	%xmm1, %ecx
	imull	%esi, %ecx
	imull	%ecx, %eax
	andl	$1, %edi
	je	.L5
.L3:
	addl	%eax, %eax
.L5:
	movl	$0, 20(%rsp)
.L2:
	addl	%eax, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	1
	.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
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d"
	.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	.LC1(%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	16(%rsp), %ecx
	movl	12(%rsp), %edx
	movl	8(%rsp), %esi
	movl	20(%rsp), %edi
	cmpl	%edx, %ecx
	movl	%edx, %eax
	cmovge	%ecx, %eax
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	addl	%esi, %edx
	addl	%ecx, %edx
	subl	%eax, %edx
	testl	%edi, %edi
	jle	.L2
	cmpl	$1, %edi
	je	.L3
	movq	.LC0(%rip), %xmm0
	movl	%edi, %esi
	xorl	%ecx, %ecx
	shrl	%esi
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %ecx
	pslld	$1, %xmm0
	cmpl	%ecx, %esi
	jne	.L4
	movd	%xmm0, %esi
	pshufd	$0xe5, %xmm0, %xmm1
	movd	%xmm1, %ecx
	imull	%esi, %ecx
	imull	%ecx, %eax
	andl	$1, %edi
	je	.L5
.L3:
	addl	%eax, %eax
.L5:
	movl	$0, 20(%rsp)
.L2:
	addl	%eax, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	1
	.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:
```