	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scan_file
_scan_file:                             ## @scan_file
	.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	_mode@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	_PG_MODE_ENABLE@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	sete	%cl
	movq	_PG_MODE_CHECK@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	sete	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_Assert
	movq	(%rbx), %rax
	cmpq	(%r14), %rax
	jne	LBB0_1
## %bb.2:
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
LBB0_3:
	movq	_PG_BINARY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%edx, %edx
	callq	_open
	testl	%eax, %eax
	js	LBB0_25
## %bb.4:
	movl	%eax, %r12d
	movq	_files@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_BLCKSZ@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movl	%r12d, %edi
	callq	_read
	testl	%eax, %eax
	je	LBB0_19
## %bb.5:
	movl	%eax, %r13d
	movq	_blocks@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_6 Depth=1
	incl	%ebx
	movl	(%r14), %edx
	movl	%r12d, %edi
	callq	_read
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_19
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %r8d
	cmpl	%r8d, %r13d
	jne	LBB0_7
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	incl	(%r15)
	xorl	%edi, %edi
	callq	_PageIsNew
	testq	%rax, %rax
	jne	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	_RELSEG_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	imull	-52(%rbp), %esi                 ## 4-byte Folded Reload
	addl	%ebx, %esi
	callq	_pg_checksum_page
	movq	_current_size@GOTPCREL(%rip), %rcx
	addl	%r13d, (%rcx)
	movq	_mode@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_PG_MODE_CHECK@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	_ControlFile@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %rcx
	movq	_PG_DATA_CHECKSUM_VERSION@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	leaq	L_.str.3(%rip), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_pg_log_error
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_badblocks@GOTPCREL(%rip), %rax
	incl	(%rax)
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_showprogress@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_6 Depth=1
	xorl	%edi, %edi
	callq	_progress_report
	jmp	LBB0_18
LBB0_19:
	movq	_verbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_24
## %bb.20:
	movq	_mode@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	_PG_MODE_CHECK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_22
## %bb.21:
	leaq	L_.str.7(%rip), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_pg_log_info
	movq	(%rbx), %rax
LBB0_22:
	movq	_PG_MODE_ENABLE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.23:
	leaq	L_.str.8(%rip), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_pg_log_info
LBB0_24:
	movl	%r12d, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_7:
	testl	%r13d, %r13d
	jns	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pg_log_error
	movl	$1, %edi
	callq	_exit
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_pg_log_error
	movl	$1, %edi
	callq	_exit
LBB0_25:
	leaq	L_.str(%rip), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pg_log_error
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_mode,8,3                       ## @mode
	.comm	_PG_MODE_ENABLE,8,3             ## @PG_MODE_ENABLE
	.comm	_PG_MODE_CHECK,8,3              ## @PG_MODE_CHECK
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_PG_BINARY,4,2                  ## @PG_BINARY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not open file \"%s\": %m"

	.comm	_files,4,2                      ## @files
	.comm	_BLCKSZ,4,2                     ## @BLCKSZ
L_.str.1:                               ## @.str.1
	.asciz	"could not read block %u in file \"%s\": %m"

L_.str.2:                               ## @.str.2
	.asciz	"could not read block %u in file \"%s\": read %d of %d"

	.comm	_blocks,4,2                     ## @blocks
	.comm	_RELSEG_SIZE,4,2                ## @RELSEG_SIZE
	.comm	_current_size,4,2               ## @current_size
	.comm	_ControlFile,8,3                ## @ControlFile
	.comm	_PG_DATA_CHECKSUM_VERSION,8,3   ## @PG_DATA_CHECKSUM_VERSION
L_.str.3:                               ## @.str.3
	.asciz	"checksum verification failed in file \"%s\", block %u: calculated checksum %X but block contains %X"

	.comm	_badblocks,4,2                  ## @badblocks
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_showprogress,8,3               ## @showprogress
	.comm	_verbose,8,3                    ## @verbose
L_.str.7:                               ## @.str.7
	.asciz	"checksums verified in file \"%s\""

L_.str.8:                               ## @.str.8
	.asciz	"checksums enabled in file \"%s\""

	.no_dead_strip	_scan_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scan_file
_scan_file:                             ; @scan_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _mode@GOTPAGE
Lloh1:
	ldr	x22, [x22, _mode@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh2:
	adrp	x20, _PG_MODE_ENABLE@GOTPAGE
Lloh3:
	ldr	x20, [x20, _PG_MODE_ENABLE@GOTPAGEOFF]
	ldr	x9, [x20]
	cmp	x8, x9
Lloh4:
	adrp	x9, _PG_MODE_CHECK@GOTPAGE
Lloh5:
	ldr	x9, [x9, _PG_MODE_CHECK@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	ccmp	x8, x9, #4, ne
	cset	w0, eq
	bl	_Assert
	ldr	x8, [x22]
	ldr	x9, [x20]
Lloh7:
	adrp	x10, _O_RDWR@GOTPAGE
Lloh8:
	ldr	x10, [x10, _O_RDWR@GOTPAGEOFF]
Lloh9:
	adrp	x11, _O_RDONLY@GOTPAGE
Lloh10:
	ldr	x11, [x11, _O_RDONLY@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _PG_BINARY@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PG_BINARY@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w1, w9, w8
	str	x19, [sp, #40]                  ; 8-byte Folded Spill
	mov	x0, x19
	mov	w2, #0
	bl	_open
	tbnz	w0, #31, LBB0_22
; %bb.1:
	mov	x20, x0
Lloh14:
	adrp	x8, _files@GOTPAGE
Lloh15:
	ldr	x8, [x8, _files@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh16:
	adrp	x28, _BLCKSZ@GOTPAGE
Lloh17:
	ldr	x28, [x28, _BLCKSZ@GOTPAGEOFF]
	ldr	w2, [x28]
	bl	_read
	cbz	w0, LBB0_12
; %bb.2:
	mov	x23, x0
	mov	w27, #0
Lloh18:
	adrp	x24, _blocks@GOTPAGE
Lloh19:
	ldr	x24, [x24, _blocks@GOTPAGEOFF]
Lloh20:
	adrp	x22, _RELSEG_SIZE@GOTPAGE
Lloh21:
	ldr	x22, [x22, _RELSEG_SIZE@GOTPAGEOFF]
Lloh22:
	adrp	x19, _current_size@GOTPAGE
Lloh23:
	ldr	x19, [x19, _current_size@GOTPAGEOFF]
Lloh24:
	adrp	x26, _badblocks@GOTPAGE
Lloh25:
	ldr	x26, [x26, _badblocks@GOTPAGEOFF]
Lloh26:
	adrp	x25, _showprogress@GOTPAGE
Lloh27:
	ldr	x25, [x25, _showprogress@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w27, w27, #1
	ldr	w2, [x28]
	mov	x0, x20
	bl	_read
	mov	x23, x0
	cbz	w0, LBB0_12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x28]
	cmp	w23, w8
	b.ne	LBB0_18
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x24]
	add	w8, w8, #1
	str	w8, [x24]
	mov	x0, #0
	bl	_PageIsNew
	cbnz	x0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	madd	w1, w8, w21, w27
	bl	_pg_checksum_page
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x19]
	add	w8, w8, w23
	str	w8, [x19]
Lloh28:
	adrp	x8, _mode@GOTPAGE
Lloh29:
	ldr	x8, [x8, _mode@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
Lloh31:
	adrp	x9, _PG_MODE_CHECK@GOTPAGE
Lloh32:
	ldr	x9, [x9, _PG_MODE_CHECK@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh34:
	adrp	x8, _ControlFile@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ControlFile@GOTPAGEOFF]
Lloh36:
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh37:
	adrp	x9, _PG_DATA_CHECKSUM_VERSION@GOTPAGE
Lloh38:
	ldr	x9, [x9, _PG_DATA_CHECKSUM_VERSION@GOTPAGEOFF]
Lloh39:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	stp	x27, x0, [sp, #8]
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	str	x8, [sp]
Lloh40:
	adrp	x0, l_.str.3@PAGE
Lloh41:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pg_log_error
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x26]
	add	w8, w8, #1
	str	w8, [x26]
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25]
	cbz	x8, LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #0
	bl	_progress_report
	b	LBB0_3
LBB0_12:
Lloh42:
	adrp	x8, _verbose@GOTPAGE
Lloh43:
	ldr	x8, [x8, _verbose@GOTPAGEOFF]
Lloh44:
	ldr	x8, [x8]
	cbz	x8, LBB0_17
; %bb.13:
Lloh45:
	adrp	x19, _mode@GOTPAGE
Lloh46:
	ldr	x19, [x19, _mode@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh47:
	adrp	x9, _PG_MODE_CHECK@GOTPAGE
Lloh48:
	ldr	x9, [x9, _PG_MODE_CHECK@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:
Lloh50:
	adrp	x0, l_.str.7@PAGE
Lloh51:
	add	x0, x0, l_.str.7@PAGEOFF
	ldr	x1, [sp, #40]                   ; 8-byte Folded Reload
	bl	_pg_log_info
	ldr	x8, [x19]
LBB0_15:
Lloh52:
	adrp	x9, _PG_MODE_ENABLE@GOTPAGE
Lloh53:
	ldr	x9, [x9, _PG_MODE_ENABLE@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.16:
Lloh55:
	adrp	x0, l_.str.8@PAGE
Lloh56:
	add	x0, x0, l_.str.8@PAGEOFF
	ldr	x1, [sp, #40]                   ; 8-byte Folded Reload
	bl	_pg_log_info
LBB0_17:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_close
LBB0_18:
	tbz	w23, #31, LBB0_20
; %bb.19:
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	stp	x27, x8, [sp]
Lloh57:
	adrp	x0, l_.str.1@PAGE
Lloh58:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_21
LBB0_20:
	stp	x23, x8, [sp, #16]
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	stp	x27, x8, [sp]
Lloh59:
	adrp	x0, l_.str.2@PAGE
Lloh60:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_21:
	bl	_pg_log_error
	mov	w0, #1
	bl	_exit
LBB0_22:
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	str	x8, [sp]
Lloh61:
	adrp	x0, l_.str@PAGE
Lloh62:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpAdd	Lloh61, Lloh62
	.cfi_endproc
                                        ; -- End function
	.comm	_mode,8,3                       ; @mode
	.comm	_PG_MODE_ENABLE,8,3             ; @PG_MODE_ENABLE
	.comm	_PG_MODE_CHECK,8,3              ; @PG_MODE_CHECK
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_PG_BINARY,4,2                  ; @PG_BINARY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not open file \"%s\": %m"

	.comm	_files,4,2                      ; @files
	.comm	_BLCKSZ,4,2                     ; @BLCKSZ
l_.str.1:                               ; @.str.1
	.asciz	"could not read block %u in file \"%s\": %m"

l_.str.2:                               ; @.str.2
	.asciz	"could not read block %u in file \"%s\": read %d of %d"

	.comm	_blocks,4,2                     ; @blocks
	.comm	_RELSEG_SIZE,4,2                ; @RELSEG_SIZE
	.comm	_current_size,4,2               ; @current_size
	.comm	_ControlFile,8,3                ; @ControlFile
	.comm	_PG_DATA_CHECKSUM_VERSION,8,3   ; @PG_DATA_CHECKSUM_VERSION
l_.str.3:                               ; @.str.3
	.asciz	"checksum verification failed in file \"%s\", block %u: calculated checksum %X but block contains %X"

	.comm	_badblocks,4,2                  ; @badblocks
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_showprogress,8,3               ; @showprogress
	.comm	_verbose,8,3                    ; @verbose
l_.str.7:                               ; @.str.7
	.asciz	"checksums verified in file \"%s\""

l_.str.8:                               ; @.str.8
	.asciz	"checksums enabled in file \"%s\""

	.no_dead_strip	_scan_file
.subsections_via_symbols
