	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function search_directory
_search_directory:                      ## @search_directory
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.1:
	movq	%rsi, %r15
	movq	%r14, %rdi
	callq	_open_file_in_directory
	movl	%eax, %r14d
	testl	%r14d, %r14d
	jns	LBB0_2
	jmp	LBB0_13
LBB0_5:
	movq	%r14, %rdi
	callq	_opendir
	testq	%rax, %rax
	je	LBB0_13
## %bb.6:
	movq	%rax, %r12
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_readdir
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %rbx
	movq	(%rax), %rdi
	callq	_IsXLogFileName
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_open_file_in_directory
	movl	%eax, %r14d
	movq	(%rbx), %r15
	jmp	LBB0_15
LBB0_14:
	movl	$-1, %r14d
LBB0_15:
	movq	%r12, %rdi
	callq	_closedir
	testl	%r14d, %r14d
	js	LBB0_13
LBB0_2:
	movq	_XLOG_BLCKSZ@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	%r14d, %edi
	callq	_read
	movl	(%rbx), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_10
## %bb.3:
	callq	_IsValidWalSegSize
	testl	%eax, %eax
	jne	LBB0_18
## %bb.4:
	movq	_WalSegSz@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_ngettext
	movslq	%eax, %rdi
	movl	(%rbx), %edx
	movq	%r15, %rsi
	jmp	LBB0_12
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_10:
	movq	_errno@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.11:
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
LBB0_12:
	xorl	%eax, %eax
	callq	_fatal_error
	jmp	LBB0_18
LBB0_17:
	leaq	L_.str.3(%rip), %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fatal_error
LBB0_18:
	movl	%r14d, %edi
	callq	_close
	movl	$1, %eax
LBB0_19:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XLOG_BLCKSZ,4,2                ## @XLOG_BLCKSZ
	.comm	_WalSegSz,4,2                   ## @WalSegSz
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WAL segment size must be a power of two between 1 MB and 1 GB, but the WAL file \"%s\" header specifies %d byte"

L_.str.1:                               ## @.str.1
	.asciz	"WAL segment size must be a power of two between 1 MB and 1 GB, but the WAL file \"%s\" header specifies %d bytes"

	.comm	_errno,8,3                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"could not read file \"%s\": %s"

L_.str.3:                               ## @.str.3
	.asciz	"could not read file \"%s\": read %d of %zu"

	.no_dead_strip	_search_directory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function search_directory
_search_directory:                      ; @search_directory
	.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
	mov	x19, x0
	cbz	x1, LBB0_5
; %bb.1:
	mov	x20, x1
	mov	x0, x19
	bl	_open_file_in_directory
	mov	x19, x0
	tbnz	w19, #31, LBB0_14
LBB0_2:
Lloh0:
	adrp	x21, _XLOG_BLCKSZ@GOTPAGE
Lloh1:
	ldr	x21, [x21, _XLOG_BLCKSZ@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_read
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.3:
	bl	_IsValidWalSegSize
	cbnz	w0, LBB0_17
; %bb.4:
Lloh2:
	adrp	x21, _WalSegSz@GOTPAGE
Lloh3:
	ldr	x21, [x21, _WalSegSz@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_ngettext
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x0, w0
	ldr	w2, [x21]
	b	LBB0_16
LBB0_5:
	mov	x0, x19
	bl	_opendir
	cbz	x0, LBB0_18
; %bb.6:
	mov	x21, x0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_readdir
	mov	x20, x0
	cbz	x0, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x0, [x20]
	bl	_IsXLogFileName
	cbz	x0, LBB0_7
; %bb.9:
	ldr	x1, [x20]
	mov	x0, x19
	bl	_open_file_in_directory
	mov	x19, x0
	ldr	x20, [x20]
	b	LBB0_13
LBB0_10:
	mov	x2, x0
Lloh8:
	adrp	x9, _errno@GOTPAGE
Lloh9:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh10:
	ldr	x0, [x9]
	cbz	x0, LBB0_15
; %bb.11:
	bl	_strerror
	mov	x2, x0
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_16
LBB0_12:
	mov	w19, #-1
LBB0_13:
	mov	x0, x21
	bl	_closedir
	tbz	w19, #31, LBB0_2
LBB0_14:
	mov	w0, #0
	b	LBB0_18
LBB0_15:
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_16:
	mov	x1, x20
	bl	_fatal_error
LBB0_17:
	mov	x0, x19
	bl	_close
	mov	w0, #1
LBB0_18:
	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	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_XLOG_BLCKSZ,4,2                ; @XLOG_BLCKSZ
	.comm	_WalSegSz,4,2                   ; @WalSegSz
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WAL segment size must be a power of two between 1 MB and 1 GB, but the WAL file \"%s\" header specifies %d byte"

l_.str.1:                               ; @.str.1
	.asciz	"WAL segment size must be a power of two between 1 MB and 1 GB, but the WAL file \"%s\" header specifies %d bytes"

	.comm	_errno,8,3                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"could not read file \"%s\": %s"

l_.str.3:                               ; @.str.3
	.asciz	"could not read file \"%s\": read %d of %zu"

	.no_dead_strip	_search_directory
.subsections_via_symbols
