	.file	"117328360.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"/home//haozhe26/ECS150/Test/foo"
.LC1:
	.string	"not open"
.LC2:
	.string	"buf is %s"
	.text
	.globl	fsort
	.type	fsort, @function
fsort:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 544
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -536[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L2
	mov	edi, -1
	call	exit@PLT
.L2:
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -544[rbp], eax
	cmp	DWORD PTR -544[rbp], -1
	jne	.L4
	lea	rdi, .LC1[rip]
	call	perror@PLT
	jmp	.L4
.L6:
	cmp	DWORD PTR -540[rbp], -1
	jne	.L5
	mov	edi, -1
	call	exit@PLT
.L5:
	lea	rax, -528[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -540[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -532[rbp]
	lea	rcx, -528[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	rax, -1
	jne	.L4
	mov	edi, -1
	call	exit@PLT
.L4:
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -544[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -540[rbp], eax
	cmp	DWORD PTR -540[rbp], 0
	jne	.L6
	mov	eax, DWORD PTR -544[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	je	.L7
	mov	eax, DWORD PTR -532[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L9
.L7:
	mov	edi, -1
	call	exit@PLT
.L11:
	cmp	DWORD PTR -540[rbp], -1
	jne	.L10
	mov	edi, -1
	call	exit@PLT
.L10:
	mov	eax, DWORD PTR -540[rbp]
	movsx	rdx, eax
	lea	rax, -528[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
	cmp	rax, -1
	jne	.L9
	mov	edi, -1
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR -536[rbp]
	lea	rcx, -528[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -540[rbp], eax
	cmp	DWORD PTR -540[rbp], 0
	jne	.L11
	mov	eax, DWORD PTR -536[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L14
	mov	edi, -1
	call	exit@PLT
.L14:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fsort, .-fsort
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, 0
	call	fsort
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"117328360.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/home//haozhe26/ECS150/Test/foo\000"
	.align	2
.LC1:
	.ascii	"not open\000"
	.align	2
.LC2:
	.ascii	"buf is %s\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	fsort
	.syntax unified
	.arm
	.fpu softvfp
	.type	fsort, %function
fsort:
	@ args = 0, pretend = 0, frame = 536
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #536
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #528
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	mvn	r0, #0
	bl	exit
.L2:
	mov	r1, #0
	ldr	r0, .L15+4
	bl	open
	str	r0, [fp, #-536]
	ldr	r3, [fp, #-536]
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L15+8
	bl	perror
	b	.L4
.L6:
	ldr	r3, [fp, #-532]
	cmn	r3, #1
	bne	.L5
	mvn	r0, #0
	bl	exit
.L5:
	sub	r3, fp, #520
	mov	r1, r3
	ldr	r0, .L15+12
	bl	printf
	ldr	r3, [fp, #-524]
	ldr	r2, [fp, #-532]
	sub	r1, fp, #520
	mov	r0, r3
	bl	write
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	mvn	r0, #0
	bl	exit
.L4:
	sub	r3, fp, #520
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [fp, #-536]
	bl	read
	str	r0, [fp, #-532]
	ldr	r3, [fp, #-532]
	cmp	r3, #0
	bne	.L6
	ldr	r0, [fp, #-536]
	bl	close
	mov	r3, r0
	cmn	r3, #1
	beq	.L7
	ldr	r3, [fp, #-524]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
.L7:
	mvn	r0, #0
	bl	exit
.L11:
	ldr	r3, [fp, #-532]
	cmn	r3, #1
	bne	.L10
	mvn	r0, #0
	bl	exit
.L10:
	ldr	r2, [fp, #-532]
	sub	r3, fp, #520
	mov	r1, r3
	mov	r0, #1
	bl	write
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	mvn	r0, #0
	bl	exit
.L9:
	ldr	r3, [fp, #-528]
	sub	r1, fp, #520
	mov	r2, #512
	mov	r0, r3
	bl	read
	str	r0, [fp, #-532]
	ldr	r3, [fp, #-532]
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-528]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L14
	mvn	r0, #0
	bl	exit
.L14:
	nop
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	fsort, .-fsort
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	bl	fsort
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
