	.file	"197035.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"apue chapter 2, file io\n"
	.text
	.globl	show
	.type	show, @function
show:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR stdout[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	show, .-show
	.globl	get_ms
	.type	get_ms, @function
get_ms:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	rax, QWORD PTR -32[rbp]
	imul	esi, eax, 1000
	mov	rcx, QWORD PTR -24[rbp]
	movabs	rdx, 2361183241434822607
	mov	rax, rcx
	imul	rdx
	mov	rax, rdx
	sar	rax, 7
	sar	rcx, 63
	mov	rdx, rcx
	sub	rax, rdx
	add	eax, esi
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	rdi, QWORD PTR -8[rbp]
	sub	rdi, QWORD PTR fs:40
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_ms, .-get_ms
	.section	.rodata
.LC1:
	.string	"test.txt"
	.align 8
.LC2:
	.string	"print info to stderr, close fd:%d, open fd:%d.\n"
.LC3:
	.string	"open file failed."
.LC4:
	.string	"%s\n"
.LC5:
	.string	"print info to stdout.\n"
	.text
	.globl	fake_redirect
	.type	fake_redirect, @function
fake_redirect:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	edi, 1
	call	close@PLT
	mov	esi, 1053762
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, edx
	mov	edx, 1
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	cmp	DWORD PTR -4[rbp], -1
	jne	.L6
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, .LC3[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L7
.L6:
	mov	rax, QWORD PTR stdout[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fake_redirect, .-fake_redirect
	.section	.rodata
.LC6:
	.string	"call dup2 failed."
	.align 8
.LC7:
	.string	"call dup2, test print to stdout\n"
	.text
	.globl	test_dup2
	.type	test_dup2, @function
test_dup2:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	esi, 1053762
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L9
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, .LC6[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L10
.L9:
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, 32
	lea	rsi, .LC7[rip]
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	test_dup2, .-test_dup2
	.section	.rodata
.LC8:
	.string	"call fcntl failed."
	.align 8
.LC9:
	.string	"print info after call fcntl(STDOUT_FILENO, F_FDUPFD, fd).\n"
	.text
	.globl	test_fcntl
	.type	test_fcntl, @function
test_fcntl:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	esi, 1053762
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], -1
	jne	.L12
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, .LC3[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L13
.L12:
	mov	eax, DWORD PTR -8[rbp]
	mov	edx, 1
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L14
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, .LC8[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -2
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, 59
	lea	rsi, .LC9[rip]
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	test_fcntl, .-test_fcntl
	.section	.rodata
	.align 4
	.type	BUFFSIZE, @object
	.size	BUFFSIZE, 4
BUFFSIZE:
	.long	8192
.LC10:
	.string	"test_read.txt"
.LC11:
	.string	"open file failed, file"
.LC12:
	.string	"%s:%s\n"
.LC13:
	.string	"test_write.txt"
.LC14:
	.string	"sync write file cost time"
.LC15:
	.string	"%s:%dms\n"
	.text
	.globl	test_sync_write
	.type	test_sync_write, @function
test_sync_write:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	mov	DWORD PTR -96[rbp], 0
	mov	esi, 0
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -92[rbp], eax
	cmp	DWORD PTR -92[rbp], -1
	jne	.L16
	mov	rax, QWORD PTR stderr[rip]
	lea	rcx, .LC10[rip]
	lea	rdx, .LC11[rip]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L17
.L16:
	mov	esi, 1052737
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -88[rbp], eax
	cmp	DWORD PTR -88[rbp], -1
	jne	.L18
	mov	rax, QWORD PTR stderr[rip]
	lea	rcx, .LC13[rip]
	lea	rdx, .LC11[rip]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L17
.L18:
	mov	eax, 0
	call	get_ms
	mov	DWORD PTR -84[rbp], eax
	mov	DWORD PTR -80[rbp], 0
	mov	eax, 8192
	cdqe
	sub	rax, 1
	mov	QWORD PTR -72[rbp], rax
	mov	eax, 8192
	cdqe
	mov	r14, rax
	mov	r15d, 0
	mov	eax, 8192
	cdqe
	mov	r12, rax
	mov	r13d, 0
	mov	eax, 8192
	cdqe
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L19:
	cmp	rsp, rdx
	je	.L20
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L19
.L20:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L21
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L21:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -64[rbp], rax
	jmp	.L22
.L23:
	mov	eax, DWORD PTR -80[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -88[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
.L22:
	mov	eax, 8192
	movsx	rdx, eax
	mov	rcx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -92[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -80[rbp], eax
	cmp	DWORD PTR -80[rbp], 0
	jne	.L23
	mov	eax, 0
	call	get_ms
	mov	DWORD PTR -76[rbp], eax
	mov	eax, DWORD PTR -76[rbp]
	sub	eax, DWORD PTR -84[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	ecx, edx
	lea	rdx, .LC14[rip]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -88[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L17:
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	test_sync_write, .-test_sync_write
	.section	.rodata
.LC16:
	.string	"async write file cost time"
	.text
	.globl	test_async_write
	.type	test_async_write, @function
test_async_write:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	mov	DWORD PTR -96[rbp], 0
	mov	esi, 0
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -92[rbp], eax
	cmp	DWORD PTR -92[rbp], -1
	jne	.L27
	mov	rax, QWORD PTR stderr[rip]
	lea	rcx, .LC10[rip]
	lea	rdx, .LC11[rip]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L28
.L27:
	mov	esi, 65
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -88[rbp], eax
	cmp	DWORD PTR -88[rbp], -1
	jne	.L29
	mov	rax, QWORD PTR stderr[rip]
	lea	rcx, .LC13[rip]
	lea	rdx, .LC11[rip]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L28
.L29:
	mov	eax, 0
	call	get_ms
	mov	DWORD PTR -84[rbp], eax
	mov	DWORD PTR -80[rbp], 0
	mov	eax, 8192
	cdqe
	sub	rax, 1
	mov	QWORD PTR -72[rbp], rax
	mov	eax, 8192
	cdqe
	mov	r14, rax
	mov	r15d, 0
	mov	eax, 8192
	cdqe
	mov	r12, rax
	mov	r13d, 0
	mov	eax, 8192
	cdqe
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L30:
	cmp	rsp, rdx
	je	.L31
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L30
.L31:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L32
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L32:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -64[rbp], rax
	jmp	.L33
.L34:
	mov	eax, DWORD PTR -80[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -88[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
.L33:
	mov	eax, 8192
	movsx	rdx, eax
	mov	rcx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -92[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -80[rbp], eax
	cmp	DWORD PTR -80[rbp], 0
	jne	.L34
	mov	eax, 0
	call	get_ms
	mov	DWORD PTR -76[rbp], eax
	mov	eax, DWORD PTR -76[rbp]
	sub	eax, DWORD PTR -84[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	ecx, edx
	lea	rdx, .LC16[rip]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -88[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L28:
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	test_async_write, .-test_async_write
	.section	.rodata
.LC17:
	.string	"test test_sync_write failed."
.LC18:
	.string	"test test_async_write failed."
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	eax, 0
	call	show
	mov	eax, 0
	call	test_sync_write
	test	eax, eax
	je	.L38
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, .LC17[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L38:
	mov	eax, 0
	call	test_async_write
	test	eax, eax
	je	.L39
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, .LC18[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L39:
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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	"197035.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"apue chapter 2, file io\012\000"
	.text
	.align	2
	.global	show
	.syntax unified
	.arm
	.fpu softvfp
	.type	show, %function
show:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L2+4
	bl	fwrite
	nop
	mov	r0, r3
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	stdout
	.word	.LC0
	.size	show, .-show
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	get_ms
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_ms, %function
get_ms:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #16
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r1, r3
	ldr	r3, [fp, #-12]
	ldr	r2, .L7+4
	smull	r0, r2, r3, r2
	asr	r2, r2, #6
	asr	r3, r3, #31
	sub	r3, r2, r3
	add	r3, r1, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r2, .L7
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC1
	.word	274877907
	.size	get_ms, .-get_ms
	.section	.rodata
	.align	2
.LC2:
	.ascii	"test.txt\000"
	.align	2
.LC3:
	.ascii	"print info to stderr, close fd:%d, open fd:%d.\012\000"
	.align	2
.LC4:
	.ascii	"open file failed.\000"
	.align	2
.LC5:
	.ascii	"%s\012\000"
	.align	2
.LC6:
	.ascii	"print info to stdout.\012\000"
	.text
	.align	2
	.global	fake_redirect
	.syntax unified
	.arm
	.fpu softvfp
	.type	fake_redirect, %function
fake_redirect:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r0, #1
	bl	close
	ldr	r1, .L12
	ldr	r0, .L12+4
	bl	open
	str	r0, [fp, #-8]
	ldr	r3, .L12+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-8]
	mov	r2, #1
	ldr	r1, .L12+12
	bl	fprintf
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L10
	ldr	r3, .L12+8
	ldr	r3, [r3]
	ldr	r2, .L12+16
	ldr	r1, .L12+20
	mov	r0, r3
	bl	fprintf
	mvn	r3, #0
	b	.L11
.L10:
	ldr	r3, .L12+24
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L12+28
	bl	fwrite
	ldr	r0, [fp, #-8]
	bl	close
	mov	r3, #0
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	1053762
	.word	.LC2
	.word	stderr
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	stdout
	.word	.LC6
	.size	fake_redirect, .-fake_redirect
	.section	.rodata
	.align	2
.LC7:
	.ascii	"call dup2 failed.\000"
	.align	2
.LC8:
	.ascii	"call dup2, test print to stdout\012\000"
	.text
	.align	2
	.global	test_dup2
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_dup2, %function
test_dup2:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r1, .L17
	ldr	r0, .L17+4
	bl	open
	str	r0, [fp, #-12]
	mov	r1, #1
	ldr	r0, [fp, #-12]
	bl	dup2
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L15
	ldr	r3, .L17+8
	ldr	r3, [r3]
	ldr	r2, .L17+12
	ldr	r1, .L17+16
	mov	r0, r3
	bl	fprintf
	mvn	r3, #0
	b	.L16
.L15:
	mov	r2, #32
	ldr	r1, .L17+20
	ldr	r0, [fp, #-8]
	bl	write
	ldr	r0, [fp, #-12]
	bl	close
	mov	r3, #0
.L16:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	1053762
	.word	.LC2
	.word	stderr
	.word	.LC7
	.word	.LC5
	.word	.LC8
	.size	test_dup2, .-test_dup2
	.section	.rodata
	.align	2
.LC9:
	.ascii	"call fcntl failed.\000"
	.align	2
.LC10:
	.ascii	"print info after call fcntl(STDOUT_FILENO, F_FDUPFD"
	.ascii	", fd).\012\000"
	.text
	.align	2
	.global	test_fcntl
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_fcntl, %function
test_fcntl:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r1, .L23
	ldr	r0, .L23+4
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L20
	ldr	r3, .L23+8
	ldr	r3, [r3]
	ldr	r2, .L23+12
	ldr	r1, .L23+16
	mov	r0, r3
	bl	fprintf
	mvn	r3, #0
	b	.L21
.L20:
	mov	r2, #1
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	fcntl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L22
	ldr	r3, .L23+8
	ldr	r3, [r3]
	ldr	r2, .L23+20
	ldr	r1, .L23+16
	mov	r0, r3
	bl	fprintf
	mvn	r3, #1
	b	.L21
.L22:
	mov	r2, #59
	ldr	r1, .L23+24
	ldr	r0, [fp, #-8]
	bl	write
	ldr	r0, [fp, #-8]
	bl	close
	mov	r3, #0
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	1053762
	.word	.LC2
	.word	stderr
	.word	.LC4
	.word	.LC5
	.word	.LC9
	.word	.LC10
	.size	test_fcntl, .-test_fcntl
	.section	.rodata
	.align	2
	.type	BUFFSIZE, %object
	.size	BUFFSIZE, 4
BUFFSIZE:
	.word	8192
	.align	2
.LC11:
	.ascii	"test_read.txt\000"
	.align	2
.LC12:
	.ascii	"open file failed, file\000"
	.align	2
.LC13:
	.ascii	"%s:%s\012\000"
	.align	2
.LC14:
	.ascii	"test_write.txt\000"
	.align	2
.LC15:
	.ascii	"sync write file cost time\000"
	.align	2
.LC16:
	.ascii	"%s:%dms\012\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	test_sync_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_sync_write, %function
test_sync_write:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #44
	ldr	r3, .L33
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r1, #0
	ldr	r0, .L33+4
	bl	open
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmn	r3, #1
	bne	.L26
	ldr	r3, .L33+8
	ldr	r0, [r3]
	ldr	r3, .L33+4
	ldr	r2, .L33+12
	ldr	r1, .L33+16
	bl	fprintf
	mvn	r3, #0
	b	.L27
.L26:
	ldr	r1, .L33+20
	ldr	r0, .L33+24
	bl	open
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmn	r3, #1
	bne	.L28
	ldr	r3, .L33+8
	ldr	r0, [r3]
	ldr	r3, .L33+24
	ldr	r2, .L33+12
	ldr	r1, .L33+16
	bl	fprintf
	mvn	r3, #0
	b	.L27
.L28:
	bl	get_ms
	str	r0, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #8192
	sub	r3, r3, #1
	str	r3, [fp, #-28]
	mov	r3, #8192
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, #8192
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, #8192
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-24]
	b	.L29
.L30:
	ldr	r3, [fp, #-32]
	mov	r2, r3
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-40]
	bl	write
.L29:
	mov	r3, #8192
	mov	r2, r3
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-44]
	bl	read
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L30
	bl	get_ms
	str	r0, [fp, #-20]
	ldr	r3, .L33+28
	ldr	r0, [r3]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-36]
	sub	r3, r2, r3
	ldr	r2, .L33+32
	ldr	r1, .L33+36
	bl	fprintf
	ldr	r0, [fp, #-40]
	bl	close
	mov	r3, #0
.L27:
	mov	sp, r4
	ldr	r2, .L33
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L32
	bl	__stack_chk_fail
.L32:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC17
	.word	.LC11
	.word	stderr
	.word	.LC12
	.word	.LC13
	.word	1052737
	.word	.LC14
	.word	stdout
	.word	.LC15
	.word	.LC16
	.size	test_sync_write, .-test_sync_write
	.section	.rodata
	.align	2
.LC18:
	.ascii	"async write file cost time\000"
	.align	2
.LC19:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	test_async_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_async_write, %function
test_async_write:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #44
	ldr	r3, .L43
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r1, #0
	ldr	r0, .L43+4
	bl	open
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmn	r3, #1
	bne	.L36
	ldr	r3, .L43+8
	ldr	r0, [r3]
	ldr	r3, .L43+4
	ldr	r2, .L43+12
	ldr	r1, .L43+16
	bl	fprintf
	mvn	r3, #0
	b	.L37
.L36:
	mov	r1, #65
	ldr	r0, .L43+20
	bl	open
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmn	r3, #1
	bne	.L38
	ldr	r3, .L43+8
	ldr	r0, [r3]
	ldr	r3, .L43+20
	ldr	r2, .L43+12
	ldr	r1, .L43+16
	bl	fprintf
	mvn	r3, #0
	b	.L37
.L38:
	bl	get_ms
	str	r0, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #8192
	sub	r3, r3, #1
	str	r3, [fp, #-28]
	mov	r3, #8192
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, #8192
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, #8192
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-24]
	b	.L39
.L40:
	ldr	r3, [fp, #-32]
	mov	r2, r3
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-40]
	bl	write
.L39:
	mov	r3, #8192
	mov	r2, r3
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-44]
	bl	read
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L40
	bl	get_ms
	str	r0, [fp, #-20]
	ldr	r3, .L43+24
	ldr	r0, [r3]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-36]
	sub	r3, r2, r3
	ldr	r2, .L43+28
	ldr	r1, .L43+32
	bl	fprintf
	ldr	r0, [fp, #-40]
	bl	close
	mov	r3, #0
.L37:
	mov	sp, r4
	ldr	r2, .L43
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L42
	bl	__stack_chk_fail
.L42:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L44:
	.align	2
.L43:
	.word	.LC19
	.word	.LC11
	.word	stderr
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	stdout
	.word	.LC18
	.word	.LC16
	.size	test_async_write, .-test_async_write
	.section	.rodata
	.align	2
.LC20:
	.ascii	"test test_sync_write failed.\000"
	.align	2
.LC21:
	.ascii	"test test_async_write failed.\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	bl	show
	bl	test_sync_write
	mov	r3, r0
	cmp	r3, #0
	beq	.L46
	ldr	r3, .L49
	ldr	r3, [r3]
	ldr	r2, .L49+4
	ldr	r1, .L49+8
	mov	r0, r3
	bl	fprintf
.L46:
	bl	test_async_write
	mov	r3, r0
	cmp	r3, #0
	beq	.L47
	ldr	r3, .L49
	ldr	r3, [r3]
	ldr	r2, .L49+12
	ldr	r1, .L49+8
	mov	r0, r3
	bl	fprintf
.L47:
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L50:
	.align	2
.L49:
	.word	stderr
	.word	.LC20
	.word	.LC5
	.word	.LC21
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
