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(){
  long long int T1,T2,A1,A2,B1,B2;
  scanf("%lld %lld",&T1,&T2);
  scanf("%lld %lld",&A1,&A2);
  scanf("%lld %lld",&B1,&B2);
  long long int diff = T1*(A1-B1)+T2*(A2-B2);
  if(diff == 0){printf("infinity\n");}
  else{
    long long diff2 = T1*(A1-B1);
    if((diff > 0&&diff2 > 0)||(diff<0&&diff2<0)){printf("0\n");}
    else{
      long long int ct = -diff2 / diff;
      ct *= 2;ct++;
      if(diff2 % diff==0){ct--;}printf("%lld\n",ct);
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"infinity"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\n"
	.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	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-56(%rbp), %rdx
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	movq	-48(%rbp), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	-56(%rbp), %rax
	movq	-40(%rbp), %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	-72(%rbp), %rax
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	jne	.L2
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L2:
	movq	-64(%rbp), %rax
	movq	-48(%rbp), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L4
	cmpq	$0, -16(%rbp)
	jg	.L5
.L4:
	cmpq	$0, -24(%rbp)
	jns	.L6
	cmpq	$0, -16(%rbp)
	jns	.L6
.L5:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L6:
	movq	-16(%rbp), %rax
	negq	%rax
	cqto
	idivq	-24(%rbp)
	movq	%rax, -32(%rbp)
	salq	-32(%rbp)
	addq	$1, -32(%rbp)
	movq	-16(%rbp), %rax
	cqto
	idivq	-24(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L7
	subq	$1, -32(%rbp)
.L7:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L3:
	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	"%lld %lld"
.LC1:
	.string	"infinity"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$64, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rdx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	40(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	48(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rsi
	movq	32(%rsp), %rcx
	subq	40(%rsp), %rsi
	subq	48(%rsp), %rcx
	imulq	8(%rsp), %rsi
	imulq	16(%rsp), %rcx
	addq	%rsi, %rcx
	testq	%rcx, %rcx
	je	.L17
	jle	.L9
	testq	%rsi, %rsi
	jg	.L4
.L9:
	testq	%rcx, %rsi
	js	.L4
	movq	%rsi, %rax
	negq	%rax
	cqto
	idivq	%rcx
	leaq	(%rax,%rax), %rdi
	movq	%rsi, %rax
	leaq	.LC3(%rip), %rsi
	cqto
	idivq	%rcx
	cmpq	$1, %rdx
	sbbq	$-1, %rdi
	xorl	%eax, %eax
	movq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
.L3:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L3
.L17:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L3
.L18:
	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	"%lld %lld"
.LC1:
	.string	"infinity"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$64, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rdx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	40(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	48(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rsi
	movq	32(%rsp), %rcx
	subq	40(%rsp), %rsi
	subq	48(%rsp), %rcx
	imulq	8(%rsp), %rsi
	imulq	16(%rsp), %rcx
	addq	%rsi, %rcx
	testq	%rcx, %rcx
	je	.L17
	jle	.L9
	testq	%rsi, %rsi
	jg	.L4
.L9:
	testq	%rcx, %rsi
	js	.L4
	movq	%rsi, %rax
	negq	%rax
	cqto
	idivq	%rcx
	leaq	(%rax,%rax), %rdi
	movq	%rsi, %rax
	leaq	.LC3(%rip), %rsi
	cqto
	idivq	%rcx
	cmpq	$1, %rdx
	sbbq	$-1, %rdi
	xorl	%eax, %eax
	movq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
.L3:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L3
.L17:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L3
.L18:
	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:

#include<stdio.h>

int main(){
  long long int T1,T2,A1,A2,B1,B2;
  scanf("%lld %lld",&T1,&T2);
  scanf("%lld %lld",&A1,&A2);
  scanf("%lld %lld",&B1,&B2);
  long long int diff = T1*(A1-B1)+T2*(A2-B2);
  if(diff == 0){printf("infinity\n");}
  else{
    long long diff2 = T1*(A1-B1);
    if((diff > 0&&diff2 > 0)||(diff<0&&diff2<0)){printf("0\n");}
    else{
      long long int ct = -diff2 / diff;
      ct *= 2;ct++;
      if(diff2 % diff==0){ct--;}printf("%lld\n",ct);
    }
  }
  return 0;
}
1 2
10 10
12 5
 100 1
111 101
102 1
 100 2
100 101
102 1
 1 1
1 20
12 5
 100 2
100 101
102 0
 1 1
2 20
12 5
 100 2
100 111
102 0
 1 1
0 20
12 5
 30901 15700
2647944172 11366428589
5864465524 4464634034
 1 -2
-2 1
1 3

1
 0
 infinity
 5
 200
 4
 19
 8
 23
 6

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(){
  long long int T1,T2,A1,A2,B1,B2;
  scanf("%lld %lld",&T1,&T2);
  scanf("%lld %lld",&A1,&A2);
  scanf("%lld %lld",&B1,&B2);
  long long int diff = T1*(A1-B1)+T2*(A2-B2);
  if(diff == 0){printf("infinity\n");}
  else{
    long long diff2 = T1*(A1-B1);
    if((diff > 0&&diff2 > 0)||(diff<0&&diff2<0)){printf("0\n");}
    else{
      long long int ct = -diff2 / diff;
      ct *= 2;ct++;
      if(diff2 % diff==0){ct--;}printf("%lld\n",ct);
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"infinity"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\n"
	.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	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-56(%rbp), %rdx
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	movq	-48(%rbp), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	-56(%rbp), %rax
	movq	-40(%rbp), %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	-72(%rbp), %rax
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	jne	.L2
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L2:
	movq	-64(%rbp), %rax
	movq	-48(%rbp), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L4
	cmpq	$0, -16(%rbp)
	jg	.L5
.L4:
	cmpq	$0, -24(%rbp)
	jns	.L6
	cmpq	$0, -16(%rbp)
	jns	.L6
.L5:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L6:
	movq	-16(%rbp), %rax
	negq	%rax
	cqto
	idivq	-24(%rbp)
	movq	%rax, -32(%rbp)
	salq	-32(%rbp)
	addq	$1, -32(%rbp)
	movq	-16(%rbp), %rax
	cqto
	idivq	-24(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L7
	subq	$1, -32(%rbp)
.L7:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L3:
	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	"%lld %lld"
.LC1:
	.string	"infinity"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\n"
	.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	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-56(%rbp), %rdx
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	movq	-48(%rbp), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	-56(%rbp), %rax
	movq	-40(%rbp), %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	-72(%rbp), %rax
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	jne	.L2
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L2:
	movq	-64(%rbp), %rax
	movq	-48(%rbp), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L4
	cmpq	$0, -16(%rbp)
	jg	.L5
.L4:
	cmpq	$0, -24(%rbp)
	jns	.L6
	cmpq	$0, -16(%rbp)
	jns	.L6
.L5:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L6:
	movq	-16(%rbp), %rax
	negq	%rax
	cqto
	idivq	-24(%rbp)
	movq	%rax, -32(%rbp)
	salq	-32(%rbp)
	addq	$1, -32(%rbp)
	movq	-16(%rbp), %rax
	cqto
	idivq	-24(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L7
	subq	$1, -32(%rbp)
.L7:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L3:
	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:
