	.file	"903315.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/dev/ptc"
	.text
	.globl	openpty
	.type	openpty, @function
openpty:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	QWORD PTR -64[rbp], rcx
	mov	QWORD PTR -72[rbp], r8
	mov	DWORD PTR -16[rbp], -1
	mov	DWORD PTR -20[rbp], -1
	cmp	QWORD PTR -48[rbp], 0
	je	.L2
	cmp	QWORD PTR -40[rbp], 0
	jne	.L3
.L2:
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 2
	mov	eax, -1
	jmp	.L4
.L3:
	mov	esi, 258
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], -1
	je	.L15
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR -16[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	mov	eax, 0
	call	ttyname@PLT
	cdqe
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L16
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 258
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	je	.L17
	mov	rax, QWORD PTR -48[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	mov	eax, 0
	call	ttyname@PLT
	cdqe
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L18
	cmp	QWORD PTR -56[rbp], 0
	je	.L10
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
.L10:
	cmp	QWORD PTR -64[rbp], 0
	je	.L11
	mov	rdx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	cmp	eax, -1
	je	.L19
.L11:
	cmp	QWORD PTR -72[rbp], 0
	je	.L12
	mov	rdx, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, 21524
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	cmp	eax, -1
	je	.L20
.L12:
	mov	eax, 0
	jmp	.L4
.L15:
	nop
	jmp	.L6
.L16:
	nop
	jmp	.L6
.L17:
	nop
	jmp	.L6
.L18:
	nop
	jmp	.L6
.L19:
	nop
	jmp	.L6
.L20:
	nop
.L6:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -16[rbp], 0
	js	.L13
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
.L13:
	cmp	DWORD PTR -20[rbp], 0
	js	.L14
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
.L14:
	call	__errno_location@PLT
	mov	edx, DWORD PTR -12[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, -1
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	openpty, .-openpty
	.globl	forkpty
	.type	forkpty, @function
forkpty:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	QWORD PTR -64[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -24[rbp], -1
	mov	DWORD PTR -20[rbp], -1
	cmp	QWORD PTR -40[rbp], 0
	jne	.L22
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 2
	mov	eax, -1
	jmp	.L28
.L22:
	mov	rdi, QWORD PTR -64[rbp]
	mov	rcx, QWORD PTR -56[rbp]
	mov	rdx, QWORD PTR -48[rbp]
	lea	rsi, -20[rbp]
	lea	rax, -24[rbp]
	mov	r8, rdi
	mov	rdi, rax
	call	openpty
	test	eax, eax
	jns	.L24
	mov	eax, -1
	jmp	.L28
.L24:
	call	fork@PLT
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], 0
	jns	.L25
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	call	__errno_location@PLT
	mov	edx, DWORD PTR -12[rbp]
	mov	DWORD PTR [rax], edx
	jmp	.L26
.L25:
	cmp	DWORD PTR -16[rbp], 0
	jne	.L27
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	mov	eax, 0
	call	login_tty
	mov	DWORD PTR -16[rbp], eax
	jmp	.L26
.L27:
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	edx, DWORD PTR -24[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
.L26:
	mov	eax, DWORD PTR -16[rbp]
.L28:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	forkpty, .-forkpty
	.globl	login_tty
	.type	login_tty, @function
login_tty:
.LFB2:
	.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	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	mov	eax, 0
	call	isatty@PLT
	cmp	eax, -1
	jne	.L31
	mov	eax, -1
	jmp	.L32
.L31:
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	eax, 0
	call	setsid@PLT
	cmp	eax, -1
	jne	.L33
	mov	eax, -1
	jmp	.L32
.L33:
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	mov	eax, 0
	call	ttyname@PLT
	cdqe
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L34
	mov	eax, -1
	jmp	.L32
.L34:
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L35
	mov	eax, -1
	jmp	.L32
.L35:
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
	cmp	eax, -1
	jne	.L36
	mov	eax, -1
	jmp	.L32
.L36:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 1
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
	cmp	eax, -1
	jne	.L37
	mov	eax, -1
	jmp	.L32
.L37:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 2
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
	cmp	eax, -1
	jne	.L38
	mov	eax, -1
	jmp	.L32
.L38:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	eax, 0
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	login_tty, .-login_tty
	.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	"903315.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/dev/ptc\000"
	.text
	.align	2
	.global	openpty
	.syntax unified
	.arm
	.fpu softvfp
	.type	openpty, %function
openpty:
	@ args = 4, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	str	r3, [fp, #-36]
	mvn	r3, #0
	str	r3, [fp, #-16]
	mvn	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L2
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L3
.L2:
	bl	__errno_location
	mov	r3, r0
	mov	r2, #2
	str	r2, [r3]
	mvn	r3, #0
	b	.L4
.L3:
	ldr	r1, .L21
	ldr	r0, .L21+4
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	beq	.L15
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r0, [fp, #-16]
	bl	ttyname
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L16
	ldr	r1, .L21
	ldr	r0, [fp, #-12]
	bl	open
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	beq	.L17
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	ldr	r0, [fp, #-20]
	bl	ttyname
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L18
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L10
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-32]
	bl	strcpy
.L10:
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	beq	.L11
	ldr	r2, [fp, #-36]
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	tcsetattr
	mov	r3, r0
	cmn	r3, #1
	beq	.L19
.L11:
	ldr	r3, [fp, #4]
	cmp	r3, #0
	beq	.L12
	ldr	r2, [fp, #4]
	ldr	r1, .L21+8
	ldr	r0, [fp, #-16]
	bl	ioctl
	mov	r3, r0
	cmn	r3, #1
	beq	.L20
.L12:
	mov	r3, #0
	b	.L4
.L15:
	nop
	b	.L6
.L16:
	nop
	b	.L6
.L17:
	nop
	b	.L6
.L18:
	nop
	b	.L6
.L19:
	nop
	b	.L6
.L20:
	nop
.L6:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	blt	.L13
	ldr	r0, [fp, #-16]
	bl	close
.L13:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	blt	.L14
	ldr	r0, [fp, #-20]
	bl	close
.L14:
	bl	__errno_location
	mov	r2, r0
	ldr	r3, [fp, #-8]
	str	r3, [r2]
	mvn	r3, #0
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	258
	.word	.LC0
	.word	21524
	.size	openpty, .-openpty
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	forkpty
	.syntax unified
	.arm
	.fpu softvfp
	.type	forkpty, %function
forkpty:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	str	r3, [fp, #-44]
	ldr	r3, .L32
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mvn	r3, #0
	str	r3, [fp, #-24]
	mvn	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L24
	bl	__errno_location
	mov	r3, r0
	mov	r2, #2
	str	r2, [r3]
	mvn	r3, #0
	b	.L30
.L24:
	sub	r1, fp, #20
	sub	r0, fp, #24
	ldr	r3, [fp, #-44]
	str	r3, [sp]
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-36]
	bl	openpty
	mov	r3, r0
	cmp	r3, #0
	bge	.L26
	mvn	r3, #0
	b	.L30
.L26:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L27
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
	bl	__errno_location
	mov	r2, r0
	ldr	r3, [fp, #-12]
	str	r3, [r2]
	b	.L28
.L27:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L29
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	login_tty
	str	r0, [fp, #-16]
	b	.L28
.L29:
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-32]
	str	r2, [r3]
.L28:
	ldr	r3, [fp, #-16]
.L30:
	ldr	r2, .L32
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L31
	bl	__stack_chk_fail
.L31:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L33:
	.align	2
.L32:
	.word	.LC1
	.size	forkpty, .-forkpty
	.align	2
	.global	login_tty
	.syntax unified
	.arm
	.fpu softvfp
	.type	login_tty, %function
login_tty:
	@ 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]
	ldr	r0, [fp, #-16]
	bl	isatty
	mov	r3, r0
	cmn	r3, #1
	bne	.L35
	mvn	r3, #0
	b	.L36
.L35:
	mov	r1, #3
	ldr	r0, [fp, #-16]
	bl	fcntl
	bl	setsid
	mov	r3, r0
	cmn	r3, #1
	bne	.L37
	mvn	r3, #0
	b	.L36
.L37:
	ldr	r0, [fp, #-16]
	bl	ttyname
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L38
	mvn	r3, #0
	b	.L36
.L38:
	mov	r1, #2
	ldr	r0, [fp, #-12]
	bl	open
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L39
	mvn	r3, #0
	b	.L36
.L39:
	ldr	r0, [fp, #-16]
	bl	close
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	dup2
	mov	r3, r0
	cmn	r3, #1
	bne	.L40
	mvn	r3, #0
	b	.L36
.L40:
	mov	r1, #1
	ldr	r0, [fp, #-8]
	bl	dup2
	mov	r3, r0
	cmn	r3, #1
	bne	.L41
	mvn	r3, #0
	b	.L36
.L41:
	mov	r1, #2
	ldr	r0, [fp, #-8]
	bl	dup2
	mov	r3, r0
	cmn	r3, #1
	bne	.L42
	mvn	r3, #0
	b	.L36
.L42:
	ldr	r0, [fp, #-8]
	bl	close
	mov	r3, #0
.L36:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	login_tty, .-login_tty
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
