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>
#include<stdlib.h>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef struct point2d{
  int64 x,y;
} point;

typedef struct line2d{
  point s,t;
} line;

void swap(int64 *a,int64 *b){
  int64 tmp=*a;
  *a=*b;
  *b=tmp;
}

int func(const line *a,const point *b){
  int64 p=a->s.x;
  int64 q=a->s.y;
  int64 r=a->t.x;
  int64 s=a->t.y;
  int64 t=(s-q)*(b->x-p)-(r-p)*(b->y-q);
  return t==0?0:(t>0?1:-1);
}

int isIntersect(const line *a,const line *b){
  int p=func(a,&(b->s));
  int q=func(a,&(b->t));
  int r=func(b,&(a->s));
  int s=func(b,&(a->t));
  if(p==0 && q==0 && r==0 && s==0){//同一直線上に2つの線分有り
    if(a->s.x!=a->t.x){
      int64 p=a->s.x;
      int64 q=a->t.x;
      int64 r=b->s.x;
      int64 s=b->t.x;
      if(p>q) swap(&p,&q);
      if(r>s) swap(&r,&s);
      return !(p>s || r>q);
    } else {
      int64 p=a->s.y;
      int64 q=a->t.y;
      int64 r=b->s.y;
      int64 s=b->t.y;
      if(p>q) swap(&p,&q);
      if(r>s) swap(&r,&s);
      return !(p>s || r>q);
    }
  }
  return p*q<=0 && r*s<=0;
}

void scanfLine(line *a){
  scanf("%lld%lld%lld%lld",&(a->s.x),&(a->s.y),&(a->t.x),&(a->t.y));
  return;
}

void run(void){
  int q;
  scanf("%d",&q);
  while(q--){
    line a,b;
    scanfLine(&a);
    scanfLine(&b);
    int ans=isIntersect(&a,&b);
    printf("%d\n",ans);
  }
  return;
}

int main(void){
  run();
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	func
	.type	func, @function
func:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -56(%rbp)
	movq	%rsi, -64(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-56(%rbp), %rax
	movq	24(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	subq	-32(%rbp), %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	movq	(%rax), %rax
	subq	-40(%rbp), %rax
	imulq	%rax, %rdx
	movq	-24(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, %rcx
	movq	-64(%rbp), %rax
	movq	8(%rax), %rax
	subq	-32(%rbp), %rax
	imulq	%rax, %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L3
	cmpq	$0, -8(%rbp)
	jle	.L4
	movl	$1, %eax
	jmp	.L7
.L4:
	movl	$-1, %eax
	jmp	.L7
.L3:
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	func, .-func
	.globl	isIntersect
	.type	isIntersect, @function
isIntersect:
.LFB8:
	.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	%rdi, -72(%rbp)
	movq	%rsi, -80(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-80(%rbp), %rdx
	movq	-72(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -56(%rbp)
	movq	-80(%rbp), %rax
	leaq	16(%rax), %rdx
	movq	-72(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -52(%rbp)
	movq	-72(%rbp), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -48(%rbp)
	movq	-72(%rbp), %rax
	leaq	16(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -44(%rbp)
	cmpl	$0, -56(%rbp)
	jne	.L9
	cmpl	$0, -52(%rbp)
	jne	.L9
	cmpl	$0, -48(%rbp)
	jne	.L9
	cmpl	$0, -44(%rbp)
	jne	.L9
	movq	-72(%rbp), %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	movq	16(%rax), %rax
	cmpq	%rax, %rdx
	je	.L10
	movq	-72(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-80(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L11
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L11:
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L12
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L12:
	movq	-40(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L13
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L13
	movl	$1, %eax
	jmp	.L15
.L13:
	movl	$0, %eax
	jmp	.L15
.L10:
	movq	-72(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	movq	24(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-80(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-80(%rbp), %rax
	movq	24(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L16
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L16:
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L17
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L17:
	movq	-40(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L18
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L18
	movl	$1, %eax
	jmp	.L15
.L18:
	movl	$0, %eax
	jmp	.L15
.L9:
	movl	-56(%rbp), %eax
	imull	-52(%rbp), %eax
	testl	%eax, %eax
	jg	.L20
	movl	-48(%rbp), %eax
	imull	-44(%rbp), %eax
	testl	%eax, %eax
	jg	.L20
	movl	$1, %eax
	jmp	.L15
.L20:
	movl	$0, %eax
.L15:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	isIntersect, .-isIntersect
	.section	.rodata
.LC0:
	.string	"%lld%lld%lld%lld"
	.text
	.globl	scanfLine
	.type	scanfLine, @function
scanfLine:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	leaq	24(%rax), %rsi
	movq	-8(%rbp), %rax
	leaq	16(%rax), %rcx
	movq	-8(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	scanfLine, .-scanfLine
	.section	.rodata
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L26
.L27:
	leaq	-80(%rbp), %rax
	movq	%rax, %rdi
	call	scanfLine
	leaq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	scanfLine
	leaq	-48(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	isIntersect
	movl	%eax, -84(%rbp)
	movl	-84(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L26:
	movl	-88(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -88(%rbp)
	testl	%eax, %eax
	jne	.L27
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	movq	(%rsi), %rdx
	movq	%rdx, (%rdi)
	movq	%rax, (%rsi)
	ret
	.cfi_endproc
.LFE39:
	.size	swap, .-swap
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB40:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rcx
	movq	8(%rdi), %r8
	movq	24(%rdi), %rax
	movq	(%rsi), %rdx
	subq	%r8, %rax
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	movq	16(%rdi), %rdx
	subq	%rcx, %rdx
	movq	8(%rsi), %rcx
	subq	%r8, %rcx
	xorl	%r8d, %r8d
	imulq	%rcx, %rdx
	subq	%rdx, %rax
	testq	%rax, %rax
	je	.L3
	setg	%r8b
	movzbl	%r8b, %r8d
	leal	-1(%r8,%r8), %r8d
.L3:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE40:
	.size	func, .-func
	.p2align 4
	.globl	isIntersect
	.type	isIntersect, @function
isIntersect:
.LFB41:
	.cfi_startproc
	endbr64
	movq	%rsi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	(%rdi), %rdx
	xorl	%ebx, %ebx
	movq	8(%rdi), %r8
	movq	16(%rdi), %r9
	movq	24(%rdi), %r11
	movq	(%rsi), %rsi
	movq	8(%rax), %rdi
	movq	%r9, %r12
	movq	%r11, %r13
	movq	%rsi, %rcx
	subq	%rdx, %r12
	movq	%rdi, %r10
	subq	%r8, %r13
	subq	%rdx, %rcx
	subq	%r8, %r10
	imulq	%r13, %rcx
	imulq	%r12, %r10
	subq	%r10, %rcx
	testq	%rcx, %rcx
	je	.L9
	setg	%bl
	movzbl	%bl, %ebx
	leal	-1(%rbx,%rbx), %ebx
.L9:
	movq	24(%rax), %rbp
	movq	16(%rax), %r10
	movq	%rbp, %rcx
	movq	%r10, %rax
	subq	%rdx, %rax
	subq	%r8, %rcx
	imulq	%r12, %rcx
	xorl	%r12d, %r12d
	imulq	%r13, %rax
	subq	%rcx, %rax
	testq	%rax, %rax
	je	.L10
	setg	%r12b
	movzbl	%r12b, %r12d
	leal	-1(%r12,%r12), %r12d
.L10:
	movq	%rbp, %r13
	movq	%r10, %r14
	movq	%rdx, %rcx
	movq	%r8, %rax
	subq	%rdi, %r13
	subq	%rsi, %r14
	subq	%rsi, %rcx
	subq	%rdi, %rax
	imulq	%r13, %rcx
	imulq	%r14, %rax
	subq	%rax, %rcx
	movq	%r9, %rax
	subq	%rsi, %rax
	imulq	%r13, %rax
	movq	%r11, %r13
	subq	%rdi, %r13
	imulq	%r14, %r13
	subq	%r13, %rax
	testq	%rcx, %rcx
	je	.L11
	jle	.L36
	testq	%rax, %rax
	je	.L25
	movl	$0, %eax
	jle	.L25
.L8:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	testq	%rax, %rax
	jne	.L25
	movl	%r12d, %eax
	orl	%ebx, %eax
	jne	.L25
	cmpq	%r9, %rdx
	je	.L18
	jle	.L19
	movq	%rdx, %rax
	movq	%r9, %rdx
	movq	%rax, %r9
.L19:
	cmpq	%rsi, %r10
	jge	.L20
	movq	%rsi, %rax
	movq	%r10, %rsi
	movq	%rax, %r10
.L20:
	cmpq	%r10, %rdx
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	setle	%dl
	xorl	%eax, %eax
	cmpq	%rsi, %r9
	popq	%r12
	.cfi_def_cfa_offset 24
	setge	%al
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	andl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	testq	%rax, %rax
	je	.L25
	jle	.L37
.L25:
	imull	%ebx, %r12d
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	cmpl	$1, %r12d
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	setne	%al
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	cmpq	%r11, %r8
	jle	.L21
	movq	%r8, %rax
	movq	%r11, %r8
	movq	%rax, %r11
.L21:
	cmpq	%rdi, %rbp
	jge	.L22
	movq	%rdi, %rax
	movq	%rbp, %rdi
	movq	%rax, %rbp
.L22:
	cmpq	%rdi, %r11
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	setge	%dl
	xorl	%eax, %eax
	cmpq	%rbp, %r8
	popq	%rbp
	.cfi_def_cfa_offset 32
	setle	%al
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	andl	%edx, %eax
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L8
	.cfi_endproc
.LFE41:
	.size	isIntersect, .-isIntersect
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld%lld%lld"
	.text
	.p2align 4
	.globl	scanfLine
	.type	scanfLine, @function
scanfLine:
.LFB42:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	16(%rdi), %rcx
	leaq	8(%rdi), %rdx
	xorl	%eax, %eax
	leaq	24(%rdi), %r8
	leaq	.LC0(%rip), %rdi
	jmp	__isoc99_scanf@PLT
	.cfi_endproc
.LFE42:
	.size	scanfLine, .-scanfLine
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 76(%rsp)
	testl	%eax, %eax
	je	.L39
	leaq	80(%rsp), %rax
	leaq	.LC0(%rip), %rbx
	movq	%rax, 32(%rsp)
	leaq	104(%rsp), %rax
	movq	%rax, 56(%rsp)
	leaq	96(%rsp), %rax
	movq	%rax, 48(%rsp)
	leaq	88(%rsp), %rax
	movq	%rax, 40(%rsp)
	leaq	112(%rsp), %rax
	movq	%rax, (%rsp)
	leaq	136(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	128(%rsp), %rax
	movq	%rax, 16(%rsp)
	leaq	120(%rsp), %rax
	movq	%rax, 8(%rsp)
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L72:
	jle	.L71
	testq	%rcx, %rcx
	je	.L58
	movl	$0, %edx
	jle	.L57
	.p2align 4,,10
	.p2align 3
.L48:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	76(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 76(%rsp)
	testl	%eax, %eax
	je	.L39
.L40:
	movq	56(%rsp), %r8
	movq	48(%rsp), %rcx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %r8
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	movq	16(%rsp), %rcx
	movq	8(%rsp), %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movq	96(%rsp), %r9
	movq	104(%rsp), %r12
	xorl	%r11d, %r11d
	movq	112(%rsp), %rsi
	movq	120(%rsp), %r8
	movq	80(%rsp), %rax
	movq	88(%rsp), %rdi
	movq	%r12, %rcx
	movq	%r9, %r13
	movq	%rsi, %rdx
	movq	%r8, %r10
	subq	%rdi, %rcx
	subq	%rax, %r13
	subq	%rax, %rdx
	subq	%rdi, %r10
	imulq	%rcx, %rdx
	imulq	%r13, %r10
	subq	%r10, %rdx
	testq	%rdx, %rdx
	je	.L41
	setg	%r11b
	movzbl	%r11b, %r11d
	leal	-1(%r11,%r11), %r11d
.L41:
	movq	128(%rsp), %r10
	movq	136(%rsp), %rbp
	movq	%r10, %rdx
	subq	%rax, %rdx
	imulq	%rcx, %rdx
	movq	%rbp, %rcx
	subq	%rdi, %rcx
	imulq	%r13, %rcx
	xorl	%r13d, %r13d
	subq	%rcx, %rdx
	testq	%rdx, %rdx
	je	.L42
	setg	%r13b
	movzbl	%r13b, %r13d
	leal	-1(%r13,%r13), %r13d
.L42:
	movq	%rbp, %r15
	movq	%r10, %r14
	movq	%rax, %rdx
	movq	%rdi, %rcx
	subq	%r8, %r15
	subq	%rsi, %r14
	subq	%rsi, %rdx
	subq	%r8, %rcx
	imulq	%r15, %rdx
	imulq	%r14, %rcx
	subq	%rcx, %rdx
	movq	%r9, %rcx
	subq	%rsi, %rcx
	imulq	%r15, %rcx
	movq	%r12, %r15
	subq	%r8, %r15
	imulq	%r14, %r15
	subq	%r15, %rcx
	testq	%rdx, %rdx
	jne	.L72
	testq	%rcx, %rcx
	jne	.L57
	movl	%r13d, %ecx
	orl	%r11d, %ecx
	jne	.L57
	cmpq	%r9, %rax
	je	.L50
	jle	.L51
	movq	%rax, %rdx
	movq	%r9, %rax
	movq	%rdx, %r9
.L51:
	cmpq	%r10, %rsi
	jle	.L52
	movq	%rsi, %rdx
	movq	%r10, %rsi
	movq	%rdx, %r10
.L52:
	cmpq	%r10, %rax
	setle	%al
	xorl	%edx, %edx
	cmpq	%rsi, %r9
	setge	%dl
	andl	%eax, %edx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L71:
	testq	%rcx, %rcx
	je	.L57
	jle	.L73
	.p2align 4,,10
	.p2align 3
.L57:
	imull	%r13d, %r11d
	xorl	%edx, %edx
	cmpl	$1, %r11d
	setne	%dl
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L50:
	cmpq	%r12, %rdi
	jle	.L53
	movq	%rdi, %rax
	movq	%r12, %rdi
	movq	%rax, %r12
.L53:
	cmpq	%rbp, %r8
	jle	.L54
	movq	%r8, %rax
	movq	%rbp, %r8
	movq	%rax, %rbp
.L54:
	cmpq	%r8, %r12
	setge	%al
	xorl	%edx, %edx
	cmpq	%rbp, %rdi
	setle	%dl
	andl	%eax, %edx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L39:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L74
	addq	$168, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L73:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L48
.L58:
	imull	%r11d, %r13d
	xorl	%edx, %edx
	subl	$1, %r13d
	setne	%dl
	jmp	.L48
.L74:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB44:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE44:
	.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
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	movq	(%rsi), %rdx
	movq	%rdx, (%rdi)
	movq	%rax, (%rsi)
	ret
	.cfi_endproc
.LFE39:
	.size	swap, .-swap
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB40:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rcx
	movq	8(%rdi), %r8
	movq	24(%rdi), %rax
	movq	(%rsi), %rdx
	subq	%r8, %rax
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	movq	16(%rdi), %rdx
	subq	%rcx, %rdx
	movq	8(%rsi), %rcx
	subq	%r8, %rcx
	xorl	%r8d, %r8d
	imulq	%rcx, %rdx
	subq	%rdx, %rax
	testq	%rax, %rax
	je	.L3
	setg	%r8b
	movzbl	%r8b, %r8d
	leal	-1(%r8,%r8), %r8d
.L3:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE40:
	.size	func, .-func
	.p2align 4
	.globl	isIntersect
	.type	isIntersect, @function
isIntersect:
.LFB41:
	.cfi_startproc
	endbr64
	movq	%rsi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	(%rdi), %rdx
	xorl	%ebx, %ebx
	movq	8(%rdi), %r8
	movq	16(%rdi), %r9
	movq	24(%rdi), %r11
	movq	(%rsi), %rsi
	movq	8(%rax), %rdi
	movq	%r9, %r12
	movq	%r11, %r13
	movq	%rsi, %rcx
	subq	%rdx, %r12
	movq	%rdi, %r10
	subq	%r8, %r13
	subq	%rdx, %rcx
	subq	%r8, %r10
	imulq	%r13, %rcx
	imulq	%r12, %r10
	subq	%r10, %rcx
	testq	%rcx, %rcx
	je	.L9
	setg	%bl
	movzbl	%bl, %ebx
	leal	-1(%rbx,%rbx), %ebx
.L9:
	movq	24(%rax), %rbp
	movq	16(%rax), %r10
	movq	%rbp, %rcx
	movq	%r10, %rax
	subq	%rdx, %rax
	subq	%r8, %rcx
	imulq	%r12, %rcx
	xorl	%r12d, %r12d
	imulq	%r13, %rax
	subq	%rcx, %rax
	testq	%rax, %rax
	je	.L10
	setg	%r12b
	movzbl	%r12b, %r12d
	leal	-1(%r12,%r12), %r12d
.L10:
	movq	%rbp, %r13
	movq	%r10, %r14
	movq	%rdx, %rcx
	movq	%r8, %rax
	subq	%rdi, %r13
	subq	%rsi, %r14
	subq	%rsi, %rcx
	subq	%rdi, %rax
	imulq	%r13, %rcx
	imulq	%r14, %rax
	subq	%rax, %rcx
	movq	%r9, %rax
	subq	%rsi, %rax
	imulq	%r13, %rax
	movq	%r11, %r13
	subq	%rdi, %r13
	imulq	%r14, %r13
	subq	%r13, %rax
	testq	%rcx, %rcx
	je	.L11
	jle	.L36
	testq	%rax, %rax
	je	.L25
	movl	$0, %eax
	jle	.L25
.L8:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	testq	%rax, %rax
	jne	.L25
	movl	%r12d, %eax
	orl	%ebx, %eax
	jne	.L25
	cmpq	%r9, %rdx
	je	.L18
	jle	.L19
	movq	%rdx, %rax
	movq	%r9, %rdx
	movq	%rax, %r9
.L19:
	cmpq	%rsi, %r10
	jge	.L20
	movq	%rsi, %rax
	movq	%r10, %rsi
	movq	%rax, %r10
.L20:
	cmpq	%r10, %rdx
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	setle	%dl
	xorl	%eax, %eax
	cmpq	%rsi, %r9
	popq	%r12
	.cfi_def_cfa_offset 24
	setge	%al
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	andl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	testq	%rax, %rax
	je	.L25
	jle	.L37
.L25:
	imull	%ebx, %r12d
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	cmpl	$1, %r12d
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	setne	%al
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	cmpq	%r11, %r8
	jle	.L21
	movq	%r8, %rax
	movq	%r11, %r8
	movq	%rax, %r11
.L21:
	cmpq	%rdi, %rbp
	jge	.L22
	movq	%rdi, %rax
	movq	%rbp, %rdi
	movq	%rax, %rbp
.L22:
	cmpq	%rdi, %r11
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	setge	%dl
	xorl	%eax, %eax
	cmpq	%rbp, %r8
	popq	%rbp
	.cfi_def_cfa_offset 32
	setle	%al
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	andl	%edx, %eax
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L8
	.cfi_endproc
.LFE41:
	.size	isIntersect, .-isIntersect
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld%lld%lld"
	.text
	.p2align 4
	.globl	scanfLine
	.type	scanfLine, @function
scanfLine:
.LFB42:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	16(%rdi), %rcx
	leaq	8(%rdi), %rdx
	xorl	%eax, %eax
	leaq	24(%rdi), %r8
	leaq	.LC0(%rip), %rdi
	jmp	__isoc99_scanf@PLT
	.cfi_endproc
.LFE42:
	.size	scanfLine, .-scanfLine
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 76(%rsp)
	testl	%eax, %eax
	je	.L39
	leaq	80(%rsp), %rax
	leaq	.LC0(%rip), %rbx
	movq	%rax, 32(%rsp)
	leaq	104(%rsp), %rax
	movq	%rax, 56(%rsp)
	leaq	96(%rsp), %rax
	movq	%rax, 48(%rsp)
	leaq	88(%rsp), %rax
	movq	%rax, 40(%rsp)
	leaq	112(%rsp), %rax
	movq	%rax, (%rsp)
	leaq	136(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	128(%rsp), %rax
	movq	%rax, 16(%rsp)
	leaq	120(%rsp), %rax
	movq	%rax, 8(%rsp)
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L72:
	jle	.L71
	testq	%rcx, %rcx
	je	.L58
	movl	$0, %edx
	jle	.L57
	.p2align 4,,10
	.p2align 3
.L48:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	76(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 76(%rsp)
	testl	%eax, %eax
	je	.L39
.L40:
	movq	56(%rsp), %r8
	movq	48(%rsp), %rcx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %r8
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	movq	16(%rsp), %rcx
	movq	8(%rsp), %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movq	96(%rsp), %r9
	movq	104(%rsp), %r12
	xorl	%r11d, %r11d
	movq	112(%rsp), %rsi
	movq	120(%rsp), %r8
	movq	80(%rsp), %rax
	movq	88(%rsp), %rdi
	movq	%r12, %rcx
	movq	%r9, %r13
	movq	%rsi, %rdx
	movq	%r8, %r10
	subq	%rdi, %rcx
	subq	%rax, %r13
	subq	%rax, %rdx
	subq	%rdi, %r10
	imulq	%rcx, %rdx
	imulq	%r13, %r10
	subq	%r10, %rdx
	testq	%rdx, %rdx
	je	.L41
	setg	%r11b
	movzbl	%r11b, %r11d
	leal	-1(%r11,%r11), %r11d
.L41:
	movq	128(%rsp), %r10
	movq	136(%rsp), %rbp
	movq	%r10, %rdx
	subq	%rax, %rdx
	imulq	%rcx, %rdx
	movq	%rbp, %rcx
	subq	%rdi, %rcx
	imulq	%r13, %rcx
	xorl	%r13d, %r13d
	subq	%rcx, %rdx
	testq	%rdx, %rdx
	je	.L42
	setg	%r13b
	movzbl	%r13b, %r13d
	leal	-1(%r13,%r13), %r13d
.L42:
	movq	%rbp, %r15
	movq	%r10, %r14
	movq	%rax, %rdx
	movq	%rdi, %rcx
	subq	%r8, %r15
	subq	%rsi, %r14
	subq	%rsi, %rdx
	subq	%r8, %rcx
	imulq	%r15, %rdx
	imulq	%r14, %rcx
	subq	%rcx, %rdx
	movq	%r9, %rcx
	subq	%rsi, %rcx
	imulq	%r15, %rcx
	movq	%r12, %r15
	subq	%r8, %r15
	imulq	%r14, %r15
	subq	%r15, %rcx
	testq	%rdx, %rdx
	jne	.L72
	testq	%rcx, %rcx
	jne	.L57
	movl	%r13d, %ecx
	orl	%r11d, %ecx
	jne	.L57
	cmpq	%r9, %rax
	je	.L50
	jle	.L51
	movq	%rax, %rdx
	movq	%r9, %rax
	movq	%rdx, %r9
.L51:
	cmpq	%r10, %rsi
	jle	.L52
	movq	%rsi, %rdx
	movq	%r10, %rsi
	movq	%rdx, %r10
.L52:
	cmpq	%r10, %rax
	setle	%al
	xorl	%edx, %edx
	cmpq	%rsi, %r9
	setge	%dl
	andl	%eax, %edx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L71:
	testq	%rcx, %rcx
	je	.L57
	jle	.L73
	.p2align 4,,10
	.p2align 3
.L57:
	imull	%r13d, %r11d
	xorl	%edx, %edx
	cmpl	$1, %r11d
	setne	%dl
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L50:
	cmpq	%r12, %rdi
	jle	.L53
	movq	%rdi, %rax
	movq	%r12, %rdi
	movq	%rax, %r12
.L53:
	cmpq	%rbp, %r8
	jle	.L54
	movq	%r8, %rax
	movq	%rbp, %r8
	movq	%rax, %rbp
.L54:
	cmpq	%r8, %r12
	setge	%al
	xorl	%edx, %edx
	cmpq	%rbp, %rdi
	setle	%dl
	andl	%eax, %edx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L39:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L74
	addq	$168, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L73:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L48
.L58:
	imull	%r11d, %r13d
	xorl	%edx, %edx
	subl	$1, %r13d
	setne	%dl
	jmp	.L48
.L74:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB44:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE44:
	.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>
#include<stdlib.h>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef struct point2d{
  int64 x,y;
} point;

typedef struct line2d{
  point s,t;
} line;

void swap(int64 *a,int64 *b){
  int64 tmp=*a;
  *a=*b;
  *b=tmp;
}

int func(const line *a,const point *b){
  int64 p=a->s.x;
  int64 q=a->s.y;
  int64 r=a->t.x;
  int64 s=a->t.y;
  int64 t=(s-q)*(b->x-p)-(r-p)*(b->y-q);
  return t==0?0:(t>0?1:-1);
}

int isIntersect(const line *a,const line *b){
  int p=func(a,&(b->s));
  int q=func(a,&(b->t));
  int r=func(b,&(a->s));
  int s=func(b,&(a->t));
  if(p==0 && q==0 && r==0 && s==0){//同一直線上に2つの線分有り
    if(a->s.x!=a->t.x){
      int64 p=a->s.x;
      int64 q=a->t.x;
      int64 r=b->s.x;
      int64 s=b->t.x;
      if(p>q) swap(&p,&q);
      if(r>s) swap(&r,&s);
      return !(p>s || r>q);
    } else {
      int64 p=a->s.y;
      int64 q=a->t.y;
      int64 r=b->s.y;
      int64 s=b->t.y;
      if(p>q) swap(&p,&q);
      if(r>s) swap(&r,&s);
      return !(p>s || r>q);
    }
  }
  return p*q<=0 && r*s<=0;
}

void scanfLine(line *a){
  scanf("%lld%lld%lld%lld",&(a->s.x),&(a->s.y),&(a->t.x),&(a->t.y));
  return;
}

void run(void){
  int q;
  scanf("%d",&q);
  while(q--){
    line a,b;
    scanfLine(&a);
    scanfLine(&b);
    int ans=isIntersect(&a,&b);
    printf("%d\n",ans);
  }
  return;
}

int main(void){
  run();
  return 0;
}


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>
#include<stdlib.h>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef struct point2d{
  int64 x,y;
} point;

typedef struct line2d{
  point s,t;
} line;

void swap(int64 *a,int64 *b){
  int64 tmp=*a;
  *a=*b;
  *b=tmp;
}

int func(const line *a,const point *b){
  int64 p=a->s.x;
  int64 q=a->s.y;
  int64 r=a->t.x;
  int64 s=a->t.y;
  int64 t=(s-q)*(b->x-p)-(r-p)*(b->y-q);
  return t==0?0:(t>0?1:-1);
}

int isIntersect(const line *a,const line *b){
  int p=func(a,&(b->s));
  int q=func(a,&(b->t));
  int r=func(b,&(a->s));
  int s=func(b,&(a->t));
  if(p==0 && q==0 && r==0 && s==0){//同一直線上に2つの線分有り
    if(a->s.x!=a->t.x){
      int64 p=a->s.x;
      int64 q=a->t.x;
      int64 r=b->s.x;
      int64 s=b->t.x;
      if(p>q) swap(&p,&q);
      if(r>s) swap(&r,&s);
      return !(p>s || r>q);
    } else {
      int64 p=a->s.y;
      int64 q=a->t.y;
      int64 r=b->s.y;
      int64 s=b->t.y;
      if(p>q) swap(&p,&q);
      if(r>s) swap(&r,&s);
      return !(p>s || r>q);
    }
  }
  return p*q<=0 && r*s<=0;
}

void scanfLine(line *a){
  scanf("%lld%lld%lld%lld",&(a->s.x),&(a->s.y),&(a->t.x),&(a->t.y));
  return;
}

void run(void){
  int q;
  scanf("%d",&q);
  while(q--){
    line a,b;
    scanfLine(&a);
    scanfLine(&b);
    int ans=isIntersect(&a,&b);
    printf("%d\n",ans);
  }
  return;
}

int main(void){
  run();
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	func
	.type	func, @function
func:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -56(%rbp)
	movq	%rsi, -64(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-56(%rbp), %rax
	movq	24(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	subq	-32(%rbp), %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	movq	(%rax), %rax
	subq	-40(%rbp), %rax
	imulq	%rax, %rdx
	movq	-24(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, %rcx
	movq	-64(%rbp), %rax
	movq	8(%rax), %rax
	subq	-32(%rbp), %rax
	imulq	%rax, %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L3
	cmpq	$0, -8(%rbp)
	jle	.L4
	movl	$1, %eax
	jmp	.L7
.L4:
	movl	$-1, %eax
	jmp	.L7
.L3:
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	func, .-func
	.globl	isIntersect
	.type	isIntersect, @function
isIntersect:
.LFB8:
	.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	%rdi, -72(%rbp)
	movq	%rsi, -80(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-80(%rbp), %rdx
	movq	-72(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -56(%rbp)
	movq	-80(%rbp), %rax
	leaq	16(%rax), %rdx
	movq	-72(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -52(%rbp)
	movq	-72(%rbp), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -48(%rbp)
	movq	-72(%rbp), %rax
	leaq	16(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -44(%rbp)
	cmpl	$0, -56(%rbp)
	jne	.L9
	cmpl	$0, -52(%rbp)
	jne	.L9
	cmpl	$0, -48(%rbp)
	jne	.L9
	cmpl	$0, -44(%rbp)
	jne	.L9
	movq	-72(%rbp), %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	movq	16(%rax), %rax
	cmpq	%rax, %rdx
	je	.L10
	movq	-72(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-80(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L11
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L11:
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L12
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L12:
	movq	-40(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L13
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L13
	movl	$1, %eax
	jmp	.L15
.L13:
	movl	$0, %eax
	jmp	.L15
.L10:
	movq	-72(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	movq	24(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-80(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-80(%rbp), %rax
	movq	24(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L16
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L16:
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L17
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L17:
	movq	-40(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L18
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L18
	movl	$1, %eax
	jmp	.L15
.L18:
	movl	$0, %eax
	jmp	.L15
.L9:
	movl	-56(%rbp), %eax
	imull	-52(%rbp), %eax
	testl	%eax, %eax
	jg	.L20
	movl	-48(%rbp), %eax
	imull	-44(%rbp), %eax
	testl	%eax, %eax
	jg	.L20
	movl	$1, %eax
	jmp	.L15
.L20:
	movl	$0, %eax
.L15:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	isIntersect, .-isIntersect
	.section	.rodata
.LC0:
	.string	"%lld%lld%lld%lld"
	.text
	.globl	scanfLine
	.type	scanfLine, @function
scanfLine:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	leaq	24(%rax), %rsi
	movq	-8(%rbp), %rax
	leaq	16(%rax), %rcx
	movq	-8(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	scanfLine, .-scanfLine
	.section	.rodata
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L26
.L27:
	leaq	-80(%rbp), %rax
	movq	%rax, %rdi
	call	scanfLine
	leaq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	scanfLine
	leaq	-48(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	isIntersect
	movl	%eax, -84(%rbp)
	movl	-84(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L26:
	movl	-88(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -88(%rbp)
	testl	%eax, %eax
	jne	.L27
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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
	.globl	swap
	.type	swap, @function
swap:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	func
	.type	func, @function
func:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -56(%rbp)
	movq	%rsi, -64(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-56(%rbp), %rax
	movq	24(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	subq	-32(%rbp), %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	movq	(%rax), %rax
	subq	-40(%rbp), %rax
	imulq	%rax, %rdx
	movq	-24(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, %rcx
	movq	-64(%rbp), %rax
	movq	8(%rax), %rax
	subq	-32(%rbp), %rax
	imulq	%rax, %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L3
	cmpq	$0, -8(%rbp)
	jle	.L4
	movl	$1, %eax
	jmp	.L7
.L4:
	movl	$-1, %eax
	jmp	.L7
.L3:
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	func, .-func
	.globl	isIntersect
	.type	isIntersect, @function
isIntersect:
.LFB8:
	.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	%rdi, -72(%rbp)
	movq	%rsi, -80(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-80(%rbp), %rdx
	movq	-72(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -56(%rbp)
	movq	-80(%rbp), %rax
	leaq	16(%rax), %rdx
	movq	-72(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -52(%rbp)
	movq	-72(%rbp), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -48(%rbp)
	movq	-72(%rbp), %rax
	leaq	16(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	%eax, -44(%rbp)
	cmpl	$0, -56(%rbp)
	jne	.L9
	cmpl	$0, -52(%rbp)
	jne	.L9
	cmpl	$0, -48(%rbp)
	jne	.L9
	cmpl	$0, -44(%rbp)
	jne	.L9
	movq	-72(%rbp), %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	movq	16(%rax), %rax
	cmpq	%rax, %rdx
	je	.L10
	movq	-72(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-80(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L11
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L11:
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L12
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L12:
	movq	-40(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L13
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L13
	movl	$1, %eax
	jmp	.L15
.L13:
	movl	$0, %eax
	jmp	.L15
.L10:
	movq	-72(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	movq	24(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-80(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-80(%rbp), %rax
	movq	24(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L16
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L16:
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L17
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L17:
	movq	-40(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L18
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L18
	movl	$1, %eax
	jmp	.L15
.L18:
	movl	$0, %eax
	jmp	.L15
.L9:
	movl	-56(%rbp), %eax
	imull	-52(%rbp), %eax
	testl	%eax, %eax
	jg	.L20
	movl	-48(%rbp), %eax
	imull	-44(%rbp), %eax
	testl	%eax, %eax
	jg	.L20
	movl	$1, %eax
	jmp	.L15
.L20:
	movl	$0, %eax
.L15:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	isIntersect, .-isIntersect
	.section	.rodata
.LC0:
	.string	"%lld%lld%lld%lld"
	.text
	.globl	scanfLine
	.type	scanfLine, @function
scanfLine:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	leaq	24(%rax), %rsi
	movq	-8(%rbp), %rax
	leaq	16(%rax), %rcx
	movq	-8(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	scanfLine, .-scanfLine
	.section	.rodata
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L26
.L27:
	leaq	-80(%rbp), %rax
	movq	%rax, %rdi
	call	scanfLine
	leaq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	scanfLine
	leaq	-48(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	isIntersect
	movl	%eax, -84(%rbp)
	movl	-84(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L26:
	movl	-88(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -88(%rbp)
	testl	%eax, %eax
	jne	.L27
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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:
