	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pty_open
_pty_open:                              ## @pty_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rcx, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movabsq	$8751743325039846447, %rax      ## imm = 0x7974702F7665642F
	movq	%rax, -56(%rbp)
	movl	$30840, -48(%rbp)               ## imm = 0x7878
	leaq	-56(%rbp), %rdi
	callq	_getmaster
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	cmpq	$0, 24(%r15)
	je	LBB0_4
## %bb.2:
	movl	%ebx, %edi
	callq	_raw
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_close
	movl	%r12d, %ebx
	jmp	LBB0_7
LBB0_4:
	movq	16(%r15), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	8(%r15), %esi
	leaq	-56(%rbp), %rdi
	callq	*%rax
LBB0_6:
	movq	(%r15), %rdi
	leaq	-56(%rbp), %rsi
	callq	_strcpy
	movq	(%r15), %rax
	movq	%rax, (%r14)
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
l___const.pty_open.dev:                 ## @__const.pty_open.dev
	.asciz	"/dev/ptyxx\000"

	.no_dead_strip	_pty_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pty_open
_pty_open:                              ; @pty_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x4
	mov	x21, x3
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, l___const.pty_open.dev@PAGE
Lloh4:
	add	x8, x8, l___const.pty_open.dev@PAGEOFF
Lloh5:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	mov	w8, #30840
	str	w8, [sp, #16]
	add	x0, sp, #8
	bl	_getmaster
	mov	x19, x0
	tbnz	w0, #31, LBB0_7
; %bb.1:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_raw
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
	mov	x0, x19
	bl	_close
	mov	x19, x22
	b	LBB0_7
LBB0_4:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w1, [x21, #8]
	add	x0, sp, #8
	blr	x8
LBB0_6:
	ldr	x0, [x21]
	add	x1, sp, #8
	bl	_strcpy
	ldr	x8, [x21]
	str	x8, [x20]
LBB0_7:
	ldr	x8, [sp, #24]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpAddLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
l___const.pty_open.dev:                 ; @__const.pty_open.dev
	.asciz	"/dev/ptyxx\000"

	.no_dead_strip	_pty_open
.subsections_via_symbols
