	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_init_zcp
_niu_init_zcp:                          ## @niu_init_zcp
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	_PLAT_TYPE_NIU@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_NIU_CFIFO_ENTRIES@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	cmpl	$2, (%r14)
	jae	LBB0_4
## %bb.3:
	movq	_ATLAS_P0_P1_CFIFO_ENTRIES@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	movq	_ATLAS_P2_P3_CFIFO_ENTRIES@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %r13d
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movq	$0, -64(%rbp)
	testl	%r13d, %r13d
	jle	LBB0_10
## %bb.6:
	xorl	%ebx, %ebx
	leaq	-96(%rbp), %r12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	callq	_niu_zcp_write
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	leaq	-144(%rbp), %rdx
	callq	_niu_zcp_read
	testl	%eax, %eax
	jne	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	incl	%ebx
	cmpl	%ebx, %r13d
	jne	LBB0_7
LBB0_10:
	movq	%r14, %rdi
	callq	_niu_zcp_cfifo_reset
	movl	(%r14), %edi
	callq	_CFIFO_ECC
	xorl	%r15d, %r15d
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_nw64
	movq	_ZCP_INT_STAT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_ZCP_INT_STAT_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_nw64
	movl	(%rbx), %edi
	callq	_nr64
	movq	_ZCP_INT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ZCP_INT_MASK_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_nw64
	jmp	LBB0_13
LBB0_12:
	movl	%eax, %r15d
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%r15d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PLAT_TYPE_NIU,8,3              ## @PLAT_TYPE_NIU
	.comm	_ATLAS_P0_P1_CFIFO_ENTRIES,4,2  ## @ATLAS_P0_P1_CFIFO_ENTRIES
	.comm	_ATLAS_P2_P3_CFIFO_ENTRIES,4,2  ## @ATLAS_P2_P3_CFIFO_ENTRIES
	.comm	_NIU_CFIFO_ENTRIES,4,2          ## @NIU_CFIFO_ENTRIES
	.comm	_ZCP_INT_STAT,4,2               ## @ZCP_INT_STAT
	.comm	_ZCP_INT_STAT_ALL,4,2           ## @ZCP_INT_STAT_ALL
	.comm	_ZCP_INT_MASK,4,2               ## @ZCP_INT_MASK
	.comm	_ZCP_INT_MASK_ALL,4,2           ## @ZCP_INT_MASK_ALL
	.no_dead_strip	_niu_init_zcp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_init_zcp
_niu_init_zcp:                          ; @niu_init_zcp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _PLAT_TYPE_NIU@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PLAT_TYPE_NIU@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _NIU_CFIFO_ENTRIES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NIU_CFIFO_ENTRIES@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	ldr	w8, [x19]
Lloh8:
	adrp	x9, _ATLAS_P2_P3_CFIFO_ENTRIES@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ATLAS_P2_P3_CFIFO_ENTRIES@GOTPAGEOFF]
Lloh10:
	adrp	x10, _ATLAS_P0_P1_CFIFO_ENTRIES@GOTPAGE
Lloh11:
	ldr	x10, [x10, _ATLAS_P0_P1_CFIFO_ENTRIES@GOTPAGEOFF]
	cmp	w8, #2
	csel	x8, x10, x9, lo
LBB0_3:
	ldr	w21, [x8]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #48]
	str	xzr, [sp, #80]
	cmp	w21, #1
	b.lt	LBB0_8
; %bb.4:
	mov	w20, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #48
	mov	x0, x19
	mov	x1, x20
	bl	_niu_zcp_write
	cbnz	w0, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x20
	bl	_niu_zcp_read
	cbnz	w0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w20, w20, #1
	cmp	w21, w20
	b.ne	LBB0_5
LBB0_8:
	mov	x0, x19
	bl	_niu_zcp_cfifo_reset
	ldr	w0, [x19]
	bl	_CFIFO_ECC
	mov	w1, #0
	bl	_nw64
Lloh12:
	adrp	x19, _ZCP_INT_STAT@GOTPAGE
Lloh13:
	ldr	x19, [x19, _ZCP_INT_STAT@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh14:
	adrp	x8, _ZCP_INT_STAT_ALL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ZCP_INT_STAT_ALL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_nw64
	ldr	w0, [x19]
	bl	_nr64
Lloh17:
	adrp	x8, _ZCP_INT_MASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ZCP_INT_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x8, _ZCP_INT_MASK_ALL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ZCP_INT_MASK_ALL@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_nw64
	mov	w0, #0
LBB0_9:
	ldur	x8, [x29, #-40]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	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
	add	sp, sp, #144
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_PLAT_TYPE_NIU,8,3              ; @PLAT_TYPE_NIU
	.comm	_ATLAS_P0_P1_CFIFO_ENTRIES,4,2  ; @ATLAS_P0_P1_CFIFO_ENTRIES
	.comm	_ATLAS_P2_P3_CFIFO_ENTRIES,4,2  ; @ATLAS_P2_P3_CFIFO_ENTRIES
	.comm	_NIU_CFIFO_ENTRIES,4,2          ; @NIU_CFIFO_ENTRIES
	.comm	_ZCP_INT_STAT,4,2               ; @ZCP_INT_STAT
	.comm	_ZCP_INT_STAT_ALL,4,2           ; @ZCP_INT_STAT_ALL
	.comm	_ZCP_INT_MASK,4,2               ; @ZCP_INT_MASK
	.comm	_ZCP_INT_MASK_ALL,4,2           ; @ZCP_INT_MASK_ALL
	.no_dead_strip	_niu_init_zcp
.subsections_via_symbols
