	.file	"459427.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"-out"
.LC2:
	.string	"-err"
.LC3:
	.string	"--"
	.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
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	call	getpid@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	fflush@PLT
	cmp	DWORD PTR -52[rbp], 1
	jg	.L2
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	call	print_usage_info_and_exit
.L2:
	mov	DWORD PTR -40[rbp], 0
	mov	eax, DWORD PTR -52[rbp]
	add	eax, 1
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L3
	mov	edi, 901
	call	exit@PLT
.L3:
	mov	DWORD PTR -36[rbp], 1
	mov	DWORD PTR -32[rbp], 1
	jmp	.L4
.L8:
	cmp	DWORD PTR -32[rbp], 0
	je	.L5
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L5
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rbx, QWORD PTR [rax]
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fileno@PLT
	mov	rsi, rbx
	mov	edi, eax
	call	redirect
	add	DWORD PTR -36[rbp], 2
	jmp	.L4
.L5:
	cmp	DWORD PTR -32[rbp], 0
	je	.L6
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L6
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rbx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rdi, rax
	call	fileno@PLT
	mov	rsi, rbx
	mov	edi, eax
	call	redirect
	add	DWORD PTR -36[rbp], 2
	jmp	.L4
.L6:
	cmp	DWORD PTR -32[rbp], 0
	je	.L7
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L7
	mov	DWORD PTR -32[rbp], 0
	add	DWORD PTR -36[rbp], 1
	jmp	.L4
.L7:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR -40[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*8]
	mov	rdx, QWORD PTR -24[rbp]
	lea	rbx, [rcx+rdx]
	mov	rdi, rax
	call	strdup@PLT
	mov	QWORD PTR [rbx], rax
	add	DWORD PTR -40[rbp], 1
	add	DWORD PTR -36[rbp], 1
.L4:
	mov	eax, DWORD PTR -36[rbp]
	cmp	eax, DWORD PTR -52[rbp]
	jl	.L8
	cmp	DWORD PTR -40[rbp], 0
	jne	.L9
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	call	print_usage_info_and_exit
.L9:
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	mov	edi, 902
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.string	"Usage info:\n\t%s <application to start>\n\t\t[-out <stderr|path to file>] [-err <stdin|path to file>]\n\t\t[arg0 [arg1 ...]]\n\n"
	.text
	.globl	print_usage_info_and_exit
	.type	print_usage_info_and_exit, @function
print_usage_info_and_exit:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	print_usage_info_and_exit, .-print_usage_info_and_exit
	.section	.rodata
.LC5:
	.string	"stdout"
.LC6:
	.string	"stderr"
	.text
	.globl	redirect
	.type	redirect, @function
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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L12
	mov	DWORD PTR -4[rbp], 1
	jmp	.L13
.L12:
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L14
	mov	DWORD PTR -4[rbp], 2
	jmp	.L13
.L14:
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 416
	mov	esi, 1089
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L13
	mov	edi, 903
	call	exit@PLT
.L13:
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, edx
	mov	edi, eax
	call	dup2@PLT
	cmp	eax, -1
	jne	.L16
	mov	edi, 904
	call	exit@PLT
.L16:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	redirect, .-redirect
	.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	"459427.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d\012\000"
	.align	2
.LC1:
	.ascii	"-out\000"
	.align	2
.LC2:
	.ascii	"-err\000"
	.align	2
.LC3:
	.ascii	"--\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	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	bl	getpid
	str	r0, [fp, #-20]
	ldr	r1, [fp, #-20]
	ldr	r0, .L10
	bl	printf
	mov	r0, #0
	bl	fflush
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	bgt	.L2
	ldr	r3, [fp, #-44]
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	print_usage_info_and_exit
.L2:
	mov	r3, #0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L3
	ldr	r0, .L10+4
	bl	exit
.L3:
	mov	r3, #1
	str	r3, [fp, #-28]
	mov	r3, #1
	str	r3, [fp, #-24]
	b	.L4
.L8:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L10+8
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L10+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	fileno
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	bl	redirect
	ldr	r3, [fp, #-28]
	add	r3, r3, #2
	str	r3, [fp, #-28]
	b	.L4
.L5:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L6
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L10+16
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L10+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	fileno
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	bl	redirect
	ldr	r3, [fp, #-28]
	add	r3, r3, #2
	str	r3, [fp, #-28]
	b	.L4
.L6:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L7
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L10+24
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
	b	.L4
.L7:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r4, r2, r3
	mov	r0, r1
	bl	strdup
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L4:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L8
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L9
	ldr	r3, [fp, #-44]
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	print_usage_info_and_exit
.L9:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	execvp
	ldr	r0, .L10+28
	bl	exit
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	901
	.word	.LC1
	.word	stdout
	.word	.LC2
	.word	stderr
	.word	.LC3
	.word	902
	.size	main, .-main
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Usage info:\012\011%s <application to start>\012\011"
	.ascii	"\011[-out <stderr|path to file>] [-err <stdin|path "
	.ascii	"to file>]\012\011\011[arg0 [arg1 ...]]\012\012\000"
	.text
	.align	2
	.global	print_usage_info_and_exit
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_usage_info_and_exit, %function
print_usage_info_and_exit:
	@ 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]
	ldr	r1, [fp, #-8]
	ldr	r0, .L13
	bl	printf
	ldr	r0, [fp, #-12]
	bl	exit
.L14:
	.align	2
.L13:
	.word	.LC4
	.size	print_usage_info_and_exit, .-print_usage_info_and_exit
	.section	.rodata
	.align	2
.LC5:
	.ascii	"stdout\000"
	.align	2
.LC6:
	.ascii	"stderr\000"
	.text
	.align	2
	.global	redirect
	.syntax unified
	.arm
	.fpu softvfp
	.type	redirect, %function
redirect:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r1, [fp, #-20]
	ldr	r0, .L21
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L16
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L17
.L16:
	ldr	r1, [fp, #-20]
	ldr	r0, .L21+4
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L18
	mov	r3, #2
	str	r3, [fp, #-8]
	b	.L17
.L18:
	mov	r2, #416
	ldr	r1, .L21+8
	ldr	r0, [fp, #-20]
	bl	open
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L17
	ldr	r0, .L21+12
	bl	exit
.L17:
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-8]
	bl	dup2
	mov	r3, r0
	cmn	r3, #1
	bne	.L20
	mov	r0, #904
	bl	exit
.L20:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC5
	.word	.LC6
	.word	1089
	.word	903
	.size	redirect, .-redirect
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
