	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function il3945_load_bsm
_il3945_load_bsm:                       ## @il3945_load_bsm
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	32(%rdi), %r14
	movq	40(%rdi), %r13
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_D_INFO
	movq	_IL39_MAX_BSM_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jle	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	subl	(%rax), %r12d
	jmp	LBB0_11
LBB0_2:
	movq	16(%r15), %rdx
	movq	24(%r15), %r12
	movq	(%r15), %rbx
	movq	8(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_BSM_DRAM_INST_PTR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_il_wr_prph
	movq	_BSM_DRAM_DATA_PTR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_il_wr_prph
	movq	_BSM_DRAM_INST_BYTECOUNT_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_il_wr_prph
	movq	_BSM_DRAM_DATA_BYTECOUNT_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_il_wr_prph
	testq	%r14, %r14
	jle	LBB0_5
## %bb.3:
	movq	_BSM_SRAM_LOWER_BOUND@GOTPCREL(%rip), %r12
	movq	(%r12), %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	callq	_le32_to_cpu
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	__il_wr_prph
	addq	$8, %rbx
	addq	$4, %r13
	movq	(%r12), %rax
	addq	%r14, %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_5:
	movq	%r15, %rdi
	callq	_il3945_verify_bsm
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movq	_BSM_WR_MEM_SRC_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_il_wr_prph
	movq	_BSM_WR_MEM_DST_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IL39_RTC_INST_LOWER_BOUND@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r15, %rdi
	callq	_il_wr_prph
	movq	_BSM_WR_DWCOUNT_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shrq	$3, %r14
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_il_wr_prph
	movq	_BSM_WR_CTRL_REG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_BSM_WR_CTRL_REG_BIT_START@GOTPCREL(%rip), %r12
	movq	(%r12), %rdx
	movq	%r15, %rdi
	callq	_il_wr_prph
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_il_rd_prph
	testq	%rax, (%r12)
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	$10, %edi
	callq	_udelay
	incl	%ebx
	cmpl	$100, %ebx
	jne	LBB0_7
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	callq	_IL_ERR
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	jmp	LBB0_10
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_D_INFO
	movl	(%r14), %esi
	movq	_BSM_WR_CTRL_REG_BIT_START_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r15, %rdi
	callq	_il_wr_prph
LBB0_11:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Begin load bsm\n"

	.comm	_IL39_MAX_BSM_SIZE,8,3          ## @IL39_MAX_BSM_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BSM_DRAM_INST_PTR_REG,4,2      ## @BSM_DRAM_INST_PTR_REG
	.comm	_BSM_DRAM_DATA_PTR_REG,4,2      ## @BSM_DRAM_DATA_PTR_REG
	.comm	_BSM_DRAM_INST_BYTECOUNT_REG,4,2 ## @BSM_DRAM_INST_BYTECOUNT_REG
	.comm	_BSM_DRAM_DATA_BYTECOUNT_REG,4,2 ## @BSM_DRAM_DATA_BYTECOUNT_REG
	.comm	_BSM_SRAM_LOWER_BOUND,8,3       ## @BSM_SRAM_LOWER_BOUND
	.comm	_BSM_WR_MEM_SRC_REG,4,2         ## @BSM_WR_MEM_SRC_REG
	.comm	_BSM_WR_MEM_DST_REG,4,2         ## @BSM_WR_MEM_DST_REG
	.comm	_IL39_RTC_INST_LOWER_BOUND,8,3  ## @IL39_RTC_INST_LOWER_BOUND
	.comm	_BSM_WR_DWCOUNT_REG,4,2         ## @BSM_WR_DWCOUNT_REG
	.comm	_BSM_WR_CTRL_REG,4,2            ## @BSM_WR_CTRL_REG
	.comm	_BSM_WR_CTRL_REG_BIT_START,8,3  ## @BSM_WR_CTRL_REG_BIT_START
L_.str.1:                               ## @.str.1
	.asciz	"BSM write complete, poll %d iterations\n"

L_.str.2:                               ## @.str.2
	.asciz	"BSM write did not complete!\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_BSM_WR_CTRL_REG_BIT_START_EN,8,3 ## @BSM_WR_CTRL_REG_BIT_START_EN
	.no_dead_strip	_il3945_load_bsm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function il3945_load_bsm
_il3945_load_bsm:                       ; @il3945_load_bsm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldp	x23, x24, [x0, #32]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_D_INFO
Lloh2:
	adrp	x8, _IL39_MAX_BSM_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IL39_MAX_BSM_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x23, x8
	b.le	LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_3:
	ldp	x2, x20, [x19, #16]
	ldp	x21, x22, [x19]
Lloh7:
	adrp	x8, _BSM_DRAM_INST_PTR_REG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BSM_DRAM_INST_PTR_REG@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_il_wr_prph
Lloh10:
	adrp	x8, _BSM_DRAM_DATA_PTR_REG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BSM_DRAM_DATA_PTR_REG@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_il_wr_prph
Lloh13:
	adrp	x8, _BSM_DRAM_INST_BYTECOUNT_REG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BSM_DRAM_INST_BYTECOUNT_REG@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_il_wr_prph
Lloh16:
	adrp	x8, _BSM_DRAM_DATA_BYTECOUNT_REG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BSM_DRAM_DATA_BYTECOUNT_REG@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_il_wr_prph
	cmp	x23, #1
	b.lt	LBB0_6
; %bb.4:
Lloh19:
	adrp	x21, _BSM_SRAM_LOWER_BOUND@GOTPAGE
Lloh20:
	ldr	x21, [x21, _BSM_SRAM_LOWER_BOUND@GOTPAGEOFF]
	ldr	x20, [x21]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24], #4
	bl	_le32_to_cpu
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	__il_wr_prph
	add	x20, x20, #8
	ldr	x8, [x21]
	add	x8, x8, x23
	cmp	x20, x8
	b.lt	LBB0_5
LBB0_6:
	mov	x0, x19
	bl	_il3945_verify_bsm
	cbnz	w0, LBB0_12
; %bb.7:
Lloh21:
	adrp	x8, _BSM_WR_MEM_SRC_REG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BSM_WR_MEM_SRC_REG@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_il_wr_prph
Lloh24:
	adrp	x8, _BSM_WR_MEM_DST_REG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BSM_WR_MEM_DST_REG@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x8, _IL39_RTC_INST_LOWER_BOUND@GOTPAGE
Lloh28:
	ldr	x8, [x8, _IL39_RTC_INST_LOWER_BOUND@GOTPAGEOFF]
Lloh29:
	ldr	x2, [x8]
	mov	x0, x19
	bl	_il_wr_prph
Lloh30:
	adrp	x8, _BSM_WR_DWCOUNT_REG@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BSM_WR_DWCOUNT_REG@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	lsr	x2, x23, #3
	mov	x0, x19
	bl	_il_wr_prph
Lloh33:
	adrp	x20, _BSM_WR_CTRL_REG@GOTPAGE
Lloh34:
	ldr	x20, [x20, _BSM_WR_CTRL_REG@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh35:
	adrp	x21, _BSM_WR_CTRL_REG_BIT_START@GOTPAGE
Lloh36:
	ldr	x21, [x21, _BSM_WR_CTRL_REG_BIT_START@GOTPAGEOFF]
	ldr	x2, [x21]
	mov	x0, x19
	bl	_il_wr_prph
	mov	w22, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	mov	x0, x19
	bl	_il_rd_prph
	ldr	x8, [x21]
	tst	x8, x0
	b.eq	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w0, #10
	bl	_udelay
	add	w22, w22, #1
	cmp	w22, #100
	b.ne	LBB0_8
; %bb.10:
Lloh37:
	adrp	x0, l_.str.2@PAGE
Lloh38:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IL_ERR
Lloh39:
	adrp	x8, _EIO@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_2
LBB0_11:
	str	x22, [sp]
Lloh41:
	adrp	x0, l_.str.1@PAGE
Lloh42:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_D_INFO
	ldr	w1, [x20]
Lloh43:
	adrp	x8, _BSM_WR_CTRL_REG_BIT_START_EN@GOTPAGE
Lloh44:
	ldr	x8, [x8, _BSM_WR_CTRL_REG_BIT_START_EN@GOTPAGEOFF]
Lloh45:
	ldr	x2, [x8]
	mov	x0, x19
	bl	_il_wr_prph
	mov	w0, #0
LBB0_12:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Begin load bsm\n"

	.comm	_IL39_MAX_BSM_SIZE,8,3          ; @IL39_MAX_BSM_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BSM_DRAM_INST_PTR_REG,4,2      ; @BSM_DRAM_INST_PTR_REG
	.comm	_BSM_DRAM_DATA_PTR_REG,4,2      ; @BSM_DRAM_DATA_PTR_REG
	.comm	_BSM_DRAM_INST_BYTECOUNT_REG,4,2 ; @BSM_DRAM_INST_BYTECOUNT_REG
	.comm	_BSM_DRAM_DATA_BYTECOUNT_REG,4,2 ; @BSM_DRAM_DATA_BYTECOUNT_REG
	.comm	_BSM_SRAM_LOWER_BOUND,8,3       ; @BSM_SRAM_LOWER_BOUND
	.comm	_BSM_WR_MEM_SRC_REG,4,2         ; @BSM_WR_MEM_SRC_REG
	.comm	_BSM_WR_MEM_DST_REG,4,2         ; @BSM_WR_MEM_DST_REG
	.comm	_IL39_RTC_INST_LOWER_BOUND,8,3  ; @IL39_RTC_INST_LOWER_BOUND
	.comm	_BSM_WR_DWCOUNT_REG,4,2         ; @BSM_WR_DWCOUNT_REG
	.comm	_BSM_WR_CTRL_REG,4,2            ; @BSM_WR_CTRL_REG
	.comm	_BSM_WR_CTRL_REG_BIT_START,8,3  ; @BSM_WR_CTRL_REG_BIT_START
l_.str.1:                               ; @.str.1
	.asciz	"BSM write complete, poll %d iterations\n"

l_.str.2:                               ; @.str.2
	.asciz	"BSM write did not complete!\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_BSM_WR_CTRL_REG_BIT_START_EN,8,3 ; @BSM_WR_CTRL_REG_BIT_START_EN
	.no_dead_strip	_il3945_load_bsm
.subsections_via_symbols
