	.file	"180097.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/dev/ptmx"
	.text
	.type	_internal_get_pty, @function
_internal_get_pty:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	esi, 258
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L2
	mov	eax, -1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	mov	eax, 0
	call	grantpt@PLT
	test	eax, eax
	je	.L4
	mov	eax, -1
	jmp	.L3
.L4:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	mov	eax, 0
	call	unlockpt@PLT
	test	eax, eax
	je	.L5
	mov	eax, -1
	jmp	.L3
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	mov	eax, 0
	call	ptsname@PLT
	cdqe
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L6
	mov	eax, -1
	jmp	.L3
.L6:
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	_internal_get_pty, .-_internal_get_pty
	.type	_internal_get_tty, @function
_internal_get_tty:
.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, 48
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	QWORD PTR -24[rbp], rdx
	mov	QWORD PTR -32[rbp], rcx
	mov	DWORD PTR -36[rbp], r8d
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 258
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L8
	mov	eax, -1
	jmp	.L9
.L8:
	cmp	DWORD PTR -36[rbp], 0
	je	.L10
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edx, 0
	mov	esi, 21518
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	cmp	eax, -1
	jne	.L10
	mov	eax, -1
	jmp	.L9
.L10:
	cmp	QWORD PTR -24[rbp], 0
	je	.L11
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	esi, 2
	mov	edi, eax
	call	tcsetattr@PLT
.L11:
	cmp	QWORD PTR -32[rbp], 0
	je	.L12
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	rdx, QWORD PTR -32[rbp]
	mov	esi, 21524
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
.L12:
	mov	eax, 0
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	_internal_get_tty, .-_internal_get_tty
	.globl	openpty
	.type	openpty, @function
openpty:
.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, 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	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
	je	.L14
	cmp	QWORD PTR -48[rbp], 0
	jne	.L15
.L14:
	mov	eax, -1
	jmp	.L23
.L15:
	lea	rdx, -16[rbp]
	lea	rax, -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	_internal_get_pty
	test	eax, eax
	jne	.L25
	mov	rsi, QWORD PTR -16[rbp]
	mov	rcx, QWORD PTR -72[rbp]
	mov	rdx, QWORD PTR -64[rbp]
	lea	rax, -20[rbp]
	mov	r8d, 0
	mov	rdi, rax
	call	_internal_get_tty
	test	eax, eax
	jne	.L26
	cmp	QWORD PTR -56[rbp], 0
	je	.L20
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
.L20:
	mov	edx, DWORD PTR -24[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
	mov	edx, DWORD PTR -20[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, 0
	jmp	.L23
.L25:
	nop
	jmp	.L18
.L26:
	nop
.L18:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, -1
	je	.L21
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	close@PLT
.L21:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, -1
	je	.L22
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
.L22:
	mov	eax, -1
.L23:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	openpty, .-openpty
	.globl	forkpty
	.type	forkpty, @function
forkpty:
.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, 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 -28[rbp], -1
	cmp	QWORD PTR -40[rbp], 0
	jne	.L28
	mov	eax, -1
	jmp	.L38
.L28:
	lea	rdx, -16[rbp]
	lea	rax, -28[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	_internal_get_pty
	test	eax, eax
	jne	.L40
	cmp	QWORD PTR -48[rbp], 0
	je	.L32
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
.L32:
	call	fork@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	je	.L41
	cmp	DWORD PTR -20[rbp], 0
	jne	.L34
	mov	DWORD PTR -24[rbp], -1
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
	call	setsid@PLT
	mov	rsi, QWORD PTR -16[rbp]
	mov	rcx, QWORD PTR -64[rbp]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rax, -24[rbp]
	mov	r8d, 1
	mov	rdi, rax
	call	_internal_get_tty
	test	eax, eax
	je	.L35
	mov	edi, 1
	call	_exit@PLT
.L35:
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, 0
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, 2
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, 2
	jle	.L36
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	close@PLT
.L36:
	mov	eax, 0
	jmp	.L38
.L34:
	mov	edx, DWORD PTR -28[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -20[rbp]
	jmp	.L38
.L40:
	nop
	jmp	.L31
.L41:
	nop
.L31:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, -1
	je	.L37
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
.L37:
	mov	eax, -1
.L38:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	forkpty, .-forkpty
	.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	"180097.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/dev/ptmx\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	_internal_get_pty, %function
_internal_get_pty:
	@ 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, .L7
	ldr	r0, .L7+4
	bl	open
	mov	r2, r0
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L2
	mvn	r3, #0
	b	.L3
.L2:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r0, r3
	bl	grantpt
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
	mvn	r3, #0
	b	.L3
.L4:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r0, r3
	bl	unlockpt
	mov	r3, r0
	cmp	r3, #0
	beq	.L5
	mvn	r3, #0
	b	.L3
.L5:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r0, r3
	bl	ptsname
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L6
	mvn	r3, #0
	b	.L3
.L6:
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	258
	.word	.LC0
	.size	_internal_get_pty, .-_internal_get_pty
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	_internal_get_tty, %function
_internal_get_tty:
	@ args = 4, 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	str	r3, [fp, #-20]
	ldr	r1, .L15
	ldr	r0, [fp, #-12]
	bl	open
	mov	r2, r0
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L10
	mvn	r3, #0
	b	.L11
.L10:
	ldr	r3, [fp, #4]
	cmp	r3, #0
	beq	.L12
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r2, #0
	ldr	r1, .L15+4
	mov	r0, r3
	bl	ioctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L12
	mvn	r3, #0
	b	.L11
.L12:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L13
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	mov	r1, #2
	mov	r0, r3
	bl	tcsetattr
.L13:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L14
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	ldr	r1, .L15+8
	mov	r0, r3
	bl	ioctl
.L14:
	mov	r3, #0
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	258
	.word	21518
	.word	21524
	.size	_internal_get_tty, .-_internal_get_tty
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	openpty
	.syntax unified
	.arm
	.fpu softvfp
	.type	openpty, %function
openpty:
	@ args = 4, 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, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	str	r3, [fp, #-36]
	ldr	r3, [fp, #4]
	str	r3, [fp, #-40]
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mvn	r3, #0
	str	r3, [fp, #-16]
	mvn	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L18
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L19
.L18:
	mvn	r3, #0
	b	.L27
.L19:
	sub	r2, fp, #20
	sub	r3, fp, #16
	mov	r1, r2
	mov	r0, r3
	bl	_internal_get_pty
	mov	r3, r0
	cmp	r3, #0
	bne	.L29
	ldr	r1, [fp, #-20]
	sub	r0, fp, #12
	mov	r3, #0
	str	r3, [sp]
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-36]
	bl	_internal_get_tty
	mov	r3, r0
	cmp	r3, #0
	bne	.L30
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L24
	ldr	r3, [fp, #-20]
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	strcpy
.L24:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-28]
	str	r2, [r3]
	mov	r3, #0
	b	.L27
.L29:
	nop
	b	.L22
.L30:
	nop
.L22:
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	beq	.L25
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
.L25:
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L26
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
.L26:
	mvn	r3, #0
.L27:
	ldr	r2, .L31
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC1
	.size	openpty, .-openpty
	.section	.rodata
	.align	2
.LC2:
	.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, .L48
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mvn	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L34
	mvn	r3, #0
	b	.L44
.L34:
	sub	r2, fp, #24
	sub	r3, fp, #20
	mov	r1, r2
	mov	r0, r3
	bl	_internal_get_pty
	mov	r3, r0
	cmp	r3, #0
	bne	.L46
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	beq	.L38
	ldr	r3, [fp, #-24]
	mov	r1, r3
	ldr	r0, [fp, #-36]
	bl	strcpy
.L38:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L47
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L40
	mvn	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
	bl	setsid
	ldr	r1, [fp, #-24]
	sub	r0, fp, #16
	mov	r3, #1
	str	r3, [sp]
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-40]
	bl	_internal_get_tty
	mov	r3, r0
	cmp	r3, #0
	beq	.L41
	mov	r0, #1
	bl	_exit
.L41:
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	dup2
	ldr	r3, [fp, #-16]
	mov	r1, #1
	mov	r0, r3
	bl	dup2
	ldr	r3, [fp, #-16]
	mov	r1, #2
	mov	r0, r3
	bl	dup2
	ldr	r3, [fp, #-16]
	cmp	r3, #2
	ble	.L42
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
.L42:
	mov	r3, #0
	b	.L44
.L40:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-32]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	b	.L44
.L46:
	nop
	b	.L37
.L47:
	nop
.L37:
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	beq	.L43
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
.L43:
	mvn	r3, #0
.L44:
	ldr	r2, .L48
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L45
	bl	__stack_chk_fail
.L45:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L49:
	.align	2
.L48:
	.word	.LC2
	.size	forkpty, .-forkpty
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
