	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_set_max_safe_fds               ## -- Begin function set_max_safe_fds
	.p2align	4, 0x90
_set_max_safe_fds:                      ## @set_max_safe_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_max_files_per_process@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	leaq	-40(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	callq	_count_usable_fds
	movl	-40(%rbp), %edi
	movq	(%rbx), %rsi
	movslq	-36(%rbp), %rax
	subq	%rax, %rsi
	callq	_Min
	movq	_NUM_RESERVED_FDS@GOTPCREL(%rip), %rbx
	subq	(%rbx), %rax
	movq	_max_safe_fds@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	movq	_FD_MINFREE@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jge	LBB0_2
## %bb.1:
	movq	_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_ERRCODE_INSUFFICIENT_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movq	(%rbx), %rdx
	movq	(%r15), %rsi
	addq	%rdx, %rsi
	addq	(%r12), %rdx
	leaq	L_.str.1(%rip), %rdi
	callq	_errdetail
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
	movq	(%r15), %rax
LBB0_2:
	movq	_DEBUG2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	-40(%rbp), %ecx
	movl	-36(%rbp), %r8d
	leaq	L_.str.2(%rip), %rsi
	movq	%rax, %rdx
	callq	_elog
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_max_files_per_process,8,3      ## @max_files_per_process
	.comm	_max_safe_fds,8,3               ## @max_safe_fds
	.comm	_NUM_RESERVED_FDS,8,3           ## @NUM_RESERVED_FDS
	.comm	_FD_MINFREE,8,3                 ## @FD_MINFREE
	.comm	_FATAL,4,2                      ## @FATAL
	.comm	_ERRCODE_INSUFFICIENT_RESOURCES,4,2 ## @ERRCODE_INSUFFICIENT_RESOURCES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"insufficient file descriptors available to start server process"

L_.str.1:                               ## @.str.1
	.asciz	"System allows %d, we need at least %d."

	.comm	_DEBUG2,4,2                     ## @DEBUG2
L_.str.2:                               ## @.str.2
	.asciz	"max_safe_fds = %d, usable_fds = %d, already_open = %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_set_max_safe_fds               ; -- Begin function set_max_safe_fds
	.p2align	2
_set_max_safe_fds:                      ; @set_max_safe_fds
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x19, _max_files_per_process@GOTPAGE
Lloh1:
	ldr	x19, [x19, _max_files_per_process@GOTPAGEOFF]
	ldr	x0, [x19]
	add	x1, sp, #12
	add	x2, sp, #8
	bl	_count_usable_fds
	ldp	w9, w0, [sp, #8]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	ldr	x8, [x19]
	sub	x1, x8, x9
	bl	_Min
Lloh2:
	adrp	x21, _NUM_RESERVED_FDS@GOTPAGE
Lloh3:
	ldr	x21, [x21, _NUM_RESERVED_FDS@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh4:
	adrp	x20, _max_safe_fds@GOTPAGE
Lloh5:
	ldr	x20, [x20, _max_safe_fds@GOTPAGEOFF]
Lloh6:
	adrp	x22, _FD_MINFREE@GOTPAGE
Lloh7:
	ldr	x22, [x22, _FD_MINFREE@GOTPAGEOFF]
	ldr	x9, [x22]
	sub	x2, x0, x8
	cmp	x2, x9
	str	x2, [x20]
	b.ge	LBB0_2
; %bb.1:
Lloh8:
	adrp	x8, _FATAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
Lloh10:
	ldr	w19, [x8]
Lloh11:
	adrp	x8, _ERRCODE_INSUFFICIENT_RESOURCES@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERRCODE_INSUFFICIENT_RESOURCES@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_errcode
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	ldr	x8, [x20]
	ldr	x9, [x21]
	add	x1, x9, x8
	ldr	x8, [x22]
	add	x2, x8, x9
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errdetail
	mov	x1, x0
	mov	x0, x19
	bl	_ereport
	ldr	x2, [x20]
LBB0_2:
Lloh18:
	adrp	x8, _DEBUG2@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DEBUG2@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldp	w4, w3, [sp, #8]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_elog
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_max_files_per_process,8,3      ; @max_files_per_process
	.comm	_max_safe_fds,8,3               ; @max_safe_fds
	.comm	_NUM_RESERVED_FDS,8,3           ; @NUM_RESERVED_FDS
	.comm	_FD_MINFREE,8,3                 ; @FD_MINFREE
	.comm	_FATAL,4,2                      ; @FATAL
	.comm	_ERRCODE_INSUFFICIENT_RESOURCES,4,2 ; @ERRCODE_INSUFFICIENT_RESOURCES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"insufficient file descriptors available to start server process"

l_.str.1:                               ; @.str.1
	.asciz	"System allows %d, we need at least %d."

	.comm	_DEBUG2,4,2                     ; @DEBUG2
l_.str.2:                               ; @.str.2
	.asciz	"max_safe_fds = %d, usable_fds = %d, already_open = %d"

.subsections_via_symbols
