	.file	"353952.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"creating temporary files"
.LC1:
	.string	"fork() failed"
.LC2:
	.string	"parent process"
	.align 8
.LC3:
	.string	"parent loops waiting for child: %i\n"
.LC4:
	.string	"child process"
	.align 8
.LC5:
	.string	"fd %2i read ready? %i write ready ? %i\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 400
	mov	DWORD PTR -388[rbp], edi
	mov	QWORD PTR -400[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -352[rbp], 10
	movabs	rax, 8101259051807896623
	movabs	rdx, 6365935209970166118
	mov	QWORD PTR -64[rbp], rax
	mov	QWORD PTR -56[rbp], rdx
	mov	WORD PTR -48[rbp], 22616
	mov	BYTE PTR -46[rbp], 0
	mov	DWORD PTR -368[rbp], 0
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -320[rbp]
	mov	rdi, rdx
#APP
# 15 "the_stack_data/353952.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -348[rbp], edx
	mov	DWORD PTR -344[rbp], eax
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -192[rbp]
	mov	rdi, rdx
#APP
# 16 "the_stack_data/353952.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -340[rbp], edx
	mov	DWORD PTR -336[rbp], eax
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	DWORD PTR -364[rbp], 0
	jmp	.L2
.L4:
	lea	rdx, -64[rbp]
	lea	rax, -32[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	mkstemp@PLT
	mov	DWORD PTR -324[rbp], eax
	mov	eax, DWORD PTR -324[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -320[rbp+rax*8]
	mov	eax, DWORD PTR -324[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -320[rbp+rax*8], rdx
	mov	eax, DWORD PTR -324[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -192[rbp+rax*8]
	mov	eax, DWORD PTR -324[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -192[rbp+rax*8], rdx
	mov	eax, DWORD PTR -324[rbp]
	cmp	eax, DWORD PTR -368[rbp]
	jl	.L3
	mov	eax, DWORD PTR -324[rbp]
	add	eax, 1
	mov	DWORD PTR -368[rbp], eax
.L3:
	add	DWORD PTR -364[rbp], 1
.L2:
	mov	eax, DWORD PTR -364[rbp]
	cmp	eax, DWORD PTR -352[rbp]
	jl	.L4
	call	fork@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], -1
	jne	.L5
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	cmp	DWORD PTR -332[rbp], 0
	je	.L6
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	DWORD PTR -360[rbp], 0
	jmp	.L7
.L8:
	add	DWORD PTR -360[rbp], 1
.L7:
	lea	rax, -372[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, -1
	call	waitpid@PLT
	test	eax, eax
	je	.L8
	mov	eax, DWORD PTR -360[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L9
.L6:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdx, -192[rbp]
	lea	rsi, -320[rbp]
	mov	eax, DWORD PTR -368[rbp]
	mov	r8d, 0
	mov	ecx, 0
	mov	edi, eax
	call	select@PLT
	mov	DWORD PTR -328[rbp], eax
	mov	DWORD PTR -356[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -356[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	cdqe
	mov	rsi, QWORD PTR -192[rbp+rax*8]
	mov	eax, DWORD PTR -356[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	and	rax, rsi
	test	rax, rax
	setne	al
	movzx	esi, al
	mov	eax, DWORD PTR -356[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	cdqe
	mov	rdi, QWORD PTR -320[rbp+rax*8]
	mov	eax, DWORD PTR -356[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	and	rax, rdi
	test	rax, rax
	setne	al
	movzx	edx, al
	mov	eax, DWORD PTR -356[rbp]
	mov	ecx, esi
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -356[rbp], 1
.L10:
	mov	eax, DWORD PTR -356[rbp]
	cmp	eax, DWORD PTR -368[rbp]
	jl	.L11
.L9:
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"353952.c"
	.text
	.section	.rodata
	.align	2
.LC1:
	.ascii	"creating temporary files\000"
	.align	2
.LC2:
	.ascii	"fork() failed\000"
	.align	2
.LC3:
	.ascii	"parent process\000"
	.align	2
.LC4:
	.ascii	"parent loops waiting for child: %i\012\000"
	.align	2
.LC5:
	.ascii	"child process\000"
	.align	2
.LC6:
	.ascii	"fd %2i read ready? %i write ready ? %i\012\000"
	.align	2
.LC0:
	.ascii	"/tmp/tmpfileXXXXXX\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 360
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #368
	str	r0, [fp, #-360]
	str	r1, [fp, #-364]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #10
	str	r3, [fp, #-328]
	ldr	r3, .L18+4
	sub	ip, fp, #48
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldr	r3, [lr]
	strh	r3, [ip]	@ movhi
	add	ip, ip, #2
	lsr	r3, r3, #16
	strb	r3, [ip]
	mov	r3, #0
	str	r3, [fp, #-352]
	sub	r3, fp, #304
	str	r3, [fp, #-324]
	mov	r3, #0
	str	r3, [fp, #-348]
	b	.L2
.L3:
	ldr	r3, [fp, #-324]
	ldr	r2, [fp, #-348]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-348]
	add	r3, r3, #1
	str	r3, [fp, #-348]
.L2:
	ldr	r3, [fp, #-348]
	cmp	r3, #31
	bls	.L3
	sub	r3, fp, #176
	str	r3, [fp, #-320]
	mov	r3, #0
	str	r3, [fp, #-344]
	b	.L4
.L5:
	ldr	r3, [fp, #-320]
	ldr	r2, [fp, #-344]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	str	r3, [fp, #-344]
.L4:
	ldr	r3, [fp, #-344]
	cmp	r3, #31
	bls	.L5
	ldr	r0, .L18+8
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-340]
	b	.L6
.L8:
	sub	r2, fp, #48
	sub	r3, fp, #28
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	sub	r3, fp, #28
	mov	r0, r3
	bl	mkstemp
	str	r0, [fp, #-308]
	ldr	r3, [fp, #-308]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r1, [r3, #-300]
	ldr	r3, [fp, #-308]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-300]
	ldr	r3, [fp, #-308]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r1, [r3, #-172]
	ldr	r3, [fp, #-308]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-172]
	ldr	r2, [fp, #-308]
	ldr	r3, [fp, #-352]
	cmp	r2, r3
	blt	.L7
	ldr	r3, [fp, #-308]
	add	r3, r3, #1
	str	r3, [fp, #-352]
.L7:
	ldr	r3, [fp, #-340]
	add	r3, r3, #1
	str	r3, [fp, #-340]
.L6:
	ldr	r2, [fp, #-340]
	ldr	r3, [fp, #-328]
	cmp	r2, r3
	blt	.L8
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-316]
	ldr	r3, [fp, #-316]
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L18+12
	bl	puts
	mov	r0, #1
	bl	exit
.L9:
	ldr	r3, [fp, #-316]
	cmp	r3, #0
	beq	.L10
	ldr	r0, .L18+16
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-336]
	b	.L11
.L12:
	ldr	r3, [fp, #-336]
	add	r3, r3, #1
	str	r3, [fp, #-336]
.L11:
	sub	r3, fp, #356
	mov	r2, #1
	mov	r1, r3
	mvn	r0, #0
	bl	waitpid
	mov	r3, r0
	cmp	r3, #0
	beq	.L12
	ldr	r1, [fp, #-336]
	ldr	r0, .L18+20
	bl	printf
	b	.L13
.L10:
	ldr	r0, .L18+24
	bl	puts
	sub	r2, fp, #176
	sub	r1, fp, #304
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	ldr	r0, [fp, #-352]
	bl	select
	str	r0, [fp, #-312]
	mov	r3, #0
	str	r3, [fp, #-332]
	b	.L14
.L15:
	ldr	r3, [fp, #-332]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-300]
	ldr	r3, [fp, #-332]
	rsbs	r1, r3, #0
	and	r3, r3, #31
	and	r1, r1, #31
	rsbpl	r3, r1, #0
	mov	r1, #1
	lsl	r3, r1, r3
	and	r3, r3, r2
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	mov	r0, r3
	ldr	r3, [fp, #-332]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-172]
	ldr	r3, [fp, #-332]
	rsbs	r1, r3, #0
	and	r3, r3, #31
	and	r1, r1, #31
	rsbpl	r3, r1, #0
	mov	r1, #1
	lsl	r3, r1, r3
	and	r3, r3, r2
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	mov	r2, r0
	ldr	r1, [fp, #-332]
	ldr	r0, .L18+28
	bl	printf
	ldr	r3, [fp, #-332]
	add	r3, r3, #1
	str	r3, [fp, #-332]
.L14:
	ldr	r2, [fp, #-332]
	ldr	r3, [fp, #-352]
	cmp	r2, r3
	blt	.L15
.L13:
	mov	r3, #0
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.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
