	.file	"159514450.c"
	.intel_syntax noprefix
	.text
	.globl	forkpty
	.type	forkpty, @function
forkpty:
.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, 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	rdi, QWORD PTR -64[rbp]
	mov	rcx, QWORD PTR -56[rbp]
	mov	rdx, QWORD PTR -48[rbp]
	lea	rsi, -16[rbp]
	lea	rax, -20[rbp]
	mov	r8, rdi
	mov	rdi, rax
	call	openpty@PLT
	cmp	eax, -1
	jne	.L2
	mov	eax, -1
	jmp	.L8
.L2:
	call	fork@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	je	.L4
	cmp	DWORD PTR -12[rbp], 0
	je	.L5
	jmp	.L10
.L4:
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, -1
	jmp	.L8
.L5:
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	login_tty@PLT
	test	eax, eax
	je	.L7
	mov	edi, 1
	call	_exit@PLT
.L7:
	mov	eax, 0
	jmp	.L8
.L10:
	mov	edx, DWORD PTR -20[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -12[rbp]
.L8:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"159514450.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	forkpty
	.syntax unified
	.arm
	.fpu softvfp
	.type	forkpty, %function
forkpty:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	str	r3, [fp, #-36]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r1, fp, #16
	sub	r0, fp, #20
	ldr	r3, [fp, #-36]
	str	r3, [sp]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-28]
	bl	openpty
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	mvn	r3, #0
	b	.L8
.L2:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L4
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L5
	b	.L10
.L4:
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	mvn	r3, #0
	b	.L8
.L5:
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	login_tty
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	mov	r0, #1
	bl	_exit
.L7:
	mov	r3, #0
	b	.L8
.L10:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-12]
.L8:
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC0
	.size	forkpty, .-forkpty
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
