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;
	int cur;

	scanf("%d %d %d", &a, &b, &c);

	cur = 0;
	do {
		if (cur <= c && c <= cur + a) {
			printf("%d\n", c);
			return 0;
		}

		cur += a + b;
		while (c < cur)
			c += 60;
	} while (cur % 60);

	puts("-1");
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"-1"
	.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	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jg	.L2
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L2
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L7
.L2:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	addl	%eax, -12(%rbp)
	jmp	.L4
.L5:
	movl	-16(%rbp), %eax
	addl	$60, %eax
	movl	%eax, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jg	.L5
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$5, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$60, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L6
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L7:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	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"
.LC1:
	.string	"%d\n"
.LC5:
	.string	"-1"
	.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	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r10d
	movl	20(%rsp), %edx
	xorl	%ecx, %ecx
	movl	16(%rsp), %r8d
	xorl	%esi, %esi
	movl	$2290649225, %r9d
	movdqa	.LC2(%rip), %xmm4
	movdqa	.LC3(%rip), %xmm3
	movdqa	.LC4(%rip), %xmm2
	addl	%r10d, %r8d
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%edx, %esi
	jg	.L2
	leal	(%rsi,%r10), %eax
	cmpl	%eax, %edx
	jle	.L27
.L2:
	addl	%r8d, %esi
	cmpl	%edx, %esi
	jle	.L5
	movl	%esi, %eax
	subl	%edx, %eax
	leal	-1(%rax), %ecx
	movq	%rcx, %rax
	imulq	%r9, %rcx
	shrq	$37, %rcx
	addl	$1, %ecx
	cmpl	$179, %eax
	jbe	.L6
	movd	%edx, %xmm5
	movl	%ecx, %edi
	xorl	%eax, %eax
	pshufd	$0, %xmm5, %xmm1
	shrl	$2, %edi
	paddd	%xmm4, %xmm1
	.p2align 4,,10
	.p2align 3
.L7:
	movdqa	%xmm1, %xmm0
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%eax, %edi
	jne	.L7
	movl	%ecx, %edi
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %edi
	movd	%xmm0, %eax
	imull	$60, %edi, %r11d
	addl	%r11d, %edx
	cmpl	%edi, %ecx
	je	.L14
.L6:
	leal	60(%rdx), %eax
	cmpl	%eax, %esi
	jle	.L14
	leal	120(%rdx), %eax
	addl	$180, %edx
	cmpl	%eax, %esi
	cmovle	%eax, %edx
.L9:
	movl	$1, %ecx
.L5:
	imull	$-286331153, %esi, %eax
	addl	$143165576, %eax
	rorl	$2, %eax
	cmpl	$71582788, %eax
	ja	.L10
	testb	%cl, %cl
	je	.L11
	movl	%edx, 20(%rsp)
.L11:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
.L4:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	%eax, %edx
	jmp	.L9
.L27:
	testb	%cl, %cl
	je	.L3
	movl	%edx, 20(%rsp)
.L3:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	0
	.long	60
	.long	120
	.long	180
	.align 16
.LC3:
	.long	240
	.long	240
	.long	240
	.long	240
	.align 16
.LC4:
	.long	60
	.long	60
	.long	60
	.long	60
	.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"
.LC1:
	.string	"%d\n"
.LC5:
	.string	"-1"
	.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	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r10d
	movl	20(%rsp), %edx
	xorl	%ecx, %ecx
	movl	16(%rsp), %r8d
	xorl	%esi, %esi
	movl	$2290649225, %r9d
	movdqa	.LC2(%rip), %xmm4
	movdqa	.LC3(%rip), %xmm3
	movdqa	.LC4(%rip), %xmm2
	addl	%r10d, %r8d
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%edx, %esi
	jg	.L2
	leal	(%rsi,%r10), %eax
	cmpl	%eax, %edx
	jle	.L27
.L2:
	addl	%r8d, %esi
	cmpl	%edx, %esi
	jle	.L5
	movl	%esi, %eax
	subl	%edx, %eax
	leal	-1(%rax), %ecx
	movq	%rcx, %rax
	imulq	%r9, %rcx
	shrq	$37, %rcx
	addl	$1, %ecx
	cmpl	$179, %eax
	jbe	.L6
	movd	%edx, %xmm5
	movl	%ecx, %edi
	xorl	%eax, %eax
	pshufd	$0, %xmm5, %xmm1
	shrl	$2, %edi
	paddd	%xmm4, %xmm1
	.p2align 4,,10
	.p2align 3
.L7:
	movdqa	%xmm1, %xmm0
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%eax, %edi
	jne	.L7
	movl	%ecx, %edi
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %edi
	movd	%xmm0, %eax
	imull	$60, %edi, %r11d
	addl	%r11d, %edx
	cmpl	%edi, %ecx
	je	.L14
.L6:
	leal	60(%rdx), %eax
	cmpl	%eax, %esi
	jle	.L14
	leal	120(%rdx), %eax
	addl	$180, %edx
	cmpl	%eax, %esi
	cmovle	%eax, %edx
.L9:
	movl	$1, %ecx
.L5:
	imull	$-286331153, %esi, %eax
	addl	$143165576, %eax
	rorl	$2, %eax
	cmpl	$71582788, %eax
	ja	.L10
	testb	%cl, %cl
	je	.L11
	movl	%edx, 20(%rsp)
.L11:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
.L4:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	%eax, %edx
	jmp	.L9
.L27:
	testb	%cl, %cl
	je	.L3
	movl	%edx, 20(%rsp)
.L3:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	0
	.long	60
	.long	120
	.long	180
	.align 16
.LC3:
	.long	240
	.long	240
	.long	240
	.long	240
	.align 16
.LC4:
	.long	60
	.long	60
	.long	60
	.long	60
	.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;
	int cur;

	scanf("%d %d %d", &a, &b, &c);

	cur = 0;
	do {
		if (cur <= c && c <= cur + a) {
			printf("%d\n", c);
			return 0;
		}

		cur += a + b;
		while (c < cur)
			c += 60;
	} while (cur % 60);

	puts("-1");
	return 0;
}
20 25 20
 89 40 51
 10 14 5
 36 18 15
 3 18 15
 16 5 4
 0 18 15
 128 12 16
 0 18 12
 2 5 4

20
 51
 5
 15
 255
 4
 -1
 16
 72
 64

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;
	int cur;

	scanf("%d %d %d", &a, &b, &c);

	cur = 0;
	do {
		if (cur <= c && c <= cur + a) {
			printf("%d\n", c);
			return 0;
		}

		cur += a + b;
		while (c < cur)
			c += 60;
	} while (cur % 60);

	puts("-1");
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"-1"
	.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	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jg	.L2
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L2
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L7
.L2:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	addl	%eax, -12(%rbp)
	jmp	.L4
.L5:
	movl	-16(%rbp), %eax
	addl	$60, %eax
	movl	%eax, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jg	.L5
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$5, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$60, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L6
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L7:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	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"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"-1"
	.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	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jg	.L2
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L2
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L7
.L2:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	addl	%eax, -12(%rbp)
	jmp	.L4
.L5:
	movl	-16(%rbp), %eax
	addl	$60, %eax
	movl	%eax, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jg	.L5
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-2004318071, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$5, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$60, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L6
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L7:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	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:
