	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function count_usable_fds
_count_usable_fds:                      ## @count_usable_fds
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	movl	$4096, %edi                     ## imm = 0x1000
	callq	_palloc
	movq	%rax, %rbx
	xorl	%r12d, %r12d
	movl	$1024, %r14d                    ## imm = 0x400
	xorl	%r13d, %r13d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	leal	(%r14,%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	shll	$3, %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_repalloc
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %r14d
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %rbx
	movl	%r15d, (%rax,%r12,4)
	cmpl	%r15d, %r13d
	cmovlel	%r15d, %r13d
	incq	%r12
	cmpl	-48(%rbp), %r12d                ## 4-byte Folded Reload
	jge	LBB0_10
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	callq	_dup
	testl	%eax, %eax
	js	LBB0_2
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, %r15d
	cmpl	%r14d, %r12d
	jge	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rax
	jmp	LBB0_9
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EMFILE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.3:
	movq	_ENFILE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	movq	_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	callq	_elog
LBB0_5:
	testl	%r12d, %r12d
	movq	%rbx, %r15
	jne	LBB0_11
	jmp	LBB0_13
LBB0_10:
	movq	%rbx, %r15
LBB0_11:
	movl	%r12d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rbx,4), %edi
	callq	_close
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_12
LBB0_13:
	movq	%r15, %rdi
	callq	_pfree
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%r12d, (%rax)
	subl	%r12d, %r13d
	incl	%r13d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%r13d, (%rax)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EMFILE,8,3                     ## @EMFILE
	.comm	_ENFILE,8,3                     ## @ENFILE
	.comm	_WARNING,4,2                    ## @WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dup(0) failed after %d successes: %m"

	.comm	_RLIMIT_NOFILE,4,2              ## @RLIMIT_NOFILE
	.comm	_RLIMIT_OFILE,4,2               ## @RLIMIT_OFILE
	.no_dead_strip	_count_usable_fds
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function count_usable_fds
_count_usable_fds:                      ; @count_usable_fds
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x23, x0
	mov	w0, #4096
	bl	_palloc
	mov	x22, x0
	mov	x21, #0
	mov	w25, #0
	mov	w26, #1024
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	str	w24, [x22, x21, lsl #2]
	cmp	w25, w24
	csel	w25, w25, w24, gt
	add	x21, x21, #1
	cmp	w21, w23
	b.ge	LBB0_8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #0
	bl	_dup
	tbnz	w0, #31, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, x0
	cmp	w21, w26
	b.lt	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	lsl	w27, w26, #1
	lsl	w1, w26, #3
	mov	x0, x22
	bl	_repalloc
	mov	x22, x0
	mov	x26, x27
	b	LBB0_1
LBB0_5:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EMFILE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EMFILE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _ENFILE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _ENFILE@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.eq	LBB0_7
; %bb.6:
Lloh9:
	adrp	x8, _WARNING@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WARNING@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_elog
LBB0_7:
	cbz	w21, LBB0_10
LBB0_8:
	mov	x23, #0
	mov	w24, w21
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22, x23, lsl #2]
	bl	_close
	add	x23, x23, #1
	cmp	x24, x23
	b.ne	LBB0_9
LBB0_10:
	mov	x0, x22
	bl	_pfree
	str	w21, [x20]
	sub	w8, w25, w21
	add	w8, w8, #1
	str	w8, [x19]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EMFILE,8,3                     ; @EMFILE
	.comm	_ENFILE,8,3                     ; @ENFILE
	.comm	_WARNING,4,2                    ; @WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dup(0) failed after %d successes: %m"

	.comm	_RLIMIT_NOFILE,4,2              ; @RLIMIT_NOFILE
	.comm	_RLIMIT_OFILE,4,2               ; @RLIMIT_OFILE
	.no_dead_strip	_count_usable_fds
.subsections_via_symbols
