	.file	"995643.c"
	.intel_syntax noprefix
	.text
	.globl	getenv_safe
	.type	getenv_safe, @function
getenv_safe:
.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	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	getenv@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L2
	mov	rax, QWORD PTR -8[rbp]
	jmp	.L4
.L2:
	mov	rax, QWORD PTR -32[rbp]
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	getenv_safe, .-getenv_safe
	.section	.rodata
.LC0:
	.string	"/dev/null"
.LC1:
	.string	"--"
.LC2:
	.string	"which"
	.text
	.globl	is_existing_shell
	.type	is_existing_shell, @function
is_existing_shell:
.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	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	fork@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	jns	.L6
	mov	eax, 0
	jmp	.L11
.L6:
	cmp	DWORD PTR -12[rbp], 0
	jne	.L8
	mov	edi, 0
	call	close@PLT
	mov	edi, 1
	call	close@PLT
	mov	edi, 2
	call	close@PLT
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	esi, 1
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	esi, 1
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	r8d, 0
	mov	rcx, rax
	lea	rdx, .LC1[rip]
	lea	rsi, .LC2[rip]
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	execlp@PLT
	mov	edi, 127
	call	exit@PLT
.L8:
	lea	rcx, -16[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	mov	eax, DWORD PTR -16[rbp]
	and	eax, 127
	test	eax, eax
	jne	.L9
	mov	eax, DWORD PTR -16[rbp]
	sar	eax, 8
	movzx	eax, al
	test	eax, eax
	jne	.L9
	mov	eax, 1
	jmp	.L10
.L9:
	mov	eax, 0
.L10:
	and	eax, 1
.L11:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	is_existing_shell, .-is_existing_shell
	.section	.rodata
.LC3:
	.string	"SORTIX_SH_BACKEND"
.LC4:
	.string	"/etc/proper-shells"
.LC5:
	.string	"SORTIX_SH_BACKENDS_DIR"
.LC6:
	.string	"."
.LC7:
	.string	".."
.LC8:
	.string	"r"
	.text
	.globl	search_for_proper_shell
	.type	search_for_proper_shell, @function
search_for_proper_shell:
.LFB8:
	.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, 120
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rdi, .LC3[rip]
	call	getenv@PLT
	test	rax, rax
	je	.L14
	lea	rdi, .LC3[rip]
	call	getenv@PLT
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L15
	mov	eax, 0
	jmp	.L32
.L15:
	lea	rdi, .LC3[rip]
	call	getenv@PLT
	mov	rdi, rax
	call	is_existing_shell
	test	al, al
	je	.L14
	lea	rdi, .LC3[rip]
	call	getenv@PLT
	mov	rdi, rax
	call	strdup@PLT
	jmp	.L32
.L14:
	lea	rsi, .LC4[rip]
	lea	rdi, .LC5[rip]
	call	getenv_safe
	mov	QWORD PTR -80[rbp], rax
	lea	rsi, -104[rbp]
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR alphasort@GOTPCREL[rip]
	mov	rcx, rdx
	mov	edx, 0
	mov	rdi, rax
	call	scandir@PLT
	mov	DWORD PTR -108[rbp], eax
	cmp	DWORD PTR -108[rbp], 0
	js	.L17
	mov	QWORD PTR -96[rbp], 0
	mov	DWORD PTR -116[rbp], 0
	jmp	.L18
.L28:
	mov	rdx, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -72[rbp]
	add	rax, 19
	mov	QWORD PTR -64[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L34
	mov	rax, QWORD PTR -64[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L34
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rbx, rax
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	strlen@PLT
	add	rax, rbx
	add	rax, 1
	mov	QWORD PTR -56[rbp], rax
	mov	rax, QWORD PTR -56[rbp]
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	je	.L35
	mov	rdx, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stpcpy@PLT
	mov	WORD PTR [rax], 47
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -64[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	strcpy@PLT
	mov	rax, QWORD PTR -48[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	free@PLT
	cmp	QWORD PTR -40[rbp], 0
	je	.L36
	mov	QWORD PTR -88[rbp], 0
	mov	rdx, QWORD PTR -40[rbp]
	lea	rcx, -88[rbp]
	lea	rax, -96[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	getline@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	fclose@PLT
	cmp	QWORD PTR -32[rbp], 0
	js	.L37
	cmp	QWORD PTR -32[rbp], 0
	je	.L25
	mov	rdx, QWORD PTR -96[rbp]
	mov	rax, QWORD PTR -32[rbp]
	sub	rax, 1
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 10
	jne	.L25
	mov	rdx, QWORD PTR -96[rbp]
	sub	QWORD PTR -32[rbp], 1
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
.L25:
	mov	rax, QWORD PTR -96[rbp]
	mov	rdi, rax
	call	is_existing_shell
	xor	eax, 1
	test	al, al
	je	.L38
	mov	rax, QWORD PTR -96[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR -96[rbp], 0
	jmp	.L21
.L34:
	nop
	jmp	.L21
.L35:
	nop
	jmp	.L21
.L36:
	nop
	jmp	.L21
.L37:
	nop
.L21:
	add	DWORD PTR -116[rbp], 1
.L18:
	mov	eax, DWORD PTR -116[rbp]
	cmp	eax, DWORD PTR -108[rbp]
	jl	.L28
	jmp	.L27
.L38:
	nop
.L27:
	mov	DWORD PTR -112[rbp], 0
	jmp	.L29
.L30:
	mov	rdx, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	free@PLT
	add	DWORD PTR -112[rbp], 1
.L29:
	mov	eax, DWORD PTR -112[rbp]
	cmp	eax, DWORD PTR -108[rbp]
	jl	.L30
	mov	rax, QWORD PTR -104[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -96[rbp]
	test	rax, rax
	je	.L17
	mov	rax, QWORD PTR -96[rbp]
	jmp	.L32
.L17:
	mov	eax, 0
.L32:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	search_for_proper_shell, .-search_for_proper_shell
	.section	.rodata
.LC9:
	.string	"sortix-sh"
	.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	cmp	DWORD PTR -20[rbp], 1
	jne	.L40
	mov	edi, 0
	call	isatty@PLT
	test	eax, eax
	je	.L40
	mov	edi, 1
	call	isatty@PLT
	test	eax, eax
	je	.L40
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	call	execvp@PLT
.L40:
	call	search_for_proper_shell
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L41
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
.L41:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	call	execvp@PLT
	mov	eax, 127
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	"995643.c"
	.text
	.align	2
	.global	getenv_safe
	.syntax unified
	.arm
	.fpu softvfp
	.type	getenv_safe, %function
getenv_safe:
	@ 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	r0, [fp, #-16]
	bl	getenv
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L2
	ldr	r3, [fp, #-8]
	b	.L4
.L2:
	ldr	r3, [fp, #-20]
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	getenv_safe, .-getenv_safe
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/dev/null\000"
	.align	2
.LC1:
	.ascii	"--\000"
	.align	2
.LC2:
	.ascii	"which\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	is_existing_shell
	.syntax unified
	.arm
	.fpu softvfp
	.type	is_existing_shell, %function
is_existing_shell:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L6
	mov	r3, #0
	b	.L11
.L6:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L8
	mov	r0, #0
	bl	close
	mov	r0, #1
	bl	close
	mov	r0, #2
	bl	close
	mov	r1, #0
	ldr	r0, .L13+4
	bl	open
	mov	r1, #1
	ldr	r0, .L13+4
	bl	open
	mov	r1, #1
	ldr	r0, .L13+4
	bl	open
	mov	r3, #0
	str	r3, [sp]
	ldr	r3, [fp, #-24]
	ldr	r2, .L13+8
	ldr	r1, .L13+12
	ldr	r0, .L13+12
	bl	execlp
	mov	r0, #127
	bl	exit
.L8:
	sub	r3, fp, #16
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	waitpid
	ldr	r3, [fp, #-16]
	and	r3, r3, #127
	cmp	r3, #0
	bne	.L9
	ldr	r3, [fp, #-16]
	asr	r3, r3, #8
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L9
	mov	r3, #1
	b	.L10
.L9:
	mov	r3, #0
.L10:
	and	r3, r3, #1
	and	r3, r3, #255
.L11:
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	is_existing_shell, .-is_existing_shell
	.section	.rodata
	.align	2
.LC4:
	.ascii	"SORTIX_SH_BACKEND\000"
	.align	2
.LC5:
	.ascii	"/etc/proper-shells\000"
	.align	2
.LC6:
	.ascii	"SORTIX_SH_BACKENDS_DIR\000"
	.align	2
.LC7:
	.ascii	".\000"
	.align	2
.LC8:
	.ascii	"..\000"
	.align	2
.LC9:
	.ascii	"/\000"
	.align	2
.LC10:
	.ascii	"r\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	search_for_proper_shell
	.syntax unified
	.arm
	.fpu softvfp
	.type	search_for_proper_shell, %function
search_for_proper_shell:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #60
	ldr	r3, .L41
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r0, .L41+4
	bl	getenv
	mov	r3, r0
	cmp	r3, #0
	beq	.L16
	ldr	r0, .L41+4
	bl	getenv
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L17
	mov	r3, #0
	b	.L34
.L17:
	ldr	r0, .L41+4
	bl	getenv
	mov	r3, r0
	mov	r0, r3
	bl	is_existing_shell
	mov	r3, r0
	cmp	r3, #0
	beq	.L16
	ldr	r0, .L41+4
	bl	getenv
	mov	r3, r0
	mov	r0, r3
	bl	strdup
	mov	r3, r0
	b	.L34
.L16:
	ldr	r1, .L41+8
	ldr	r0, .L41+12
	bl	getenv_safe
	str	r0, [fp, #-48]
	sub	r1, fp, #68
	ldr	r3, .L41+16
	mov	r2, #0
	ldr	r0, [fp, #-48]
	bl	scandir
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	blt	.L19
	mov	r3, #0
	str	r3, [fp, #-64]
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L20
.L30:
	ldr	r2, [fp, #-68]
	ldr	r3, [fp, #-56]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	add	r3, r3, #11
	str	r3, [fp, #-36]
	ldr	r1, .L41+20
	ldr	r0, [fp, #-36]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L36
	ldr	r1, .L41+24
	ldr	r0, [fp, #-36]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L36
	ldr	r0, [fp, #-48]
	bl	strlen
	mov	r4, r0
	ldr	r0, [fp, #-36]
	bl	strlen
	mov	r3, r0
	add	r3, r4, r3
	add	r3, r3, #1
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L37
	ldr	r1, [fp, #-48]
	ldr	r0, [fp, #-28]
	bl	stpcpy
	mov	r4, r0
	ldr	r3, .L41+28
	mov	r0, r4
	mov	r1, r3
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
	add	r3, r4, #1
	ldr	r1, [fp, #-36]
	mov	r0, r3
	bl	strcpy
	ldr	r1, .L41+32
	ldr	r0, [fp, #-28]
	bl	fopen
	str	r0, [fp, #-24]
	ldr	r0, [fp, #-28]
	bl	free
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L38
	mov	r3, #0
	str	r3, [fp, #-60]
	sub	r1, fp, #60
	sub	r3, fp, #64
	ldr	r2, [fp, #-24]
	mov	r0, r3
	bl	getline
	str	r0, [fp, #-20]
	ldr	r0, [fp, #-24]
	bl	fclose
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	blt	.L39
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L27
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L27
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
.L27:
	ldr	r3, [fp, #-64]
	mov	r0, r3
	bl	is_existing_shell
	mov	r3, r0
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	beq	.L40
	ldr	r3, [fp, #-64]
	mov	r0, r3
	bl	free
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L23
.L36:
	nop
	b	.L23
.L37:
	nop
	b	.L23
.L38:
	nop
	b	.L23
.L39:
	nop
.L23:
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L20:
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	blt	.L30
	b	.L29
.L40:
	nop
.L29:
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L31
.L32:
	ldr	r2, [fp, #-68]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L31:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	blt	.L32
	ldr	r3, [fp, #-68]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	beq	.L19
	ldr	r3, [fp, #-64]
	b	.L34
.L19:
	mov	r3, #0
.L34:
	ldr	r2, .L41
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L35
	bl	__stack_chk_fail
.L35:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L42:
	.align	2
.L41:
	.word	.LC11
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	alphasort
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	search_for_proper_shell, .-search_for_proper_shell
	.section	.rodata
	.align	2
.LC12:
	.ascii	"sortix-sh\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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	r3, [fp, #-16]
	cmp	r3, #1
	bne	.L44
	mov	r0, #0
	bl	isatty
	mov	r3, r0
	cmp	r3, #0
	beq	.L44
	mov	r0, #1
	bl	isatty
	mov	r3, r0
	cmp	r3, #0
	beq	.L44
	ldr	r1, [fp, #-20]
	ldr	r0, .L47
	bl	execvp
.L44:
	bl	search_for_proper_shell
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L45
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-8]
	bl	execvp
.L45:
	ldr	r0, [fp, #-8]
	bl	free
	ldr	r1, [fp, #-20]
	ldr	r0, .L47
	bl	execvp
	mov	r3, #127
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L48:
	.align	2
.L47:
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
