	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_block
_check_block:                           ## @check_block
	.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	%esi, %r15d
	movl	%edi, %ebx
	callq	_check_sector
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_10
## %bb.1:
	movl	%ebx, %edi
	callq	_read_sector
	testq	%rax, %rax
	jne	LBB0_10
## %bb.2:
	movq	_readbuf@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_read_uint64
	cltq
	movq	_TFFS_BLOCK_HEADER_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jne	LBB0_3
## %bb.5:
	movl	(%r13), %edi
	movl	$12, %esi
	callq	_read_uint32
	movq	_TFFS_SECTORS_PER_PAGE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.7:
	movl	(%r13), %edi
	movl	$12, %esi
	callq	_read_uint32
	movq	%rax, %r12
	movl	$1, %r14d
	testl	%r12d, %r12d
	jle	LBB0_10
## %bb.8:
	movl	$28, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	movl	%ebx, %esi
	callq	_read_uint64
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r15), %edi
	callq	_sector_mark_bad
	addl	$4, %ebx
	decl	%r12d
	jne	LBB0_9
	jmp	LBB0_10
LBB0_3:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fprintf
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_readbuf,4,2                    ## @readbuf
	.comm	_TFFS_BLOCK_HEADER_MAGIC,8,3    ## @TFFS_BLOCK_HEADER_MAGIC
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: block without magic header. Skipping block\n"

	.comm	_TFFS_SECTORS_PER_PAGE,8,3      ## @TFFS_SECTORS_PER_PAGE
L_.str.1:                               ## @.str.1
	.asciz	"Warning: block with wrong number of sectors per page. Skipping block\n"

	.no_dead_strip	_check_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_block
_check_block:                           ; @check_block
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x1
	mov	x20, x0
	bl	_check_sector
	cbz	w0, LBB0_12
; %bb.1:
	mov	x0, x20
	bl	_read_sector
	cbnz	x0, LBB0_11
; %bb.2:
Lloh0:
	adrp	x22, _readbuf@GOTPAGE
Lloh1:
	ldr	x22, [x22, _readbuf@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	w1, #0
	bl	_read_uint64
Lloh2:
	adrp	x8, _TFFS_BLOCK_HEADER_MAGIC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TFFS_BLOCK_HEADER_MAGIC@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, w0, sxtw
	b.ne	LBB0_8
; %bb.3:
	ldr	w0, [x22]
	mov	w1, #12
	bl	_read_uint32
Lloh5:
	adrp	x8, _TFFS_SECTORS_PER_PAGE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TFFS_SECTORS_PER_PAGE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.4:
	ldr	w0, [x22]
	mov	w1, #12
	bl	_read_uint32
	mov	x20, x0
	cmp	w20, #1
	b.lt	LBB0_7
; %bb.5:
	mov	w21, #28
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	mov	x1, x21
	bl	_read_uint64
	add	w0, w0, w19
	bl	_sector_mark_bad
	add	w21, w21, #4
	subs	w20, w20, #1
	b.ne	LBB0_6
LBB0_7:
	mov	w0, #1
	b	LBB0_12
LBB0_8:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_10:
Lloh12:
	adrp	x8, _stderr@GOTPAGE
Lloh13:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_fprintf
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_readbuf,4,2                    ; @readbuf
	.comm	_TFFS_BLOCK_HEADER_MAGIC,8,3    ; @TFFS_BLOCK_HEADER_MAGIC
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: block without magic header. Skipping block\n"

	.comm	_TFFS_SECTORS_PER_PAGE,8,3      ; @TFFS_SECTORS_PER_PAGE
l_.str.1:                               ; @.str.1
	.asciz	"Warning: block with wrong number of sectors per page. Skipping block\n"

	.no_dead_strip	_check_block
.subsections_via_symbols
