	.file	"778126.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"fork"
	.text
	.globl	fpopen
	.type	fpopen, @function
fpopen:
.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, 2128
	mov	QWORD PTR -2120[rbp], rdi
	mov	QWORD PTR -2128[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -2112[rbp], 0
	mov	QWORD PTR -2096[rbp], 0
	mov	DWORD PTR -2104[rbp], 0
	cmp	QWORD PTR -2128[rbp], 0
	jne	.L2
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 14
	mov	eax, 0
	jmp	.L22
.L2:
	mov	rax, QWORD PTR -2128[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	cmp	eax, 114
	je	.L4
	cmp	eax, 119
	je	.L5
	jmp	.L24
.L4:
	mov	DWORD PTR -2108[rbp], 0
	jmp	.L7
.L5:
	mov	DWORD PTR -2108[rbp], 1
	jmp	.L7
.L24:
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 22
	mov	eax, 0
	jmp	.L22
.L7:
	mov	rax, QWORD PTR -2128[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	cmp	eax, 38
	jne	.L8
	mov	DWORD PTR -2104[rbp], 1
.L8:
	mov	rax, QWORD PTR -2120[rbp]
	mov	rdi, rax
	call	strlen@PLT
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -2080[rbp], rax
	cmp	QWORD PTR -2080[rbp], 0
	jne	.L9
	mov	eax, 0
	jmp	.L22
.L9:
	mov	rdx, QWORD PTR -2120[rbp]
	mov	rax, QWORD PTR -2080[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	rax, QWORD PTR -2080[rbp]
	mov	QWORD PTR -2088[rbp], rax
	jmp	.L10
.L14:
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -2088[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	rax, al
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 8192
	test	eax, eax
	je	.L11
	add	QWORD PTR -2088[rbp], 1
	jmp	.L10
.L11:
	cmp	DWORD PTR -2112[rbp], 0
	jne	.L12
	mov	rax, QWORD PTR -2088[rbp]
	mov	QWORD PTR -2096[rbp], rax
.L12:
	mov	eax, DWORD PTR -2112[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -2112[rbp], edx
	cdqe
	mov	rdx, QWORD PTR -2088[rbp]
	mov	QWORD PTR -2064[rbp+rax*8], rdx
	mov	rax, QWORD PTR -2088[rbp]
	mov	esi, 32
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -2088[rbp], rax
	cmp	QWORD PTR -2088[rbp], 0
	je	.L10
	mov	rax, QWORD PTR -2088[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -2088[rbp], rdx
	mov	BYTE PTR [rax], 0
.L10:
	cmp	QWORD PTR -2088[rbp], 0
	je	.L13
	mov	rax, QWORD PTR -2088[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L14
.L13:
	mov	eax, DWORD PTR -2112[rbp]
	cdqe
	mov	QWORD PTR -2064[rbp+rax*8], 0
	lea	rax, -2072[rbp]
	mov	rdi, rax
	call	pipe@PLT
	test	eax, eax
	jns	.L15
	mov	eax, 0
	jmp	.L22
.L15:
	call	fork@PLT
	mov	DWORD PTR -2100[rbp], eax
	cmp	DWORD PTR -2100[rbp], 0
	jns	.L16
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L22
.L16:
	cmp	DWORD PTR -2100[rbp], 0
	jne	.L17
	cmp	DWORD PTR -2108[rbp], 0
	je	.L18
	mov	eax, DWORD PTR -2068[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -2072[rbp]
	mov	esi, 0
	mov	edi, eax
	call	dup2@PLT
	jmp	.L19
.L18:
	mov	eax, DWORD PTR -2072[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -2068[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	cmp	DWORD PTR -2104[rbp], 0
	je	.L19
	mov	eax, DWORD PTR -2068[rbp]
	mov	esi, 2
	mov	edi, eax
	call	dup2@PLT
.L19:
	lea	rdx, -2064[rbp]
	mov	rax, QWORD PTR -2096[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	mov	rax, QWORD PTR -2096[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L17:
	cmp	DWORD PTR -2108[rbp], 0
	je	.L20
	mov	eax, DWORD PTR -2068[rbp]
	jmp	.L21
.L20:
	mov	eax, DWORD PTR -2072[rbp]
.L21:
	mov	rdx, QWORD PTR -2128[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fdopen@PLT
.L22:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fpopen, .-fpopen
	.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	"778126.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"fork\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	fpopen
	.syntax unified
	.arm
	.fpu softvfp
	.type	fpopen, %function
fpopen:
	@ args = 0, pretend = 0, frame = 1072
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1072
	str	r0, [fp, #-1072]
	str	r1, [fp, #-1076]
	ldr	r3, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-1068]
	mov	r3, #0
	str	r3, [fp, #-1064]
	mov	r3, #0
	str	r3, [fp, #-1052]
	ldr	r3, [fp, #-1076]
	cmp	r3, #0
	bne	.L2
	bl	__errno_location
	mov	r3, r0
	mov	r2, #14
	str	r2, [r3]
	mov	r3, #0
	b	.L22
.L2:
	ldr	r3, [fp, #-1076]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #114
	beq	.L4
	cmp	r3, #119
	beq	.L5
	b	.L24
.L4:
	mov	r3, #0
	str	r3, [fp, #-1056]
	b	.L7
.L5:
	mov	r3, #1
	str	r3, [fp, #-1056]
	b	.L7
.L24:
	bl	__errno_location
	mov	r3, r0
	mov	r2, #22
	str	r2, [r3]
	mov	r3, #0
	b	.L22
.L7:
	ldr	r3, [fp, #-1076]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #38
	bne	.L8
	mov	r3, #1
	str	r3, [fp, #-1052]
.L8:
	ldr	r0, [fp, #-1072]
	bl	strlen
	mov	r3, r0
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-1048]
	ldr	r3, [fp, #-1048]
	cmp	r3, #0
	bne	.L9
	mov	r3, #0
	b	.L22
.L9:
	ldr	r1, [fp, #-1072]
	ldr	r0, [fp, #-1048]
	bl	strcpy
	ldr	r3, [fp, #-1048]
	str	r3, [fp, #-1060]
	b	.L10
.L14:
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldr	r3, [fp, #-1060]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	and	r3, r3, #8192
	cmp	r3, #0
	beq	.L11
	ldr	r3, [fp, #-1060]
	add	r3, r3, #1
	str	r3, [fp, #-1060]
	b	.L10
.L11:
	ldr	r3, [fp, #-1068]
	cmp	r3, #0
	bne	.L12
	ldr	r3, [fp, #-1060]
	str	r3, [fp, #-1064]
.L12:
	ldr	r3, [fp, #-1068]
	add	r2, r3, #1
	str	r2, [fp, #-1068]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-1060]
	str	r2, [r3, #-1028]
	mov	r1, #32
	ldr	r0, [fp, #-1060]
	bl	strchr
	str	r0, [fp, #-1060]
	ldr	r3, [fp, #-1060]
	cmp	r3, #0
	beq	.L10
	ldr	r3, [fp, #-1060]
	add	r2, r3, #1
	str	r2, [fp, #-1060]
	mov	r2, #0
	strb	r2, [r3]
.L10:
	ldr	r3, [fp, #-1060]
	cmp	r3, #0
	beq	.L13
	ldr	r3, [fp, #-1060]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L14
.L13:
	ldr	r3, [fp, #-1068]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3, #-1028]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmp	r3, #0
	bge	.L15
	mov	r3, #0
	b	.L22
.L15:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	bge	.L16
	ldr	r0, .L25+4
	bl	perror
	mov	r3, #0
	b	.L22
.L16:
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	bne	.L17
	ldr	r3, [fp, #-1056]
	cmp	r3, #0
	beq	.L18
	ldr	r3, [fp, #-1036]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-1040]
	mov	r1, #0
	mov	r0, r3
	bl	dup2
	b	.L19
.L18:
	ldr	r3, [fp, #-1040]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-1036]
	mov	r1, #1
	mov	r0, r3
	bl	dup2
	ldr	r3, [fp, #-1052]
	cmp	r3, #0
	beq	.L19
	ldr	r3, [fp, #-1036]
	mov	r1, #2
	mov	r0, r3
	bl	dup2
.L19:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1064]
	bl	execvp
	ldr	r0, [fp, #-1064]
	bl	perror
	mov	r0, #1
	bl	exit
.L17:
	ldr	r3, [fp, #-1056]
	cmp	r3, #0
	beq	.L20
	ldr	r3, [fp, #-1036]
	b	.L21
.L20:
	ldr	r3, [fp, #-1040]
.L21:
	ldr	r1, [fp, #-1076]
	mov	r0, r3
	bl	fdopen
	mov	r3, r0
.L22:
	ldr	r2, .L25
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC1
	.word	.LC0
	.size	fpopen, .-fpopen
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
