Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
//#include<string.h>
//#include<time.h>
//#define pi acos(-1.0)
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
#define S(type,x) fscanf(stdin,"%"#type,&x)
int main() {
	int n;
	S(d, n);
	while (n--) {
		int r, t;
		fscanf(stdin, "%d%d", &r, &t);
		int a = 5 * (t / 30) + (r / 100),
			b = 5 * (t / 30) + (r / 100 + 1),
			c = 5 * (t / 30 + 1) + (r / 100),
			d = 5 * (t / 30 + 1) + (r / 100 + 1);
		if (!(r % 100) && !(t % 30)) P(d, a);
		else if (!(t % 30)) fprintf(stdout, "%d ", a), P(d, b);
		else if (!(r % 100))fprintf(stdout, "%d ", a), P(d, c);
		else fprintf(stdout, "%d ", a),
			 fprintf(stdout, "%d ", b),
			 fprintf(stdout, "%d ", c),
			 P(d, d);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d "
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rax
	leaq	-36(%rbp), %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	jmp	.L2
.L7:
	movq	stdin(%rip), %rax
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	$1, %eax
	addl	%ecx, %eax
	movl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	leal	1(%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	leal	1(%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	$1, %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-32(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$30, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L3
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	jmp	.L2
.L3:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$30, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L5
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-20(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	jmp	.L2
.L5:
	movl	-32(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L6
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-16(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	jmp	.L2
.L6:
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-20(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-16(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-12(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
.L2:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	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"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC3(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L2
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	imull	$-286331153, %edx, %edx
	movq	stdout(%rip), %rdi
	addl	$143165576, %edx
	rorl	%edx
	cmpl	$143165576, %edx
	jbe	.L19
	movq	%rbx, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	%r15d, %ecx
.L17:
	movq	stdout(%rip), %rdi
	movq	%rbp, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	je	.L6
.L2:
	movq	stdin(%rip), %rdi
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movslq	36(%rsp), %rax
	movq	%rax, %rdx
	imulq	$-2004318071, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrq	$32, %rax
	addl	%edx, %eax
	sarl	$4, %eax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %r10d
	movslq	32(%rsp), %rax
	leal	5(%r10), %r8d
	movq	%rax, %rsi
	imulq	$1374389535, %rax, %rax
	movl	%esi, %ecx
	sarl	$31, %ecx
	sarq	$37, %rax
	subl	%ecx, %eax
	imull	$100, %eax, %edi
	leal	(%r10,%rax), %ecx
	leal	(%rax,%r8), %r15d
	cmpl	%edi, %esi
	je	.L20
	imull	$-286331153, %edx, %edx
	leal	1(%rax), %r9d
	movq	stdout(%rip), %rdi
	addl	%r9d, %r10d
	addl	$143165576, %edx
	rorl	%edx
	cmpl	$143165576, %edx
	jbe	.L21
	movq	%rbx, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	movl	%r8d, 8(%rsp)
	movl	%r9d, 4(%rsp)
	movl	%r10d, 12(%rsp)
	call	__fprintf_chk@PLT
	movl	12(%rsp), %ecx
	movq	%rbx, %rdx
	xorl	%eax, %eax
	movq	stdout(%rip), %rdi
	movl	$1, %esi
	call	__fprintf_chk@PLT
	movl	%r15d, %ecx
	movq	%rbx, %rdx
	movl	$1, %esi
	movq	stdout(%rip), %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	4(%rsp), %r9d
	movl	8(%rsp), %r8d
	leal	(%r9,%r8), %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbx, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	movl	%r10d, 4(%rsp)
	call	__fprintf_chk@PLT
	movl	4(%rsp), %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rbp, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L22:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC3(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	call	__isoc99_fscanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L2
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	imull	$-286331153, %edx, %edx
	movq	stdout(%rip), %rdi
	addl	$143165576, %edx
	rorl	%edx
	cmpl	$143165576, %edx
	jbe	.L19
	movq	%rbx, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	%r15d, %ecx
.L17:
	movq	stdout(%rip), %rdi
	movq	%rbp, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	je	.L6
.L2:
	movq	stdin(%rip), %rdi
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movslq	36(%rsp), %rax
	movq	%rax, %rdx
	imulq	$-2004318071, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrq	$32, %rax
	addl	%edx, %eax
	sarl	$4, %eax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %r10d
	movslq	32(%rsp), %rax
	leal	5(%r10), %r8d
	movq	%rax, %rsi
	imulq	$1374389535, %rax, %rax
	movl	%esi, %ecx
	sarl	$31, %ecx
	sarq	$37, %rax
	subl	%ecx, %eax
	imull	$100, %eax, %edi
	leal	(%r10,%rax), %ecx
	leal	(%rax,%r8), %r15d
	cmpl	%edi, %esi
	je	.L20
	imull	$-286331153, %edx, %edx
	leal	1(%rax), %r9d
	movq	stdout(%rip), %rdi
	addl	%r9d, %r10d
	addl	$143165576, %edx
	rorl	%edx
	cmpl	$143165576, %edx
	jbe	.L21
	movq	%rbx, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	movl	%r8d, 8(%rsp)
	movl	%r9d, 4(%rsp)
	movl	%r10d, 12(%rsp)
	call	__fprintf_chk@PLT
	movl	12(%rsp), %ecx
	movq	%rbx, %rdx
	xorl	%eax, %eax
	movq	stdout(%rip), %rdi
	movl	$1, %esi
	call	__fprintf_chk@PLT
	movl	%r15d, %ecx
	movq	%rbx, %rdx
	movl	$1, %esi
	movq	stdout(%rip), %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	4(%rsp), %r9d
	movl	8(%rsp), %r8d
	leal	(%r9,%r8), %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbx, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	movl	%r10d, 4(%rsp)
	call	__fprintf_chk@PLT
	movl	4(%rsp), %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rbp, %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L22:
	.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:

#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
//#include<string.h>
//#include<time.h>
//#define pi acos(-1.0)
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
#define S(type,x) fscanf(stdin,"%"#type,&x)
int main() {
	int n;
	S(d, n);
	while (n--) {
		int r, t;
		fscanf(stdin, "%d%d", &r, &t);
		int a = 5 * (t / 30) + (r / 100),
			b = 5 * (t / 30) + (r / 100 + 1),
			c = 5 * (t / 30 + 1) + (r / 100),
			d = 5 * (t / 30 + 1) + (r / 100 + 1);
		if (!(r % 100) && !(t % 30)) P(d, a);
		else if (!(t % 30)) fprintf(stdout, "%d ", a), P(d, b);
		else if (!(r % 100))fprintf(stdout, "%d ", a), P(d, c);
		else fprintf(stdout, "%d ", a),
			 fprintf(stdout, "%d ", b),
			 fprintf(stdout, "%d ", c),
			 P(d, d);
	}
	return 0;
}
4
300 120
300 105
250 105
250 90

23
18 23
17 18 22 23
17 18

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
//#include<string.h>
//#include<time.h>
//#define pi acos(-1.0)
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
#define S(type,x) fscanf(stdin,"%"#type,&x)
int main() {
	int n;
	S(d, n);
	while (n--) {
		int r, t;
		fscanf(stdin, "%d%d", &r, &t);
		int a = 5 * (t / 30) + (r / 100),
			b = 5 * (t / 30) + (r / 100 + 1),
			c = 5 * (t / 30 + 1) + (r / 100),
			d = 5 * (t / 30 + 1) + (r / 100 + 1);
		if (!(r % 100) && !(t % 30)) P(d, a);
		else if (!(t % 30)) fprintf(stdout, "%d ", a), P(d, b);
		else if (!(r % 100))fprintf(stdout, "%d ", a), P(d, c);
		else fprintf(stdout, "%d ", a),
			 fprintf(stdout, "%d ", b),
			 fprintf(stdout, "%d ", c),
			 P(d, d);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d "
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rax
	leaq	-36(%rbp), %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	jmp	.L2
.L7:
	movq	stdin(%rip), %rax
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	$1, %eax
	addl	%ecx, %eax
	movl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	leal	1(%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	leal	1(%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	$1, %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-32(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$30, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L3
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	jmp	.L2
.L3:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$30, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L5
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-20(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	jmp	.L2
.L5:
	movl	-32(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L6
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-16(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	jmp	.L2
.L6:
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-20(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-16(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-12(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
.L2:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	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"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d "
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rax
	leaq	-36(%rbp), %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	jmp	.L2
.L7:
	movq	stdin(%rip), %rax
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	$1, %eax
	addl	%ecx, %eax
	movl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	leal	1(%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	leal	1(%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	leal	(%rax,%rdx), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	$1, %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-32(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$30, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L3
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	jmp	.L2
.L3:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$4, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$30, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L5
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-20(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	jmp	.L2
.L5:
	movl	-32(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L6
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-16(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	jmp	.L2
.L6:
	movq	stdout(%rip), %rax
	movl	-24(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-20(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-16(%rbp), %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
	movq	stdout(%rip), %rax
	movl	-12(%rbp), %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	fprintf@PLT
.L2:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	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:
