	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xsdfec_reg0_write
_xsdfec_reg0_write:                     ## @xsdfec_reg0_write
	.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
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_XSDFEC_REG0_N_MIN@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_1
LBB0_6:
	movl	(%rdi), %edi
	leaq	L_.str(%rip), %rsi
LBB0_7:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_1:
	movl	%ecx, %r10d
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.2:
	movq	_XSDFEC_REG0_N_MAX@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jl	LBB0_6
## %bb.3:
	movl	%edx, %r9d
	cmpl	%edx, %esi
	jle	LBB0_6
## %bb.4:
	movq	_XSDFEC_REG0_N_MUL_P@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%r10d, %eax
	cmpl	%esi, %eax
	jl	LBB0_6
## %bb.5:
	movl	%esi, %eax
	cltd
	idivl	%r10d
	testl	%edx, %edx
	jne	LBB0_6
## %bb.9:
	movq	_XSDFEC_REG0_N_LSB@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	movq	_XSDFEC_REG0_K_MIN@GOTPCREL(%rip), %rax
	cmpl	%r9d, (%rax)
	jg	LBB0_13
## %bb.10:
	movq	_XSDFEC_REG0_K_MAX@GOTPCREL(%rip), %rax
	cmpl	%r9d, (%rax)
	jl	LBB0_13
## %bb.11:
	movq	_XSDFEC_REG0_K_MUL_P@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%r10d, %eax
	cmpl	%r9d, %eax
	jl	LBB0_13
## %bb.12:
	movl	%r9d, %eax
	cltd
	idivl	%r10d
	testl	%edx, %edx
	je	LBB0_14
LBB0_13:
	movl	(%rdi), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_14:
	movq	_XSDFEC_LDPC_CODE_REG0_ADDR_BASE@GOTPCREL(%rip), %rax
	movq	_XSDFEC_LDPC_REG_JUMP@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movslq	%r8d, %rdx
	imulq	%rcx, %rdx
	addq	(%rax), %rdx
	movq	_XSDFEC_LDPC_CODE_REG0_ADDR_HIGH@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jle	LBB0_16
## %bb.15:
	movl	(%rdi), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_8
LBB0_16:
	movq	_XSDFEC_REG0_K_LSB@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r9d
	orl	%esi, %r9d
	movq	%rdx, %rsi
	movl	%r9d, %edx
	callq	_xsdfec_regwrite
	xorl	%ebx, %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_XSDFEC_REG0_N_MIN,4,2          ## @XSDFEC_REG0_N_MIN
	.comm	_XSDFEC_REG0_N_MAX,4,2          ## @XSDFEC_REG0_N_MAX
	.comm	_XSDFEC_REG0_N_MUL_P,4,2        ## @XSDFEC_REG0_N_MUL_P
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"N value is not in range"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_XSDFEC_REG0_N_LSB,4,2          ## @XSDFEC_REG0_N_LSB
	.comm	_XSDFEC_REG0_K_MIN,4,2          ## @XSDFEC_REG0_K_MIN
	.comm	_XSDFEC_REG0_K_MAX,4,2          ## @XSDFEC_REG0_K_MAX
	.comm	_XSDFEC_REG0_K_MUL_P,4,2        ## @XSDFEC_REG0_K_MUL_P
L_.str.1:                               ## @.str.1
	.asciz	"K value is not in range"

	.comm	_XSDFEC_REG0_K_LSB,4,2          ## @XSDFEC_REG0_K_LSB
	.comm	_XSDFEC_LDPC_CODE_REG0_ADDR_BASE,8,3 ## @XSDFEC_LDPC_CODE_REG0_ADDR_BASE
	.comm	_XSDFEC_LDPC_REG_JUMP,4,2       ## @XSDFEC_LDPC_REG_JUMP
	.comm	_XSDFEC_LDPC_CODE_REG0_ADDR_HIGH,8,3 ## @XSDFEC_LDPC_CODE_REG0_ADDR_HIGH
L_.str.2:                               ## @.str.2
	.asciz	"Writing outside of LDPC reg0 space 0x%x"

	.no_dead_strip	_xsdfec_reg0_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xsdfec_reg0_write
_xsdfec_reg0_write:                     ; @xsdfec_reg0_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
                                        ; kill: def $w4 killed $w4 def $x4
Lloh0:
	adrp	x8, _XSDFEC_REG0_N_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XSDFEC_REG0_N_MIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_4
LBB0_1:
	ldr	w0, [x0]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	bl	_dev_dbg
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
LBB0_4:
	cbz	w3, LBB0_1
; %bb.5:
Lloh8:
	adrp	x8, _XSDFEC_REG0_N_MAX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _XSDFEC_REG0_N_MAX@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w1
	b.lt	LBB0_1
; %bb.6:
	cmp	w1, w2
	b.le	LBB0_1
; %bb.7:
Lloh11:
	adrp	x8, _XSDFEC_REG0_N_MUL_P@GOTPAGE
Lloh12:
	ldr	x8, [x8, _XSDFEC_REG0_N_MUL_P@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	mul	w8, w8, w3
	cmp	w8, w1
	b.lt	LBB0_1
; %bb.8:
	sdiv	w8, w1, w3
	msub	w8, w8, w3, w1
	cbnz	w8, LBB0_1
; %bb.9:
Lloh14:
	adrp	x8, _XSDFEC_REG0_K_MIN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _XSDFEC_REG0_K_MIN@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _XSDFEC_REG0_K_MAX@GOTPAGE
Lloh18:
	ldr	x9, [x9, _XSDFEC_REG0_K_MAX@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	w8, w2
	ccmp	w9, w2, #8, le
	b.lt	LBB0_12
; %bb.10:
Lloh20:
	adrp	x8, _XSDFEC_REG0_K_MUL_P@GOTPAGE
Lloh21:
	ldr	x8, [x8, _XSDFEC_REG0_K_MUL_P@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	mul	w8, w8, w3
	cmp	w8, w2
	b.lt	LBB0_12
; %bb.11:
	sdiv	w8, w2, w3
	msub	w8, w8, w3, w2
	cbz	w8, LBB0_13
LBB0_12:
	ldr	w0, [x0]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_13:
Lloh25:
	adrp	x8, _XSDFEC_LDPC_CODE_REG0_ADDR_BASE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _XSDFEC_LDPC_CODE_REG0_ADDR_BASE@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
Lloh28:
	adrp	x9, _XSDFEC_LDPC_REG_JUMP@GOTPAGE
Lloh29:
	ldr	x9, [x9, _XSDFEC_LDPC_REG_JUMP@GOTPAGEOFF]
Lloh30:
	ldrsw	x9, [x9]
	sxtw	x10, w4
	madd	x8, x9, x10, x8
Lloh31:
	adrp	x9, _XSDFEC_LDPC_CODE_REG0_ADDR_HIGH@GOTPAGE
Lloh32:
	ldr	x9, [x9, _XSDFEC_LDPC_CODE_REG0_ADDR_HIGH@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_15
; %bb.14:
	ldr	w0, [x0]
	str	x8, [sp]
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_15:
Lloh36:
	adrp	x9, _XSDFEC_REG0_N_LSB@GOTPAGE
Lloh37:
	ldr	x9, [x9, _XSDFEC_REG0_N_LSB@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	lsl	w9, w1, w9
Lloh39:
	adrp	x10, _XSDFEC_REG0_K_LSB@GOTPAGE
Lloh40:
	ldr	x10, [x10, _XSDFEC_REG0_K_LSB@GOTPAGEOFF]
Lloh41:
	ldr	w10, [x10]
	lsl	w10, w2, w10
	orr	w2, w10, w9
	mov	x1, x8
	bl	_xsdfec_regwrite
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_XSDFEC_REG0_N_MIN,4,2          ; @XSDFEC_REG0_N_MIN
	.comm	_XSDFEC_REG0_N_MAX,4,2          ; @XSDFEC_REG0_N_MAX
	.comm	_XSDFEC_REG0_N_MUL_P,4,2        ; @XSDFEC_REG0_N_MUL_P
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"N value is not in range"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_XSDFEC_REG0_N_LSB,4,2          ; @XSDFEC_REG0_N_LSB
	.comm	_XSDFEC_REG0_K_MIN,4,2          ; @XSDFEC_REG0_K_MIN
	.comm	_XSDFEC_REG0_K_MAX,4,2          ; @XSDFEC_REG0_K_MAX
	.comm	_XSDFEC_REG0_K_MUL_P,4,2        ; @XSDFEC_REG0_K_MUL_P
l_.str.1:                               ; @.str.1
	.asciz	"K value is not in range"

	.comm	_XSDFEC_REG0_K_LSB,4,2          ; @XSDFEC_REG0_K_LSB
	.comm	_XSDFEC_LDPC_CODE_REG0_ADDR_BASE,8,3 ; @XSDFEC_LDPC_CODE_REG0_ADDR_BASE
	.comm	_XSDFEC_LDPC_REG_JUMP,4,2       ; @XSDFEC_LDPC_REG_JUMP
	.comm	_XSDFEC_LDPC_CODE_REG0_ADDR_HIGH,8,3 ; @XSDFEC_LDPC_CODE_REG0_ADDR_HIGH
l_.str.2:                               ; @.str.2
	.asciz	"Writing outside of LDPC reg0 space 0x%x"

	.no_dead_strip	_xsdfec_reg0_write
.subsections_via_symbols
