	.file	"142205.c"
	.intel_syntax noprefix
	.text
	.globl	fd_tx
	.bss
	.align 4
	.type	fd_tx, @object
	.size	fd_tx, 4
fd_tx:
	.zero	4
	.globl	fd_rx
	.align 4
	.type	fd_rx, @object
	.size	fd_rx, 4
fd_rx:
	.zero	4
	.section	.rodata
.LC0:
	.string	"failed to create ptx"
.LC1:
	.string	"failed to create prx"
	.text
	.globl	spawn
	.type	spawn, @function
spawn:
.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, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -24[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	lea	rax, -16[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L3
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	call	fork@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jne	.L4
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR fd_tx[rip], eax
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR fd_rx[rip], eax
	jmp	.L5
.L4:
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR fd_tx[rip], eax
	mov	eax, DWORD PTR -16[rbp]
	mov	DWORD PTR fd_rx[rip], eax
.L5:
	mov	eax, DWORD PTR -28[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	spawn, .-spawn
	.globl	parent_work
	.type	parent_work, @function
parent_work:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -9[rbp], 0
	mov	DWORD PTR -16[rbp], 0
	jmp	.L9
.L10:
	mov	eax, DWORD PTR fd_tx[rip]
	lea	rcx, -9[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR fd_rx[rip]
	lea	rcx, -9[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	movzx	eax, BYTE PTR -9[rbp]
	add	eax, 1
	mov	BYTE PTR -9[rbp], al
	add	DWORD PTR -16[rbp], 1
.L9:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L10
	mov	edi, 0
	call	wait@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	parent_work, .-parent_work
	.globl	child_work
	.type	child_work, @function
child_work:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -9[rbp], 0
	mov	DWORD PTR -16[rbp], 0
	jmp	.L13
.L14:
	mov	eax, DWORD PTR fd_rx[rip]
	lea	rcx, -9[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	movzx	eax, BYTE PTR -9[rbp]
	add	eax, 1
	mov	BYTE PTR -9[rbp], al
	mov	eax, DWORD PTR fd_tx[rip]
	lea	rcx, -9[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	add	DWORD PTR -16[rbp], 1
.L13:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L14
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE8:
	.size	child_work, .-child_work
	.section	.rodata
.LC2:
	.string	"usage: %s N\n"
	.align 8
.LC3:
	.string	"total time in %d rounds: %ld us\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	cmp	DWORD PTR -36[rbp], 2
	je	.L17
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L17:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -32[rbp], eax
	call	clock@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	eax, 0
	call	spawn
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jle	.L18
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	parent_work
	jmp	.L19
.L18:
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	child_work
.L19:
	call	clock@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	sub	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rdx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE9:
	.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	"142205.c"
	.text
	.comm	fd_tx,4,4
	.comm	fd_rx,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"failed to create ptx\000"
	.align	2
.LC1:
	.ascii	"failed to create prx\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	spawn
	.syntax unified
	.arm
	.fpu softvfp
	.type	spawn, %function
spawn:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L8+4
	bl	puts
	mov	r0, #1
	bl	exit
.L2:
	sub	r3, fp, #16
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L8+8
	bl	puts
	mov	r0, #1
	bl	exit
.L3:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-12]
	ldr	r2, .L8+12
	str	r3, [r2]
	ldr	r3, [fp, #-24]
	ldr	r2, .L8+16
	str	r3, [r2]
	b	.L5
.L4:
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-20]
	ldr	r2, .L8+12
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	ldr	r2, .L8+16
	str	r3, [r2]
.L5:
	ldr	r3, [fp, #-28]
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.word	fd_tx
	.word	fd_rx
	.size	spawn, .-spawn
	.section	.rodata
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	parent_work
	.syntax unified
	.arm
	.fpu softvfp
	.type	parent_work, %function
parent_work:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L11
.L12:
	ldr	r3, .L14+4
	ldr	r3, [r3]
	sub	r1, fp, #12
	mov	r2, #1
	mov	r0, r3
	bl	write
	ldr	r3, .L14+8
	ldr	r3, [r3]
	sub	r1, fp, #12
	mov	r2, #1
	mov	r0, r3
	bl	read
	ldrb	r3, [fp, #-12]	@ zero_extendqisi2
	add	r3, r3, #1
	and	r3, r3, #255
	strb	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L11:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L12
	mov	r0, #0
	bl	wait
	nop
	ldr	r3, .L14
	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}
.L15:
	.align	2
.L14:
	.word	.LC3
	.word	fd_tx
	.word	fd_rx
	.size	parent_work, .-parent_work
	.section	.rodata
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	child_work
	.syntax unified
	.arm
	.fpu softvfp
	.type	child_work, %function
child_work:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L17
.L18:
	ldr	r3, .L20+4
	ldr	r3, [r3]
	sub	r1, fp, #12
	mov	r2, #1
	mov	r0, r3
	bl	read
	ldrb	r3, [fp, #-12]	@ zero_extendqisi2
	add	r3, r3, #1
	and	r3, r3, #255
	strb	r3, [fp, #-12]
	ldr	r3, .L20+8
	ldr	r3, [r3]
	sub	r1, fp, #12
	mov	r2, #1
	mov	r0, r3
	bl	write
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L17:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L18
	mov	r0, #0
	bl	exit
.L21:
	.align	2
.L20:
	.word	.LC4
	.word	fd_rx
	.word	fd_tx
	.size	child_work, .-child_work
	.section	.rodata
	.align	2
.LC5:
	.ascii	"usage: %s N\012\000"
	.align	2
.LC6:
	.ascii	"total time in %d rounds: %ld us\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	beq	.L23
	ldr	r3, .L26
	ldr	r0, [r3]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L26+4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L23:
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-28]
	bl	clock
	str	r0, [fp, #-24]
	bl	spawn
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	ble	.L24
	ldr	r0, [fp, #-28]
	bl	parent_work
	b	.L25
.L24:
	ldr	r0, [fp, #-28]
	bl	child_work
.L25:
	bl	clock
	str	r0, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	sub	r3, r2, r3
	mov	r2, r3
	asr	r3, r2, #31
	str	r2, [fp, #-12]
	str	r3, [fp, #-8]
	sub	r3, fp, #12
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-28]
	ldr	r0, .L26+8
	bl	printf
	mov	r0, #0
	bl	exit
.L27:
	.align	2
.L26:
	.word	stderr
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
