	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pty_reserve_next
_pty_reserve_next:                      ## @pty_reserve_next
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_ttys_lock@GOTPCREL(%rip), %rdi
	callq	_lock
	movq	_MAX_PTYS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_pty_slave@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%ebx, %ebx
	testl	%ecx, %ecx
	jle	LBB0_4
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	incq	%rbx
	cmpq	%rbx, %rcx
	jne	LBB0_1
## %bb.3:
	movl	%ecx, %ebx
LBB0_4:
	movl	%ebx, %ecx
	movq	$1, (%rax,%rcx,8)
	movq	_ttys_lock@GOTPCREL(%rip), %rdi
	callq	_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ttys_lock,4,2                  ## @ttys_lock
	.comm	_MAX_PTYS,4,2                   ## @MAX_PTYS
	.comm	_pty_slave,8,3                  ## @pty_slave
	.no_dead_strip	_pty_reserve_next
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pty_reserve_next
_pty_reserve_next:                      ; @pty_reserve_next
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x0, _ttys_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _ttys_lock@GOTPAGEOFF]
	bl	_lock
Lloh2:
	adrp	x8, _MAX_PTYS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_PTYS@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
Lloh5:
	adrp	x8, _pty_slave@GOTPAGE
Lloh6:
	ldr	x8, [x8, _pty_slave@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	w9, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x19, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8, x19, lsl #3]
	cbz	x10, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x19, x19, #1
	cmp	x9, x19
	b.ne	LBB0_2
; %bb.4:
	mov	x19, x9
	b	LBB0_6
LBB0_5:
	mov	w19, #0
LBB0_6:
	mov	w9, #1
	str	x9, [x8, w19, uxtw #3]
Lloh8:
	adrp	x0, _ttys_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _ttys_lock@GOTPAGEOFF]
	bl	_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ttys_lock,4,2                  ; @ttys_lock
	.comm	_MAX_PTYS,4,2                   ; @MAX_PTYS
	.comm	_pty_slave,8,3                  ; @pty_slave
	.no_dead_strip	_pty_reserve_next
.subsections_via_symbols
