	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calcsb
_calcsb:                                ## @calcsb
	.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	%rdx, %r14
	movl	%esi, %ebx
	movq	_DIOCGSECTORSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movl	%ebx, %edi
	callq	_ioctl
	xorl	%r15d, %r15d
	cmpl	$-1, %eax
	je	LBB0_6
## %bb.1:
	movl	-36(%rbp), %edi
	callq	_Malloc
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	_EEXIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_errx
LBB0_3:
	movq	_SBLOCK_UFS2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	-36(%rbp), %ecx
	subl	%ecx, %eax
	movq	_dev_bsize@GOTPCREL(%rip), %rsi
	cltd
	idivl	(%rsi)
	movl	%ebx, %edi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_blread
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:
	movslq	-36(%rbp), %rbx
	movq	-24(%rbx,%r12), %rax
	movq	_FS_UFS2_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	-24(%r12,%rbx), %rax
	movq	%rax, (%r14)
	movups	-16(%r12,%rbx), %xmm0
	movups	%xmm0, 8(%r14)
	movq	%r12, %rdi
	callq	_free
	movl	$1, %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DIOCGSECTORSIZE,4,2            ## @DIOCGSECTORSIZE
	.comm	_EEXIT,4,2                      ## @EEXIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"calcsb: cannot allocate recovery buffer"

	.comm	_SBLOCK_UFS2,4,2                ## @SBLOCK_UFS2
	.comm	_dev_bsize,4,2                  ## @dev_bsize
	.comm	_FS_UFS2_MAGIC,8,3              ## @FS_UFS2_MAGIC
	.no_dead_strip	_calcsb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calcsb
_calcsb:                                ; @calcsb
	.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, x2
	mov	x21, x1
Lloh0:
	adrp	x8, _DIOCGSECTORSIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DIOCGSECTORSIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x21
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.1:
	ldr	w0, [sp, #12]
	bl	_Malloc
	mov	x20, x0
	cbnz	x0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _EEXIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EEXIT@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_errx
LBB0_3:
Lloh8:
	adrp	x8, _SBLOCK_UFS2@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SBLOCK_UFS2@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w3, [sp, #12]
	sub	w8, w8, w3
Lloh11:
	adrp	x9, _dev_bsize@GOTPAGE
Lloh12:
	ldr	x9, [x9, _dev_bsize@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	sdiv	w2, w8, w9
	mov	x0, x21
	mov	x1, x20
	bl	_blread
	cbnz	x0, LBB0_6
; %bb.4:
	ldrsw	x8, [sp, #12]
	add	x21, x8, x20
	ldr	x8, [x21, #-24]!
Lloh14:
	adrp	x9, _FS_UFS2_MAGIC@GOTPAGE
Lloh15:
	ldr	x9, [x9, _FS_UFS2_MAGIC@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	w8, [x21, #20]
	str	w8, [x19, #20]
	ldur	d0, [x21, #12]
	stur	d0, [x19, #12]
	ldr	x8, [x21]
	str	x8, [x19]
	ldr	w8, [x21, #8]
	str	w8, [x19, #8]
	mov	x0, x20
	bl	_free
	mov	w0, #1
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_DIOCGSECTORSIZE,4,2            ; @DIOCGSECTORSIZE
	.comm	_EEXIT,4,2                      ; @EEXIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"calcsb: cannot allocate recovery buffer"

	.comm	_SBLOCK_UFS2,4,2                ; @SBLOCK_UFS2
	.comm	_dev_bsize,4,2                  ; @dev_bsize
	.comm	_FS_UFS2_MAGIC,8,3              ; @FS_UFS2_MAGIC
	.no_dead_strip	_calcsb
.subsections_via_symbols
