	.file	"4706.c"
	.intel_syntax noprefix
	.text
	.globl	split
	.type	split, @function
split:
.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, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	DWORD PTR -12[rbp], 0
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -12[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -40[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rdx], rax
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -12[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -40[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rdx], rax
.L2:
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L3
	mov	eax, DWORD PTR -12[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	split, .-split
	.section	.rodata
.LC0:
	.string	"/tmp/fifo.s"
.LC1:
	.string	"./aux"
.LC2:
	.string	"reading from fifo"
.LC3:
	.string	" "
.LC4:
	.string	"/tmp/fifo"
.LC5:
	.string	"%s.%s"
.LC6:
	.string	"Invalid command"
.LC7:
	.string	"fork"
.LC8:
	.string	"r"
.LC9:
	.string	"ran %s\n"
	.text
	.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
	sub	rsp, 1216
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 511
	lea	rdi, .LC0[rip]
	call	access@PLT
	test	eax, eax
	je	.L6
	mov	esi, 511
	lea	rdi, .LC0[rip]
	call	mkfifo@PLT
.L6:
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1216[rbp], eax
	mov	esi, 65
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1212[rbp], eax
.L15:
	lea	rcx, -1104[rbp]
	mov	eax, DWORD PTR -1216[rbp]
	mov	edx, 30
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -1208[rbp], eax
	cmp	DWORD PTR -1208[rbp], 0
	jns	.L7
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 2
	call	exit@PLT
.L7:
	cmp	DWORD PTR -1208[rbp], 0
	je	.L15
	lea	rdx, -1184[rbp]
	lea	rax, -1104[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	split
	mov	DWORD PTR -1204[rbp], eax
	mov	eax, DWORD PTR -1204[rbp]
	cdqe
	mov	QWORD PTR -1184[rbp+rax*8], 0
	mov	rdx, QWORD PTR -1184[rbp]
	lea	rax, -1072[rbp]
	mov	rcx, rdx
	lea	rdx, .LC4[rip]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -1072[rbp]
	mov	esi, 1
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1200[rbp], eax
	cmp	DWORD PTR -1204[rbp], 1
	jg	.L9
	mov	eax, DWORD PTR -1200[rbp]
	mov	edx, 1000
	lea	rsi, .LC6[rip]
	mov	edi, eax
	call	write@PLT
	jmp	.L15
.L9:
	call	fork@PLT
	mov	DWORD PTR -1196[rbp], eax
	cmp	DWORD PTR -1196[rbp], 0
	jns	.L10
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 3
	call	exit@PLT
.L10:
	cmp	DWORD PTR -1196[rbp], 0
	jne	.L11
	mov	eax, DWORD PTR -1212[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	rax, QWORD PTR -1176[rbp]
	lea	rdx, -1184[rbp]
	add	rdx, 8
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	mov	rax, QWORD PTR -1176[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 4
	call	exit@PLT
.L11:
	mov	eax, DWORD PTR -1212[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	wait@PLT
	mov	QWORD PTR -1008[rbp], 0
	mov	QWORD PTR -1000[rbp], 0
	lea	rdx, -992[rbp]
	mov	eax, 0
	mov	ecx, 123
	mov	rdi, rdx
	rep stosq
	lea	rsi, .LC8[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -1192[rbp], rax
	jmp	.L12
.L13:
	lea	rdx, -1040[rbp]
	lea	rax, -1008[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
.L12:
	mov	rdx, QWORD PTR -1192[rbp]
	lea	rax, -1040[rbp]
	mov	esi, 30
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L13
	mov	rax, QWORD PTR -1192[rbp]
	mov	rdi, rax
	call	fclose@PLT
	lea	rcx, -1008[rbp]
	mov	eax, DWORD PTR -1200[rbp]
	mov	edx, 1000
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jle	.L15
	mov	rax, QWORD PTR -1176[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L15
	.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	"4706.c"
	.text
	.align	2
	.global	split
	.syntax unified
	.arm
	.fpu softvfp
	.type	split, %function
split:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	strtok
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	str	r2, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	b	.L2
.L3:
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	str	r2, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	str	r2, [r3]
.L2:
	ldr	r1, [fp, #-20]
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L3
	ldr	r3, [fp, #-12]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	split, .-split
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/tmp/fifo.s\000"
	.align	2
.LC1:
	.ascii	"./aux\000"
	.align	2
.LC2:
	.ascii	"reading from fifo\000"
	.align	2
.LC3:
	.ascii	" \000"
	.align	2
.LC4:
	.ascii	"/tmp/fifo\000"
	.align	2
.LC5:
	.ascii	"%s.%s\000"
	.align	2
.LC6:
	.ascii	"Invalid command\000"
	.align	2
.LC7:
	.ascii	"fork\000"
	.align	2
.LC8:
	.ascii	"r\000"
	.align	2
.LC9:
	.ascii	"ran %s\012\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1168
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1168
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L17+4
	ldr	r0, .L17+8
	bl	access
	mov	r3, r0
	cmp	r3, #0
	beq	.L6
	ldr	r1, .L17+4
	ldr	r0, .L17+8
	bl	mkfifo
.L6:
	mov	r1, #0
	ldr	r0, .L17+8
	bl	open
	str	r0, [fp, #-1172]
	mov	r1, #65
	ldr	r0, .L17+12
	bl	open
	str	r0, [fp, #-1168]
.L15:
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r2, #30
	mov	r1, r3
	ldr	r0, [fp, #-1172]
	bl	read
	str	r0, [fp, #-1164]
	ldr	r3, [fp, #-1164]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L17+16
	bl	perror
	mov	r0, #2
	bl	exit
.L7:
	ldr	r3, [fp, #-1164]
	cmp	r3, #0
	beq	.L15
	sub	r2, fp, #1136
	sub	r2, r2, #4
	sub	r2, r2, #4
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #12
	ldr	r1, .L17+20
	mov	r0, r3
	bl	split
	str	r0, [fp, #-1160]
	ldr	r3, [fp, #-1160]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3, #-1140]
	ldr	r3, [fp, #-1144]
	sub	r0, fp, #1056
	sub	r0, r0, #4
	sub	r0, r0, #12
	ldr	r2, .L17+24
	ldr	r1, .L17+28
	bl	sprintf
	sub	r3, fp, #1056
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r1, #1
	mov	r0, r3
	bl	open
	str	r0, [fp, #-1156]
	ldr	r3, [fp, #-1160]
	cmp	r3, #1
	bgt	.L9
	mov	r2, #1000
	ldr	r1, .L17+32
	ldr	r0, [fp, #-1156]
	bl	write
	b	.L15
.L9:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-1152]
	ldr	r3, [fp, #-1152]
	cmp	r3, #0
	bge	.L10
	ldr	r0, .L17+36
	bl	perror
	mov	r0, #3
	bl	exit
.L10:
	ldr	r3, [fp, #-1152]
	cmp	r3, #0
	bne	.L11
	mov	r1, #1
	ldr	r0, [fp, #-1168]
	bl	dup2
	ldr	r2, [fp, #-1140]
	sub	r3, fp, #1136
	sub	r3, r3, #4
	sub	r3, r3, #4
	add	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	execvp
	ldr	r3, [fp, #-1140]
	mov	r0, r3
	bl	perror
	mov	r0, #4
	bl	exit
.L11:
	ldr	r0, [fp, #-1168]
	bl	close
	mov	r0, #0
	bl	wait
	mov	r3, #0
	str	r3, [fp, #-1008]
	sub	r3, fp, #1004
	mov	r2, #996
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r1, .L17+40
	ldr	r0, .L17+12
	bl	fopen
	str	r0, [fp, #-1148]
	b	.L12
.L13:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #12
	sub	r2, fp, #1008
	mov	r1, r3
	mov	r0, r2
	bl	strcat
.L12:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #12
	ldr	r2, [fp, #-1148]
	mov	r1, #30
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L13
	ldr	r0, [fp, #-1148]
	bl	fclose
	sub	r3, fp, #1008
	mov	r2, #1000
	mov	r1, r3
	ldr	r0, [fp, #-1156]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	ble	.L15
	ldr	r3, [fp, #-1140]
	mov	r1, r3
	ldr	r0, .L17+44
	bl	printf
	b	.L15
.L18:
	.align	2
.L17:
	.word	.LC10
	.word	511
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
