	.file	"526046.c"
	.intel_syntax noprefix
	.text
	.globl	ttyslot
	.type	ttyslot, @function
ttyslot:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	sub	rsp, 8
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	edi, 0
	call	ttyname@PLT
	mov	rbx, rax
	test	rbx, rbx
	jne	.L2
	mov	edi, 1
	call	ttyname@PLT
	mov	rbx, rax
	test	rbx, rbx
	jne	.L2
	mov	edi, 2
	call	ttyname@PLT
	mov	rbx, rax
	test	rbx, rbx
	jne	.L2
	mov	eax, 0
	jmp	.L3
.L2:
	mov	esi, 47
	mov	rdi, rbx
	call	strrchr@PLT
	mov	r12, rax
	test	r12, r12
	jne	.L4
	mov	r12, rbx
	jmp	.L5
.L4:
	add	r12, 1
.L5:
	call	setttyent@PLT
	mov	ebx, 0
	jmp	.L6
.L7:
	add	ebx, 1
	mov	rax, QWORD PTR 0[r13]
	mov	rsi, r12
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L6
	call	endttyent@PLT
	mov	eax, ebx
	jmp	.L3
.L6:
	call	getttyent@PLT
	mov	r13, rax
	test	r13, r13
	jne	.L7
	call	endttyent@PLT
	mov	eax, 0
.L3:
	add	rsp, 8
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ttyslot, .-ttyslot
	.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	"526046.c"
	.text
	.align	2
	.global	ttyslot
	.syntax unified
	.arm
	.fpu softvfp
	.type	ttyslot, %function
ttyslot:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	mov	r0, #0
	bl	ttyname
	mov	r4, r0
	cmp	r4, #0
	bne	.L2
	mov	r0, #1
	bl	ttyname
	mov	r4, r0
	cmp	r4, #0
	bne	.L2
	mov	r0, #2
	bl	ttyname
	mov	r4, r0
	cmp	r4, #0
	bne	.L2
	mov	r3, #0
	b	.L3
.L2:
	mov	r1, #47
	mov	r0, r4
	bl	strrchr
	mov	r5, r0
	cmp	r5, #0
	bne	.L4
	mov	r5, r4
	b	.L5
.L4:
	add	r5, r5, #1
.L5:
	bl	setttyent
	mov	r4, #0
	b	.L6
.L7:
	add	r4, r4, #1
	ldr	r3, [r6]
	mov	r1, r5
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	bl	endttyent
	mov	r3, r4
	b	.L3
.L6:
	bl	getttyent
	mov	r6, r0
	cmp	r6, #0
	bne	.L7
	bl	endttyent
	mov	r3, #0
.L3:
	mov	r0, r3
	pop	{r4, r5, r6, r7, fp, pc}
	.size	ttyslot, .-ttyslot
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
