	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nand_davinci_calculate_4bit
_nand_davinci_calculate_4bit:           ## @nand_davinci_calculate_4bit
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movq	%rdx, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	callq	_to_davinci_nand
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_NAND_4BIT_ECC1_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_davinci_nand_readl
	jmp	LBB0_3
LBB0_2:
	leaq	-32(%rbp), %rsi
	movq	%rax, %rdi
	callq	_nand_davinci_readecc_4bit
	movl	-32(%rbp), %eax
	movzbl	%al, %ecx
	movl	%ecx, (%rbx)
	movl	%eax, %ecx
	shrl	$8, %ecx
	andl	$3, %ecx
	movl	%eax, %edx
	shrl	$14, %edx
	andl	$252, %edx
	orl	%ecx, %edx
	movl	%edx, 4(%rbx)
	shrl	$22, %eax
	andl	$15, %eax
	movl	-28(%rbp), %ecx
	movl	%ecx, %edx
	shll	$4, %edx
	movzbl	%dl, %edx
	orl	%eax, %edx
	movl	%edx, 8(%rbx)
	movl	%ecx, %eax
	shrl	$4, %eax
	andl	$63, %eax
	movl	%ecx, %edx
	shrl	$10, %edx
	andl	$192, %edx
	orl	%eax, %edx
	movl	%edx, 12(%rbx)
	shrl	$18, %ecx
	movzbl	%cl, %eax
	movl	%eax, 16(%rbx)
	movl	-24(%rbp), %eax
	movzbl	%al, %ecx
	movl	%ecx, 20(%rbx)
	movl	%eax, %ecx
	shrl	$8, %ecx
	andl	$3, %ecx
	movl	%eax, %edx
	shrl	$14, %edx
	andl	$252, %edx
	orl	%ecx, %edx
	movl	%edx, 24(%rbx)
	shrl	$22, %eax
	andl	$15, %eax
	movl	-20(%rbp), %ecx
	movl	%ecx, %edx
	shll	$4, %edx
	movzbl	%dl, %edx
	orl	%eax, %edx
	movl	%edx, 28(%rbx)
	movl	%ecx, %eax
	shrl	$4, %eax
	andl	$63, %eax
	movl	%ecx, %edx
	shrl	$10, %edx
	andl	$192, %edx
	orl	%eax, %edx
	movl	%edx, 32(%rbx)
	shrl	$18, %ecx
	movzbl	%cl, %eax
	movl	%eax, 36(%rbx)
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-16(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_4BIT_ECC1_OFFSET,4,2      ## @NAND_4BIT_ECC1_OFFSET
	.no_dead_strip	_nand_davinci_calculate_4bit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function nand_davinci_calculate_4bit
lCPI0_0:
	.long	4294967282                      ; 0xfffffff2
	.long	4294967274                      ; 0xffffffea
lCPI0_1:
	.long	252                             ; 0xfc
	.long	15                              ; 0xf
lCPI0_2:
	.long	4294967288                      ; 0xfffffff8
	.long	4294967292                      ; 0xfffffffc
lCPI0_3:
	.long	8                               ; 0x8
	.long	4                               ; 0x4
lCPI0_4:
	.long	3                               ; 0x3
	.long	240                             ; 0xf0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_nand_davinci_calculate_4bit:           ; @nand_davinci_calculate_4bit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x2
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_to_davinci_nand
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _NAND_4BIT_ECC1_OFFSET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_4BIT_ECC1_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_davinci_nand_readl
	b	LBB0_3
LBB0_2:
	add	x1, sp, #8
	bl	_nand_davinci_readecc_4bit
	ldp	d0, d1, [sp, #8]
	dup.2s	v2, v0[0]
Lloh6:
	adrp	x8, lCPI0_2@PAGE
Lloh7:
	ldr	d3, [x8, lCPI0_2@PAGEOFF]
	ushl.2s	v4, v0, v3
Lloh8:
	adrp	x8, lCPI0_3@PAGE
Lloh9:
	ldr	d5, [x8, lCPI0_3@PAGEOFF]
	ushl.2s	v6, v0, v5
	mov.s	w8, v0[1]
	fmov	w9, s0
	and	w9, w9, #0xff
	str	w9, [x19]
Lloh10:
	adrp	x9, lCPI0_0@PAGE
Lloh11:
	ldr	d0, [x9, lCPI0_0@PAGEOFF]
	ushl.2s	v2, v2, v0
Lloh12:
	adrp	x9, lCPI0_1@PAGE
Lloh13:
	ldr	d7, [x9, lCPI0_1@PAGEOFF]
	and.8b	v2, v2, v7
	mov.s	v4[1], v6[1]
Lloh14:
	adrp	x9, lCPI0_4@PAGE
Lloh15:
	ldr	d6, [x9, lCPI0_4@PAGEOFF]
	and.8b	v4, v4, v6
	orr.8b	v2, v4, v2
	stur	d2, [x19, #4]
	lsr	w9, w8, #10
	and	w9, w9, #0xc0
	bfxil	w9, w8, #4, #6
	ubfx	w8, w8, #18, #8
	stp	w9, w8, [x19, #12]
	dup.2s	v2, v1[0]
	ushl.2s	v3, v1, v3
	ushl.2s	v4, v1, v5
	mov.s	w8, v1[1]
	fmov	w9, s1
	and	w9, w9, #0xff
	str	w9, [x19, #20]
	ushl.2s	v0, v2, v0
	and.8b	v0, v0, v7
	mov.s	v3[1], v4[1]
	and.8b	v1, v3, v6
	orr.8b	v0, v1, v0
	str	d0, [x19, #24]
	lsr	w9, w8, #10
	and	w9, w9, #0xc0
	bfxil	w9, w8, #4, #6
	ubfx	w8, w8, #18, #8
	stp	w9, w8, [x19, #32]
LBB0_3:
	ldr	x8, [sp, #24]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdr	Lloh14, Lloh15
	.loh AdrpAdrp	Lloh12, Lloh14
	.loh AdrpLdr	Lloh12, Lloh13
	.loh AdrpAdrp	Lloh10, Lloh12
	.loh AdrpLdr	Lloh10, Lloh11
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpAdrp	Lloh6, Lloh8
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_4BIT_ECC1_OFFSET,4,2      ; @NAND_4BIT_ECC1_OFFSET
	.no_dead_strip	_nand_davinci_calculate_4bit
.subsections_via_symbols
