	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_openpty                        ## -- Begin function openpty
	.p2align	4, 0x90
_openpty:                               ## @openpty
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movq	%rcx, %rbx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_O_RDWR@GOTPCREL(%rip), %r13
	movq	_O_NOCTTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	(%r13), %edi
	callq	_posix_openpt
	movl	$-1, %r14d
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.1:
	movl	%eax, %r15d
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, %edi
	callq	_grantpt
	cmpl	$-1, %eax
	je	LBB0_11
## %bb.2:
	movl	%r15d, %edi
	callq	_unlockpt
	cmpl	$-1, %eax
	je	LBB0_11
## %bb.3:
	movl	%r15d, %edi
	callq	_ptsname
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:
	movq	%rax, %r12
	movl	(%r13), %esi
	movq	%rax, %rdi
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_11
## %bb.5:
	movl	%eax, %r13d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%r13d, (%rax)
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	movq	%r12, %rsi
	callq	_strcpy
LBB0_7:
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.8:
	movq	_TCSAFLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	movq	%rbx, %rdx
	callq	_tcsetattr
LBB0_9:
	xorl	%r14d, %r14d
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.10:
	movq	_TIOCSWINSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_ioctl
	jmp	LBB0_12
LBB0_11:
	movl	%r15d, %edi
	callq	_close
LBB0_12:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_NOCTTY,4,2                   ## @O_NOCTTY
	.comm	_TCSAFLUSH,4,2                  ## @TCSAFLUSH
	.comm	_TIOCSWINSZ,4,2                 ## @TIOCSWINSZ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_openpty                        ; -- Begin function openpty
	.p2align	2
_openpty:                               ; @openpty
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
Lloh0:
	adrp	x25, _O_RDWR@GOTPAGE
Lloh1:
	ldr	x25, [x25, _O_RDWR@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh2:
	adrp	x9, _O_NOCTTY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _O_NOCTTY@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	orr	w0, w9, w8
	bl	_posix_openpt
	cmn	w0, #1
	b.eq	LBB0_12
; %bb.1:
	mov	x24, x0
	bl	_grantpt
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.2:
	mov	x0, x24
	bl	_unlockpt
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.3:
	mov	x0, x24
	bl	_ptsname
	cbz	x0, LBB0_11
; %bb.4:
	mov	x26, x0
	ldr	w1, [x25]
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.5:
	mov	x25, x0
	str	w24, [x23]
	str	w0, [x22]
	cbz	x21, LBB0_7
; %bb.6:
	mov	x0, x21
	mov	x1, x26
	bl	_strcpy
LBB0_7:
	cbz	x20, LBB0_9
; %bb.8:
Lloh5:
	adrp	x8, _TCSAFLUSH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TCSAFLUSH@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x25
	mov	x2, x20
	bl	_tcsetattr
LBB0_9:
	cbz	x19, LBB0_13
; %bb.10:
Lloh8:
	adrp	x8, _TIOCSWINSZ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TIOCSWINSZ@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x25
	mov	x2, x19
	bl	_ioctl
	mov	w0, #0
	b	LBB0_12
LBB0_11:
	mov	x0, x24
	bl	_close
	mov	w0, #-1
LBB0_12:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
	mov	w0, #0
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_NOCTTY,4,2                   ; @O_NOCTTY
	.comm	_TCSAFLUSH,4,2                  ; @TCSAFLUSH
	.comm	_TIOCSWINSZ,4,2                 ; @TIOCSWINSZ
.subsections_via_symbols
