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 max(int a, int b);
int min(int a, int b);

int main(void){
  int q;
  scanf("%d",&q);

  double x1,y1,x2,y2,x3,y3,x4,y4;
  double x,y;//直線の交点
  double det;//行列式
  double k1,k2;
  int a,b,c,d;
  for(int i=0;i<q;i++){
    scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
    det=(x2-x1)*(y4-y3)-(y2-y1)*(x4-x3);
    if(det==0){//平行
      if(x1*y2-x2*y1!=x3*y4-x4*y3){
        printf("0\n");
        continue;
      }


      if(x2==x1){
        a=min(y1,y2);
        b=max(y1,y2);
        c=min(y3,y4);
        d=max(y3,y4);
      }
      else{
        a=min(x1,x2);
        b=max(x1,x2);
        c=min(x3,x4);
        d=max(x3,x4);
      }

      if(b<c || d<a){
        printf("0\n");
      }
      else{
        printf("1\n");
      }
      continue;
    }
    x=((x3-x4)*(x1*y2-x2*y1)+(x2-x1)*(x3*y4-x4*y3))/det;
    y=((y3-y4)*(x1*y2-x2*y1)+(y2-y1)*(x3*y4-x4*y3))/det;
    if(x1==x2){
      k1=(y-y1)*1.0/(y2-y1);
    }
    else{
      k1=(x-x1)*1.0/(x2-x1);
    }
    if(k1<0 || 1<k1){
      printf("0\n");
      continue;
    }

    if(x3==x4){
      k2=(y-y3)*1.0/(y4-y3);
    }
    else{
      k2=(x-x3)*1.0/(x4-x3);
    }
    if(k2<0 || 1<k2){
      printf("0\n");
      continue;
    }
    printf("1\n");
  }
  return 0;
}

int max(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int min(int a, int b) {
    if (a < b)
        return a;
    else
        return b;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.align 8
.LC1:
	.string	"%lf %lf %lf %lf %lf %lf %lf %lf"
.LC3:
	.string	"0"
.LC4:
	.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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -116(%rbp)
	jmp	.L2
.L26:
	leaq	-80(%rbp), %r8
	leaq	-88(%rbp), %rdi
	leaq	-96(%rbp), %rcx
	leaq	-104(%rbp), %rdx
	leaq	-112(%rbp), %rax
	subq	$8, %rsp
	leaq	-56(%rbp), %rsi
	pushq	%rsi
	leaq	-64(%rbp), %rsi
	pushq	%rsi
	leaq	-72(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$32, %rsp
	movsd	-96(%rbp), %xmm0
	movsd	-112(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	-56(%rbp), %xmm0
	movsd	-72(%rbp), %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm1, %xmm0
	movsd	-88(%rbp), %xmm1
	movsd	-104(%rbp), %xmm3
	movapd	%xmm1, %xmm2
	subsd	%xmm3, %xmm2
	movsd	-64(%rbp), %xmm1
	movsd	-80(%rbp), %xmm3
	subsd	%xmm3, %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	pxor	%xmm0, %xmm0
	ucomisd	-32(%rbp), %xmm0
	jp	.L3
	pxor	%xmm0, %xmm0
	ucomisd	-32(%rbp), %xmm0
	jne	.L3
	movsd	-112(%rbp), %xmm1
	movsd	-88(%rbp), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	-96(%rbp), %xmm2
	movsd	-104(%rbp), %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movsd	-80(%rbp), %xmm2
	movsd	-56(%rbp), %xmm1
	mulsd	%xmm2, %xmm1
	movsd	-64(%rbp), %xmm3
	movsd	-72(%rbp), %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L30
	ucomisd	%xmm1, %xmm0
	je	.L5
.L30:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L5:
	movsd	-96(%rbp), %xmm0
	movsd	-112(%rbp), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	ucomisd	%xmm1, %xmm0
	jne	.L8
	movsd	-88(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-104(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -132(%rbp)
	movsd	-88(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-104(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -128(%rbp)
	movsd	-56(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-72(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -124(%rbp)
	movsd	-56(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-72(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -120(%rbp)
	jmp	.L10
.L8:
	movsd	-96(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-112(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -132(%rbp)
	movsd	-96(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-112(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -128(%rbp)
	movsd	-64(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-80(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -124(%rbp)
	movsd	-64(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-80(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -120(%rbp)
.L10:
	movl	-128(%rbp), %eax
	cmpl	-124(%rbp), %eax
	jl	.L11
	movl	-120(%rbp), %eax
	cmpl	-132(%rbp), %eax
	jge	.L12
.L11:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L12:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L3:
	movsd	-80(%rbp), %xmm0
	movsd	-64(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	-112(%rbp), %xmm2
	movsd	-88(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	movsd	-96(%rbp), %xmm3
	movsd	-104(%rbp), %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-96(%rbp), %xmm0
	movsd	-112(%rbp), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movsd	-80(%rbp), %xmm3
	movsd	-56(%rbp), %xmm0
	mulsd	%xmm3, %xmm0
	movsd	-64(%rbp), %xmm4
	movsd	-72(%rbp), %xmm3
	mulsd	%xmm4, %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	divsd	-32(%rbp), %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-72(%rbp), %xmm0
	movsd	-56(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	-112(%rbp), %xmm2
	movsd	-88(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	movsd	-96(%rbp), %xmm3
	movsd	-104(%rbp), %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-88(%rbp), %xmm0
	movsd	-104(%rbp), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movsd	-80(%rbp), %xmm3
	movsd	-56(%rbp), %xmm0
	mulsd	%xmm3, %xmm0
	movsd	-64(%rbp), %xmm4
	movsd	-72(%rbp), %xmm3
	mulsd	%xmm4, %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	divsd	-32(%rbp), %xmm0
	movsd	%xmm0, -16(%rbp)
	movsd	-112(%rbp), %xmm0
	movsd	-96(%rbp), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L14
	ucomisd	%xmm1, %xmm0
	jne	.L14
	movsd	-104(%rbp), %xmm1
	movsd	-16(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-88(%rbp), %xmm1
	movsd	-104(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
	jmp	.L16
.L14:
	movsd	-112(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-96(%rbp), %xmm1
	movsd	-112(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
.L16:
	pxor	%xmm0, %xmm0
	comisd	-48(%rbp), %xmm0
	ja	.L17
	movsd	-48(%rbp), %xmm0
	movsd	.LC5(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L34
.L17:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L34:
	movsd	-80(%rbp), %xmm0
	movsd	-64(%rbp), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L20
	ucomisd	%xmm1, %xmm0
	jne	.L20
	movsd	-72(%rbp), %xmm1
	movsd	-16(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-56(%rbp), %xmm1
	movsd	-72(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
	jmp	.L22
.L20:
	movsd	-80(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-64(%rbp), %xmm1
	movsd	-80(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
.L22:
	pxor	%xmm0, %xmm0
	comisd	-40(%rbp), %xmm0
	ja	.L23
	movsd	-40(%rbp), %xmm0
	movsd	.LC5(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L35
.L23:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L35:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	addl	$1, -116(%rbp)
.L2:
	movl	-136(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L26
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L37
	movl	-4(%rbp), %eax
	jmp	.L38
.L37:
	movl	-8(%rbp), %eax
.L38:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L40
	movl	-4(%rbp), %eax
	jmp	.L41
.L40:
	movl	-8(%rbp), %eax
.L41:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	min, .-min
	.section	.rodata
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.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"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"%lf %lf %lf %lf %lf %lf %lf %lf"
	.section	.rodata.str1.1
.LC3:
	.string	"0"
.LC4:
	.string	"1"
	.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), %rdi
	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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	96(%rsp), %rax
	xorl	%ebx, %ebx
	leaq	72(%rsp), %r15
	movq	%rax, 24(%rsp)
	leaq	88(%rsp), %rax
	leaq	64(%rsp), %r14
	movq	%rax, 16(%rsp)
	leaq	80(%rsp), %rax
	leaq	56(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	48(%rsp), %r12
	leaq	40(%rsp), %rbp
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L28:
	movapd	%xmm5, %xmm1
	movapd	%xmm3, %xmm2
	movapd	%xmm7, %xmm9
	mulsd	%xmm10, %xmm1
	mulsd	%xmm0, %xmm2
	mulsd	%xmm6, %xmm9
	subsd	%xmm1, %xmm2
	movapd	%xmm8, %xmm1
	mulsd	%xmm4, %xmm1
	subsd	%xmm9, %xmm1
	ucomisd	%xmm1, %xmm2
	jp	.L11
	jne	.L11
	ucomisd	%xmm3, %xmm5
	jp	.L8
	jne	.L8
	cvttsd2sil	%xmm10, %edx
	cvttsd2sil	%xmm0, %eax
	cvttsd2sil	%xmm7, %ecx
	movl	%edx, %esi
	cmpl	%edx, %eax
	cmovle	%eax, %esi
	cmovl	%edx, %eax
	movl	%ecx, %edi
	cvttsd2sil	%xmm8, %edx
	cmpl	%ecx, %edx
	cmovle	%edx, %edi
	cmovl	%ecx, %edx
.L10:
	cmpl	%edi, %eax
	jl	.L11
	cmpl	%edx, %esi
	jg	.L11
.L18:
	leaq	.LC4(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 36(%rsp)
	jle	.L2
.L19:
	subq	$8, %rsp
	.cfi_def_cfa_offset 184
	xorl	%eax, %eax
	movq	%r15, %r9
	movq	%r14, %r8
	pushq	32(%rsp)
	.cfi_def_cfa_offset 192
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 200
	leaq	.LC1(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 208
	call	__isoc99_scanf@PLT
	movsd	88(%rsp), %xmm5
	movsd	96(%rsp), %xmm0
	movsd	72(%rsp), %xmm3
	movsd	80(%rsp), %xmm10
	movsd	120(%rsp), %xmm6
	movapd	%xmm5, %xmm11
	movapd	%xmm0, %xmm12
	movsd	128(%rsp), %xmm8
	movsd	112(%rsp), %xmm7
	movsd	104(%rsp), %xmm4
	subsd	%xmm3, %xmm11
	subsd	%xmm10, %xmm12
	movapd	%xmm8, %xmm14
	movapd	%xmm6, %xmm13
	addq	$32, %rsp
	.cfi_def_cfa_offset 176
	subsd	%xmm7, %xmm14
	subsd	%xmm4, %xmm13
	movapd	%xmm11, %xmm1
	movapd	%xmm12, %xmm2
	mulsd	%xmm13, %xmm2
	mulsd	%xmm14, %xmm1
	subsd	%xmm2, %xmm1
	pxor	%xmm2, %xmm2
	ucomisd	%xmm2, %xmm1
	jp	.L3
	je	.L28
.L3:
	movapd	%xmm5, %xmm2
	movapd	%xmm8, %xmm9
	movapd	%xmm11, %xmm15
	mulsd	%xmm10, %xmm2
	ucomisd	%xmm3, %xmm5
	mulsd	%xmm3, %xmm0
	mulsd	%xmm4, %xmm9
	subsd	%xmm2, %xmm0
	movapd	%xmm7, %xmm2
	mulsd	%xmm6, %xmm2
	subsd	%xmm2, %xmm9
	movapd	%xmm4, %xmm2
	subsd	%xmm6, %xmm2
	mulsd	%xmm9, %xmm15
	mulsd	%xmm0, %xmm2
	mulsd	%xmm12, %xmm9
	addsd	%xmm15, %xmm2
	movapd	%xmm7, %xmm15
	subsd	%xmm8, %xmm15
	divsd	%xmm1, %xmm2
	mulsd	%xmm15, %xmm0
	addsd	%xmm9, %xmm0
	divsd	%xmm1, %xmm0
	jp	.L12
	jne	.L12
	movapd	%xmm0, %xmm1
	subsd	%xmm10, %xmm1
	divsd	%xmm12, %xmm1
.L14:
	pxor	%xmm5, %xmm5
	comisd	%xmm1, %xmm5
	ja	.L11
	comisd	.LC5(%rip), %xmm1
	ja	.L11
	ucomisd	%xmm4, %xmm6
	jp	.L15
	jne	.L15
	subsd	%xmm7, %xmm0
	divsd	%xmm14, %xmm0
	movapd	%xmm0, %xmm2
.L17:
	pxor	%xmm7, %xmm7
	comisd	%xmm2, %xmm7
	ja	.L11
	comisd	.LC5(%rip), %xmm2
	jbe	.L18
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	.LC3(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 36(%rsp)
	jg	.L19
.L2:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$120, %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
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	movapd	%xmm2, %xmm1
	subsd	%xmm3, %xmm1
	divsd	%xmm11, %xmm1
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L8:
	cvttsd2sil	%xmm3, %edx
	cvttsd2sil	%xmm5, %eax
	cvttsd2sil	%xmm4, %ecx
	movl	%edx, %esi
	cmpl	%edx, %eax
	cmovle	%eax, %esi
	cmovl	%edx, %eax
	movl	%ecx, %edi
	cvttsd2sil	%xmm6, %edx
	cmpl	%ecx, %edx
	cmovle	%edx, %edi
	cmovl	%ecx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	subsd	%xmm4, %xmm2
	divsd	%xmm13, %xmm2
	jmp	.L17
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB25:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	min, .-min
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.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"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"%lf %lf %lf %lf %lf %lf %lf %lf"
	.section	.rodata.str1.1
.LC3:
	.string	"0"
.LC4:
	.string	"1"
	.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), %rdi
	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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	96(%rsp), %rax
	xorl	%ebx, %ebx
	leaq	72(%rsp), %r15
	movq	%rax, 24(%rsp)
	leaq	88(%rsp), %rax
	leaq	64(%rsp), %r14
	movq	%rax, 16(%rsp)
	leaq	80(%rsp), %rax
	leaq	56(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	48(%rsp), %r12
	leaq	40(%rsp), %rbp
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L28:
	movapd	%xmm5, %xmm1
	movapd	%xmm3, %xmm2
	movapd	%xmm7, %xmm9
	mulsd	%xmm10, %xmm1
	mulsd	%xmm0, %xmm2
	mulsd	%xmm6, %xmm9
	subsd	%xmm1, %xmm2
	movapd	%xmm8, %xmm1
	mulsd	%xmm4, %xmm1
	subsd	%xmm9, %xmm1
	ucomisd	%xmm1, %xmm2
	jp	.L11
	jne	.L11
	ucomisd	%xmm3, %xmm5
	jp	.L8
	jne	.L8
	cvttsd2sil	%xmm10, %edx
	cvttsd2sil	%xmm0, %eax
	cvttsd2sil	%xmm7, %ecx
	movl	%edx, %esi
	cmpl	%edx, %eax
	cmovle	%eax, %esi
	cmovl	%edx, %eax
	movl	%ecx, %edi
	cvttsd2sil	%xmm8, %edx
	cmpl	%ecx, %edx
	cmovle	%edx, %edi
	cmovl	%ecx, %edx
.L10:
	cmpl	%edi, %eax
	jl	.L11
	cmpl	%edx, %esi
	jg	.L11
.L18:
	leaq	.LC4(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 36(%rsp)
	jle	.L2
.L19:
	subq	$8, %rsp
	.cfi_def_cfa_offset 184
	xorl	%eax, %eax
	movq	%r15, %r9
	movq	%r14, %r8
	pushq	32(%rsp)
	.cfi_def_cfa_offset 192
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 200
	leaq	.LC1(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 208
	call	__isoc99_scanf@PLT
	movsd	88(%rsp), %xmm5
	movsd	96(%rsp), %xmm0
	movsd	72(%rsp), %xmm3
	movsd	80(%rsp), %xmm10
	movsd	120(%rsp), %xmm6
	movapd	%xmm5, %xmm11
	movapd	%xmm0, %xmm12
	movsd	128(%rsp), %xmm8
	movsd	112(%rsp), %xmm7
	movsd	104(%rsp), %xmm4
	subsd	%xmm3, %xmm11
	subsd	%xmm10, %xmm12
	movapd	%xmm8, %xmm14
	movapd	%xmm6, %xmm13
	addq	$32, %rsp
	.cfi_def_cfa_offset 176
	subsd	%xmm7, %xmm14
	subsd	%xmm4, %xmm13
	movapd	%xmm11, %xmm1
	movapd	%xmm12, %xmm2
	mulsd	%xmm13, %xmm2
	mulsd	%xmm14, %xmm1
	subsd	%xmm2, %xmm1
	pxor	%xmm2, %xmm2
	ucomisd	%xmm2, %xmm1
	jp	.L3
	je	.L28
.L3:
	movapd	%xmm5, %xmm2
	movapd	%xmm8, %xmm9
	movapd	%xmm11, %xmm15
	mulsd	%xmm10, %xmm2
	ucomisd	%xmm3, %xmm5
	mulsd	%xmm3, %xmm0
	mulsd	%xmm4, %xmm9
	subsd	%xmm2, %xmm0
	movapd	%xmm7, %xmm2
	mulsd	%xmm6, %xmm2
	subsd	%xmm2, %xmm9
	movapd	%xmm4, %xmm2
	subsd	%xmm6, %xmm2
	mulsd	%xmm9, %xmm15
	mulsd	%xmm0, %xmm2
	mulsd	%xmm12, %xmm9
	addsd	%xmm15, %xmm2
	movapd	%xmm7, %xmm15
	subsd	%xmm8, %xmm15
	divsd	%xmm1, %xmm2
	mulsd	%xmm15, %xmm0
	addsd	%xmm9, %xmm0
	divsd	%xmm1, %xmm0
	jp	.L12
	jne	.L12
	movapd	%xmm0, %xmm1
	subsd	%xmm10, %xmm1
	divsd	%xmm12, %xmm1
.L14:
	pxor	%xmm5, %xmm5
	comisd	%xmm1, %xmm5
	ja	.L11
	comisd	.LC5(%rip), %xmm1
	ja	.L11
	ucomisd	%xmm4, %xmm6
	jp	.L15
	jne	.L15
	subsd	%xmm7, %xmm0
	divsd	%xmm14, %xmm0
	movapd	%xmm0, %xmm2
.L17:
	pxor	%xmm7, %xmm7
	comisd	%xmm2, %xmm7
	ja	.L11
	comisd	.LC5(%rip), %xmm2
	jbe	.L18
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	.LC3(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 36(%rsp)
	jg	.L19
.L2:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$120, %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
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	movapd	%xmm2, %xmm1
	subsd	%xmm3, %xmm1
	divsd	%xmm11, %xmm1
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L8:
	cvttsd2sil	%xmm3, %edx
	cvttsd2sil	%xmm5, %eax
	cvttsd2sil	%xmm4, %ecx
	movl	%edx, %esi
	cmpl	%edx, %eax
	cmovle	%eax, %esi
	cmovl	%edx, %eax
	movl	%ecx, %edi
	cvttsd2sil	%xmm6, %edx
	cmpl	%ecx, %edx
	cmovle	%edx, %edi
	cmovl	%ecx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	subsd	%xmm4, %xmm2
	divsd	%xmm13, %xmm2
	jmp	.L17
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB25:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	min, .-min
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.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 max(int a, int b);
int min(int a, int b);

int main(void){
  int q;
  scanf("%d",&q);

  double x1,y1,x2,y2,x3,y3,x4,y4;
  double x,y;//直線の交点
  double det;//行列式
  double k1,k2;
  int a,b,c,d;
  for(int i=0;i<q;i++){
    scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
    det=(x2-x1)*(y4-y3)-(y2-y1)*(x4-x3);
    if(det==0){//平行
      if(x1*y2-x2*y1!=x3*y4-x4*y3){
        printf("0\n");
        continue;
      }


      if(x2==x1){
        a=min(y1,y2);
        b=max(y1,y2);
        c=min(y3,y4);
        d=max(y3,y4);
      }
      else{
        a=min(x1,x2);
        b=max(x1,x2);
        c=min(x3,x4);
        d=max(x3,x4);
      }

      if(b<c || d<a){
        printf("0\n");
      }
      else{
        printf("1\n");
      }
      continue;
    }
    x=((x3-x4)*(x1*y2-x2*y1)+(x2-x1)*(x3*y4-x4*y3))/det;
    y=((y3-y4)*(x1*y2-x2*y1)+(y2-y1)*(x3*y4-x4*y3))/det;
    if(x1==x2){
      k1=(y-y1)*1.0/(y2-y1);
    }
    else{
      k1=(x-x1)*1.0/(x2-x1);
    }
    if(k1<0 || 1<k1){
      printf("0\n");
      continue;
    }

    if(x3==x4){
      k2=(y-y3)*1.0/(y4-y3);
    }
    else{
      k2=(x-x3)*1.0/(x4-x3);
    }
    if(k2<0 || 1<k2){
      printf("0\n");
      continue;
    }
    printf("1\n");
  }
  return 0;
}

int max(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int min(int a, int b) {
    if (a < b)
        return a;
    else
        return b;
}


3
0 0 3 0 1 1 2 -1
0 0 3 0 3 1 3 -1
0 0 6 0 3 -2 5 0
 3
0 0 3 0 1 1 2 -1
0 0 0 0 3 1 3 -1
0 0 6 0 1 -2 5 0
 3
-1 0 3 0 1 1 4 -1
1 0 0 0 3 1 3 -1
0 0 6 1 1 -2 5 0
 3
-1 0 3 0 1 1 4 0
1 0 0 0 3 1 3 -1
0 -1 6 1 1 -2 5 0
 3
-1 0 0 -1 2 1 4 -2
1 0 0 0 4 1 6 -1
0 -1 12 1 0 -2 5 0
 3
1 0 3 0 1 1 0 -1
0 0 3 0 3 1 3 -1
0 0 6 0 2 -4 5 0
 3
0 -1 3 0 1 1 2 -1
0 0 4 0 3 1 3 -1
1 -1 1 0 3 -4 5 0
 3
-1 -1 4 0 2 1 4 1
2 1 0 0 0 0 3 0
0 2 6 2 1 -2 5 0
 3
0 0 3 0 1 1 2 -1
0 0 3 0 3 1 3 -1
0 0 6 0 1 -2 5 0
 3
-1 0 3 0 1 1 2 -1
0 0 0 0 3 1 3 -1
0 0 6 0 1 -2 5 0

1
1
1
 1
0
1
 1
0
0
 0
0
0
 0
0
1
 0
1
1
 1
1
0
 0
1
0
 1
1
1
 1
0
1

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 max(int a, int b);
int min(int a, int b);

int main(void){
  int q;
  scanf("%d",&q);

  double x1,y1,x2,y2,x3,y3,x4,y4;
  double x,y;//直線の交点
  double det;//行列式
  double k1,k2;
  int a,b,c,d;
  for(int i=0;i<q;i++){
    scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
    det=(x2-x1)*(y4-y3)-(y2-y1)*(x4-x3);
    if(det==0){//平行
      if(x1*y2-x2*y1!=x3*y4-x4*y3){
        printf("0\n");
        continue;
      }


      if(x2==x1){
        a=min(y1,y2);
        b=max(y1,y2);
        c=min(y3,y4);
        d=max(y3,y4);
      }
      else{
        a=min(x1,x2);
        b=max(x1,x2);
        c=min(x3,x4);
        d=max(x3,x4);
      }

      if(b<c || d<a){
        printf("0\n");
      }
      else{
        printf("1\n");
      }
      continue;
    }
    x=((x3-x4)*(x1*y2-x2*y1)+(x2-x1)*(x3*y4-x4*y3))/det;
    y=((y3-y4)*(x1*y2-x2*y1)+(y2-y1)*(x3*y4-x4*y3))/det;
    if(x1==x2){
      k1=(y-y1)*1.0/(y2-y1);
    }
    else{
      k1=(x-x1)*1.0/(x2-x1);
    }
    if(k1<0 || 1<k1){
      printf("0\n");
      continue;
    }

    if(x3==x4){
      k2=(y-y3)*1.0/(y4-y3);
    }
    else{
      k2=(x-x3)*1.0/(x4-x3);
    }
    if(k2<0 || 1<k2){
      printf("0\n");
      continue;
    }
    printf("1\n");
  }
  return 0;
}

int max(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int min(int a, int b) {
    if (a < b)
        return a;
    else
        return b;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.align 8
.LC1:
	.string	"%lf %lf %lf %lf %lf %lf %lf %lf"
.LC3:
	.string	"0"
.LC4:
	.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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -116(%rbp)
	jmp	.L2
.L26:
	leaq	-80(%rbp), %r8
	leaq	-88(%rbp), %rdi
	leaq	-96(%rbp), %rcx
	leaq	-104(%rbp), %rdx
	leaq	-112(%rbp), %rax
	subq	$8, %rsp
	leaq	-56(%rbp), %rsi
	pushq	%rsi
	leaq	-64(%rbp), %rsi
	pushq	%rsi
	leaq	-72(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$32, %rsp
	movsd	-96(%rbp), %xmm0
	movsd	-112(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	-56(%rbp), %xmm0
	movsd	-72(%rbp), %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm1, %xmm0
	movsd	-88(%rbp), %xmm1
	movsd	-104(%rbp), %xmm3
	movapd	%xmm1, %xmm2
	subsd	%xmm3, %xmm2
	movsd	-64(%rbp), %xmm1
	movsd	-80(%rbp), %xmm3
	subsd	%xmm3, %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	pxor	%xmm0, %xmm0
	ucomisd	-32(%rbp), %xmm0
	jp	.L3
	pxor	%xmm0, %xmm0
	ucomisd	-32(%rbp), %xmm0
	jne	.L3
	movsd	-112(%rbp), %xmm1
	movsd	-88(%rbp), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	-96(%rbp), %xmm2
	movsd	-104(%rbp), %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movsd	-80(%rbp), %xmm2
	movsd	-56(%rbp), %xmm1
	mulsd	%xmm2, %xmm1
	movsd	-64(%rbp), %xmm3
	movsd	-72(%rbp), %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L30
	ucomisd	%xmm1, %xmm0
	je	.L5
.L30:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L5:
	movsd	-96(%rbp), %xmm0
	movsd	-112(%rbp), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	ucomisd	%xmm1, %xmm0
	jne	.L8
	movsd	-88(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-104(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -132(%rbp)
	movsd	-88(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-104(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -128(%rbp)
	movsd	-56(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-72(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -124(%rbp)
	movsd	-56(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-72(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -120(%rbp)
	jmp	.L10
.L8:
	movsd	-96(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-112(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -132(%rbp)
	movsd	-96(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-112(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -128(%rbp)
	movsd	-64(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-80(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -124(%rbp)
	movsd	-64(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-80(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -120(%rbp)
.L10:
	movl	-128(%rbp), %eax
	cmpl	-124(%rbp), %eax
	jl	.L11
	movl	-120(%rbp), %eax
	cmpl	-132(%rbp), %eax
	jge	.L12
.L11:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L12:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L3:
	movsd	-80(%rbp), %xmm0
	movsd	-64(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	-112(%rbp), %xmm2
	movsd	-88(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	movsd	-96(%rbp), %xmm3
	movsd	-104(%rbp), %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-96(%rbp), %xmm0
	movsd	-112(%rbp), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movsd	-80(%rbp), %xmm3
	movsd	-56(%rbp), %xmm0
	mulsd	%xmm3, %xmm0
	movsd	-64(%rbp), %xmm4
	movsd	-72(%rbp), %xmm3
	mulsd	%xmm4, %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	divsd	-32(%rbp), %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-72(%rbp), %xmm0
	movsd	-56(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	-112(%rbp), %xmm2
	movsd	-88(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	movsd	-96(%rbp), %xmm3
	movsd	-104(%rbp), %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-88(%rbp), %xmm0
	movsd	-104(%rbp), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movsd	-80(%rbp), %xmm3
	movsd	-56(%rbp), %xmm0
	mulsd	%xmm3, %xmm0
	movsd	-64(%rbp), %xmm4
	movsd	-72(%rbp), %xmm3
	mulsd	%xmm4, %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	divsd	-32(%rbp), %xmm0
	movsd	%xmm0, -16(%rbp)
	movsd	-112(%rbp), %xmm0
	movsd	-96(%rbp), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L14
	ucomisd	%xmm1, %xmm0
	jne	.L14
	movsd	-104(%rbp), %xmm1
	movsd	-16(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-88(%rbp), %xmm1
	movsd	-104(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
	jmp	.L16
.L14:
	movsd	-112(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-96(%rbp), %xmm1
	movsd	-112(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
.L16:
	pxor	%xmm0, %xmm0
	comisd	-48(%rbp), %xmm0
	ja	.L17
	movsd	-48(%rbp), %xmm0
	movsd	.LC5(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L34
.L17:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L34:
	movsd	-80(%rbp), %xmm0
	movsd	-64(%rbp), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L20
	ucomisd	%xmm1, %xmm0
	jne	.L20
	movsd	-72(%rbp), %xmm1
	movsd	-16(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-56(%rbp), %xmm1
	movsd	-72(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
	jmp	.L22
.L20:
	movsd	-80(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-64(%rbp), %xmm1
	movsd	-80(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
.L22:
	pxor	%xmm0, %xmm0
	comisd	-40(%rbp), %xmm0
	ja	.L23
	movsd	-40(%rbp), %xmm0
	movsd	.LC5(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L35
.L23:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L35:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	addl	$1, -116(%rbp)
.L2:
	movl	-136(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L26
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L37
	movl	-4(%rbp), %eax
	jmp	.L38
.L37:
	movl	-8(%rbp), %eax
.L38:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L40
	movl	-4(%rbp), %eax
	jmp	.L41
.L40:
	movl	-8(%rbp), %eax
.L41:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	min, .-min
	.section	.rodata
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.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"
	.align 8
.LC1:
	.string	"%lf %lf %lf %lf %lf %lf %lf %lf"
.LC3:
	.string	"0"
.LC4:
	.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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -116(%rbp)
	jmp	.L2
.L26:
	leaq	-80(%rbp), %r8
	leaq	-88(%rbp), %rdi
	leaq	-96(%rbp), %rcx
	leaq	-104(%rbp), %rdx
	leaq	-112(%rbp), %rax
	subq	$8, %rsp
	leaq	-56(%rbp), %rsi
	pushq	%rsi
	leaq	-64(%rbp), %rsi
	pushq	%rsi
	leaq	-72(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$32, %rsp
	movsd	-96(%rbp), %xmm0
	movsd	-112(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	-56(%rbp), %xmm0
	movsd	-72(%rbp), %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm1, %xmm0
	movsd	-88(%rbp), %xmm1
	movsd	-104(%rbp), %xmm3
	movapd	%xmm1, %xmm2
	subsd	%xmm3, %xmm2
	movsd	-64(%rbp), %xmm1
	movsd	-80(%rbp), %xmm3
	subsd	%xmm3, %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	pxor	%xmm0, %xmm0
	ucomisd	-32(%rbp), %xmm0
	jp	.L3
	pxor	%xmm0, %xmm0
	ucomisd	-32(%rbp), %xmm0
	jne	.L3
	movsd	-112(%rbp), %xmm1
	movsd	-88(%rbp), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	-96(%rbp), %xmm2
	movsd	-104(%rbp), %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movsd	-80(%rbp), %xmm2
	movsd	-56(%rbp), %xmm1
	mulsd	%xmm2, %xmm1
	movsd	-64(%rbp), %xmm3
	movsd	-72(%rbp), %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L30
	ucomisd	%xmm1, %xmm0
	je	.L5
.L30:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L5:
	movsd	-96(%rbp), %xmm0
	movsd	-112(%rbp), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	ucomisd	%xmm1, %xmm0
	jne	.L8
	movsd	-88(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-104(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -132(%rbp)
	movsd	-88(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-104(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -128(%rbp)
	movsd	-56(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-72(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -124(%rbp)
	movsd	-56(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-72(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -120(%rbp)
	jmp	.L10
.L8:
	movsd	-96(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-112(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -132(%rbp)
	movsd	-96(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-112(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -128(%rbp)
	movsd	-64(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-80(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -124(%rbp)
	movsd	-64(%rbp), %xmm0
	cvttsd2sil	%xmm0, %edx
	movsd	-80(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -120(%rbp)
.L10:
	movl	-128(%rbp), %eax
	cmpl	-124(%rbp), %eax
	jl	.L11
	movl	-120(%rbp), %eax
	cmpl	-132(%rbp), %eax
	jge	.L12
.L11:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L12:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L3:
	movsd	-80(%rbp), %xmm0
	movsd	-64(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	-112(%rbp), %xmm2
	movsd	-88(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	movsd	-96(%rbp), %xmm3
	movsd	-104(%rbp), %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-96(%rbp), %xmm0
	movsd	-112(%rbp), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movsd	-80(%rbp), %xmm3
	movsd	-56(%rbp), %xmm0
	mulsd	%xmm3, %xmm0
	movsd	-64(%rbp), %xmm4
	movsd	-72(%rbp), %xmm3
	mulsd	%xmm4, %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	divsd	-32(%rbp), %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-72(%rbp), %xmm0
	movsd	-56(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	-112(%rbp), %xmm2
	movsd	-88(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	movsd	-96(%rbp), %xmm3
	movsd	-104(%rbp), %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-88(%rbp), %xmm0
	movsd	-104(%rbp), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movsd	-80(%rbp), %xmm3
	movsd	-56(%rbp), %xmm0
	mulsd	%xmm3, %xmm0
	movsd	-64(%rbp), %xmm4
	movsd	-72(%rbp), %xmm3
	mulsd	%xmm4, %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	divsd	-32(%rbp), %xmm0
	movsd	%xmm0, -16(%rbp)
	movsd	-112(%rbp), %xmm0
	movsd	-96(%rbp), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L14
	ucomisd	%xmm1, %xmm0
	jne	.L14
	movsd	-104(%rbp), %xmm1
	movsd	-16(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-88(%rbp), %xmm1
	movsd	-104(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
	jmp	.L16
.L14:
	movsd	-112(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-96(%rbp), %xmm1
	movsd	-112(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
.L16:
	pxor	%xmm0, %xmm0
	comisd	-48(%rbp), %xmm0
	ja	.L17
	movsd	-48(%rbp), %xmm0
	movsd	.LC5(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L34
.L17:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L34:
	movsd	-80(%rbp), %xmm0
	movsd	-64(%rbp), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L20
	ucomisd	%xmm1, %xmm0
	jne	.L20
	movsd	-72(%rbp), %xmm1
	movsd	-16(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-56(%rbp), %xmm1
	movsd	-72(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
	jmp	.L22
.L20:
	movsd	-80(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	-64(%rbp), %xmm1
	movsd	-80(%rbp), %xmm2
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
.L22:
	pxor	%xmm0, %xmm0
	comisd	-40(%rbp), %xmm0
	ja	.L23
	movsd	-40(%rbp), %xmm0
	movsd	.LC5(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L35
.L23:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L35:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	addl	$1, -116(%rbp)
.L2:
	movl	-136(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L26
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L37
	movl	-4(%rbp), %eax
	jmp	.L38
.L37:
	movl	-8(%rbp), %eax
.L38:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L40
	movl	-4(%rbp), %eax
	jmp	.L41
.L40:
	movl	-8(%rbp), %eax
.L41:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	min, .-min
	.section	.rodata
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.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:
