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(void)
{
	int i,j;
	int n;
	
	scanf("%d",&n);
	
	for(i=1;i<=n;i++)
	{
		if(i%3==0)
		{
			printf(" %d",i);
		}
		else
		{
			for(j=i;j>0;)
			{
				if(j%10==3)
				{
					printf(" %d",i);
					break;
				}
				j/=10;
			}
		}
	}
	printf("\n");
	
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	movl	$1, %ebp
	movl	$3435973837, %r12d
	leaq	.LC1(%rip), %rbx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ebp, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jl	.L2
.L6:
	imull	$-1431655765, %ebp, %eax
	cmpl	$1431655765, %eax
	jbe	.L12
	movl	%ebp, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	imull	$-858993459, %eax, %edx
	subl	$1717986919, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L12
	movl	%eax, %eax
	imulq	%r12, %rax
	shrq	$35, %rax
	testl	%eax, %eax
	jne	.L3
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jge	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$10, %edi
	call	putchar@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	movl	$1, %ebp
	movl	$3435973837, %r12d
	leaq	.LC1(%rip), %rbx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ebp, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jl	.L2
.L6:
	imull	$-1431655765, %ebp, %eax
	cmpl	$1431655765, %eax
	jbe	.L12
	movl	%ebp, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	imull	$-858993459, %eax, %edx
	subl	$1717986919, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L12
	movl	%eax, %eax
	imulq	%r12, %rax
	shrq	$35, %rax
	testl	%eax, %eax
	jne	.L3
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jge	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$10, %edi
	call	putchar@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	movl	$1, %ebp
	movl	$3435973837, %r12d
	leaq	.LC1(%rip), %rbx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ebp, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jl	.L2
.L6:
	imull	$-1431655765, %ebp, %eax
	cmpl	$1431655765, %eax
	jbe	.L12
	movl	%ebp, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	imull	$-858993459, %eax, %edx
	subl	$1717986919, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L12
	movl	%eax, %eax
	imulq	%r12, %rax
	shrq	$35, %rax
	testl	%eax, %eax
	jne	.L3
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jge	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$10, %edi
	call	putchar@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.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(void)
{
	int i,j;
	int n;
	
	scanf("%d",&n);
	
	for(i=1;i<=n;i++)
	{
		if(i%3==0)
		{
			printf(" %d",i);
		}
		else
		{
			for(j=i;j>0;)
			{
				if(j%10==3)
				{
					printf(" %d",i);
					break;
				}
				j/=10;
			}
		}
	}
	printf("\n");
	
	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(void)
{
	int i,j;
	int n;
	
	scanf("%d",&n);
	
	for(i=1;i<=n;i++)
	{
		if(i%3==0)
		{
			printf(" %d",i);
		}
		else
		{
			for(j=i;j>0;)
			{
				if(j%10==3)
				{
					printf(" %d",i);
					break;
				}
				j/=10;
			}
		}
	}
	printf("\n");
	
	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:

53
 9
 17
 28
 7
 13
 25
 18
 4
 21

 3 6 9 12 13 15 18 21 23 24 27 30 31 32 33 34 35 36 37 38 39 42 43 45 48 51 53
  3 6 9
  3 6 9 12 13 15
  3 6 9 12 13 15 18 21 23 24 27
  3 6
  3 6 9 12 13
  3 6 9 12 13 15 18 21 23 24
  3 6 9 12 13 15 18
  3
  3 6 9 12 13 15 18 21

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(void)
{
	int i,j;
	int n;
	
	scanf("%d",&n);
	
	for(i=1;i<=n;i++)
	{
		if(i%3==0)
		{
			printf(" %d",i);
		}
		else
		{
			for(j=i;j>0;)
			{
				if(j%10==3)
				{
					printf(" %d",i);
					break;
				}
				j/=10;
			}
		}
	}
	printf("\n");
	
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	movl	$1, %ebp
	movl	$3435973837, %r12d
	leaq	.LC1(%rip), %rbx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ebp, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jl	.L2
.L6:
	imull	$-1431655765, %ebp, %eax
	cmpl	$1431655765, %eax
	jbe	.L12
	movl	%ebp, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	imull	$-858993459, %eax, %edx
	subl	$1717986919, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L12
	movl	%eax, %eax
	imulq	%r12, %rax
	shrq	$35, %rax
	testl	%eax, %eax
	jne	.L3
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jge	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$10, %edi
	call	putchar@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	movl	$1, %ebp
	movl	$3435973837, %r12d
	leaq	.LC1(%rip), %rbx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ebp, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jl	.L2
.L6:
	imull	$-1431655765, %ebp, %eax
	cmpl	$1431655765, %eax
	jbe	.L12
	movl	%ebp, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	imull	$-858993459, %eax, %edx
	subl	$1717986919, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L12
	movl	%eax, %eax
	imulq	%r12, %rax
	shrq	$35, %rax
	testl	%eax, %eax
	jne	.L3
	addl	$1, %ebp
	cmpl	%ebp, 4(%rsp)
	jge	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$10, %edi
	call	putchar@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.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:
```