	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function doc_ecc_bch_fix_data
LCPI0_0:
	.long	7                               ## 0x7
	.long	7                               ## 0x7
	.long	7                               ## 0x7
	.long	7                               ## 0x7
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_doc_ecc_bch_fix_data:                  ## @doc_ecc_bch_fix_data
	.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	%rdx, %r12
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_DOC_ECC_BCH_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	movq	%rbx, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	_DOC_ECC_BCH_T@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	testl	%ebx, %ebx
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%rbx,4), %edi
	callq	_bitrev8
	movl	%eax, (%r13,%rbx,4)
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_3:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %edi
	movq	_DOC_ECC_BCH_COVERED_BYTES@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	subq	$8, %rsp
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	movq	%r13, %r8
	xorl	%r9d, %r9d
	pushq	%r15
	callq	_decode_bch
	addq	$16, %rsp
	movl	%eax, %ebx
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movl	(%rax), %eax
	addl	%ebx, %eax
	sete	%dil
	callq	_BUG_ON
	testl	%ebx, %ebx
	jle	LBB0_19
## %bb.4:
	movl	%ebx, %r13d
	cmpl	$8, %ebx
	jae	LBB0_7
## %bb.5:
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_7:
	movl	%r13d, %eax
	andl	$-8, %eax
	leaq	-8(%rax), %rcx
	movq	%rcx, %rdx
	shrq	$3, %rdx
	incq	%rdx
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.9:
	movq	%rdx, %rsi
	andq	$-2, %rsi
	xorl	%ecx, %ecx
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [7,7,7,7]
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movaps	(%r15,%rcx,4), %xmm1
	xorps	%xmm0, %xmm1
	movaps	16(%r15,%rcx,4), %xmm2
	xorps	%xmm0, %xmm2
	movaps	%xmm1, (%r15,%rcx,4)
	movaps	%xmm2, 16(%r15,%rcx,4)
	movaps	32(%r15,%rcx,4), %xmm1
	xorps	%xmm0, %xmm1
	movaps	48(%r15,%rcx,4), %xmm2
	xorps	%xmm0, %xmm2
	movaps	%xmm1, 32(%r15,%rcx,4)
	movaps	%xmm2, 48(%r15,%rcx,4)
	addq	$16, %rcx
	addq	$-2, %rsi
	jne	LBB0_10
## %bb.11:
	testb	$1, %dl
	je	LBB0_13
LBB0_12:
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [7,7,7,7]
	movaps	(%r15,%rcx,4), %xmm1
	xorps	%xmm0, %xmm1
	xorps	16(%r15,%rcx,4), %xmm0
	movaps	%xmm1, (%r15,%rcx,4)
	movaps	%xmm0, 16(%r15,%rcx,4)
LBB0_13:
	cmpq	%r13, %rax
	je	LBB0_14
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	xorb	$7, (%r15,%rax,4)
	incq	%rax
	cmpq	%rax, %r13
	jne	LBB0_6
LBB0_14:
	testl	%ebx, %ebx
	jle	LBB0_19
## %bb.15:
	xorl	%r14d, %r14d
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	incq	%r14
	cmpq	%r14, %r13
	je	LBB0_19
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%r14,4), %edi
	movl	(%r12), %eax
	shll	$3, %eax
	cmpl	%eax, %edi
	jge	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_change_bit
	jmp	LBB0_18
LBB0_19:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_doc_dbg
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.20:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%ecx, %ecx
	testb	$1, %dl
	jne	LBB0_12
	jmp	LBB0_13
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DOC_ECC_BCH_SIZE,4,2           ## @DOC_ECC_BCH_SIZE
	.comm	_DOC_ECC_BCH_T,4,2              ## @DOC_ECC_BCH_T
	.comm	_DOC_ECC_BCH_COVERED_BYTES,4,2  ## @DOC_ECC_BCH_COVERED_BYTES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"doc_ecc_bch_fix_data: flipped %d bits\n"

	.no_dead_strip	_doc_ecc_bch_fix_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function doc_ecc_bch_fix_data
_doc_ecc_bch_fix_data:                  ; @doc_ecc_bch_fix_data
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x24, _DOC_ECC_BCH_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _DOC_ECC_BCH_SIZE@GOTPAGEOFF]
	ldr	w12, [x24]
	lsl	x8, x12, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x23, x9, x8
	mov	sp, x23
Lloh7:
	adrp	x8, _DOC_ECC_BCH_T@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DOC_ECC_BCH_T@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh10:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh11:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	cmp	w12, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x25, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x26, x25, #2
	ldr	w0, [x21, x26]
	bl	_bitrev8
	str	w0, [x23, x26]
	add	x25, x25, #1
	ldrsw	x8, [x24]
	cmp	x25, x8
	b.lt	LBB0_2
LBB0_3:
	ldr	x8, [x22]
	ldr	w0, [x8]
Lloh12:
	adrp	x22, _DOC_ECC_BCH_COVERED_BYTES@GOTPAGE
Lloh13:
	ldr	x22, [x22, _DOC_ECC_BCH_COVERED_BYTES@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x1, #0
	mov	x3, #0
	mov	x4, x23
	mov	x5, #0
	mov	x6, x20
	bl	_decode_bch
	mov	x21, x0
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmn	w0, w8
	cset	w0, eq
	bl	_BUG_ON
	cmp	w21, #1
	b.lt	LBB0_12
; %bb.4:
	mov	w23, w21
	cmp	w21, #16
	b.hs	LBB0_6
; %bb.5:
	mov	x8, #0
	b	LBB0_9
LBB0_6:
	and	x8, x23, #0xfffffff0
	add	x9, x20, #32
	movi.4s	v0, #7
	mov	x10, x8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q1, q2, [x9, #-32]
	ldp	q3, q4, [x9]
	eor.16b	v1, v1, v0
	eor.16b	v2, v2, v0
	eor.16b	v3, v3, v0
	eor.16b	v4, v4, v0
	stp	q1, q2, [x9, #-32]
	stp	q3, q4, [x9], #64
	subs	x10, x10, #16
	b.ne	LBB0_7
; %bb.8:
	cmp	x8, x23
	b.eq	LBB0_11
LBB0_9:
	add	x9, x20, x8, lsl #2
	sub	x8, x23, x8
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9]
	eor	w10, w10, #0x7
	str	w10, [x9], #4
	subs	x8, x8, #1
	b.ne	LBB0_10
LBB0_11:
	cmp	w21, #1
	b.ge	LBB0_15
LBB0_12:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_doc_dbg
	ldur	x8, [x29, #-72]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.13:
	mov	x0, x21
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x20, x20, #4
	subs	x23, x23, #1
	b.eq	LBB0_12
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	ldr	w8, [x22]
	cmp	w0, w8, lsl #3
	b.ge	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x1, x19
	bl	_change_bit
	b	LBB0_14
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_DOC_ECC_BCH_SIZE,4,2           ; @DOC_ECC_BCH_SIZE
	.comm	_DOC_ECC_BCH_T,4,2              ; @DOC_ECC_BCH_T
	.comm	_DOC_ECC_BCH_COVERED_BYTES,4,2  ; @DOC_ECC_BCH_COVERED_BYTES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"doc_ecc_bch_fix_data: flipped %d bits\n"

	.no_dead_strip	_doc_ecc_bch_fix_data
.subsections_via_symbols
