	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BasicOpenFilePerm              ## -- Begin function BasicOpenFilePerm
	.p2align	4, 0x90
_BasicOpenFilePerm:                     ## @BasicOpenFilePerm
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	_errno@GOTPCREL(%rip), %rbx
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_ERRCODE_INSUFFICIENT_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_ereport
	movl	$0, (%rbx)
	xorl	%eax, %eax
	callq	_ReleaseLruFile
	testq	%rax, %rax
	je	LBB0_6
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_open
	testl	%eax, %eax
	jns	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rbx), %r14d
	movl	$-1, %r15d
	movq	_EMFILE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_ENFILE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_5
	jmp	LBB0_7
LBB0_6:
	movl	%r14d, (%rbx)
	jmp	LBB0_7
LBB0_2:
	movl	%eax, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.comm	_EMFILE,4,2                     ## @EMFILE
	.comm	_ENFILE,4,2                     ## @ENFILE
	.comm	_LOG,4,2                        ## @LOG
	.comm	_ERRCODE_INSUFFICIENT_RESOURCES,4,2 ## @ERRCODE_INSUFFICIENT_RESOURCES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of file descriptors: %m; release and retry"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BasicOpenFilePerm              ; -- Begin function BasicOpenFilePerm
	.p2align	2
_BasicOpenFilePerm:                     ; @BasicOpenFilePerm
	.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	x21, x0
Lloh0:
	adrp	x24, _errno@GOTPAGE
Lloh1:
	ldr	x24, [x24, _errno@GOTPAGEOFF]
Lloh2:
	adrp	x26, _ENFILE@GOTPAGE
Lloh3:
	ldr	x26, [x26, _ENFILE@GOTPAGEOFF]
Lloh4:
	adrp	x27, _LOG@GOTPAGE
Lloh5:
	ldr	x27, [x27, _LOG@GOTPAGEOFF]
Lloh6:
	adrp	x28, _ERRCODE_INSUFFICIENT_RESOURCES@GOTPAGE
Lloh7:
	ldr	x28, [x28, _ERRCODE_INSUFFICIENT_RESOURCES@GOTPAGEOFF]
Lloh8:
	adrp	x22, l_.str@PAGE
Lloh9:
	add	x22, x22, l_.str@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_open
	tbz	w0, #31, LBB0_6
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w25, [x24]
Lloh10:
	adrp	x8, _EMFILE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EMFILE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x26]
	cmp	w25, w8
	ccmp	w25, w9, #4, ne
	b.ne	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w23, [x27]
	ldr	w0, [x28]
	bl	_errcode
	mov	x0, x22
	bl	_errmsg
	mov	x1, x0
	mov	x0, x23
	bl	_ereport
	str	wzr, [x24]
	bl	_ReleaseLruFile
	cbnz	x0, LBB0_1
; %bb.4:
	str	w25, [x24]
LBB0_5:
	mov	w0, #-1
LBB0_6:
	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 AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.comm	_EMFILE,4,2                     ; @EMFILE
	.comm	_ENFILE,4,2                     ; @ENFILE
	.comm	_LOG,4,2                        ; @LOG
	.comm	_ERRCODE_INSUFFICIENT_RESOURCES,4,2 ; @ERRCODE_INSUFFICIENT_RESOURCES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of file descriptors: %m; release and retry"

.subsections_via_symbols
