	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qat_uclo_load_fw
_qat_uclo_load_fw:                      ## @qat_uclo_load_fw
	.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	(%rdi), %rax
	cmpl	$0, (%rax)
	je	LBB0_13
## %bb.1:
	movq	%rdi, %rbx
	movq	_FCU_LOADED_AE_POS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_ICP_QAT_CSS_FWSK_PUB_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	8(%rsi,%rcx), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	_ICP_QAT_CSS_SIGNATURE_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	_FW_AUTH_MAX_RETRY@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	incl	%r15d
	cmpl	(%rax), %r15d
	jae	LBB0_13
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx,%rcx), %edx
	movl	$1, %r14d
	movl	%r15d, %ecx
	shll	%cl, %r14d
	btl	%r15d, %edx
	jae	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_qat_hal_check_ae_active
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_FCU_CTRL_AE_POS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r15d, %edx
	shll	%cl, %edx
	movq	_FCU_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_FCU_CTRL_CMD_LOAD@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_SET_CAP_CSR
	xorl	%r12d, %r12d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=2
	leal	1(%r12), %esi
	movl	(%r13), %eax
	cmpl	%eax, %r12d
	movl	%esi, %r12d
	jge	LBB0_10
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_FW_AUTH_WAIT_PERIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	movq	_FCU_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_GET_CAP_CSR
	movq	_FCU_AUTH_STS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_FCU_STS_LOAD_DONE@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %eax
	testl	%r14d, %eax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %eax
	movl	%r12d, %esi
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%eax, %esi
	jg	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rax
	jmp	LBB0_12
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_4:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	jmp	LBB0_15
LBB0_14:
	leaq	L_.str.1(%rip), %rdi
LBB0_15:
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FCU_LOADED_AE_POS,4,2          ## @FCU_LOADED_AE_POS
	.comm	_ICP_QAT_CSS_FWSK_PUB_LEN,8,3   ## @ICP_QAT_CSS_FWSK_PUB_LEN
	.comm	_ICP_QAT_CSS_SIGNATURE_LEN,8,3  ## @ICP_QAT_CSS_SIGNATURE_LEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QAT: AE %d is active\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FCU_CONTROL,4,2                ## @FCU_CONTROL
	.comm	_FCU_CTRL_CMD_LOAD,4,2          ## @FCU_CTRL_CMD_LOAD
	.comm	_FCU_CTRL_AE_POS,4,2            ## @FCU_CTRL_AE_POS
	.comm	_FW_AUTH_WAIT_PERIOD,4,2        ## @FW_AUTH_WAIT_PERIOD
	.comm	_FCU_STATUS,4,2                 ## @FCU_STATUS
	.comm	_FCU_AUTH_STS_MASK,4,2          ## @FCU_AUTH_STS_MASK
	.comm	_FCU_STS_LOAD_DONE,4,2          ## @FCU_STS_LOAD_DONE
	.comm	_FW_AUTH_MAX_RETRY,4,2          ## @FW_AUTH_MAX_RETRY
L_.str.1:                               ## @.str.1
	.asciz	"QAT: firmware load failed timeout %x\n"

	.no_dead_strip	_qat_uclo_load_fw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qat_uclo_load_fw
_qat_uclo_load_fw:                      ; @qat_uclo_load_fw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x8, [x0]
	ldr	w9, [x8]
	cbz	w9, LBB0_11
; %bb.1:
	mov	x19, x0
	mov	w20, #0
Lloh0:
	adrp	x9, _FCU_LOADED_AE_POS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FCU_LOADED_AE_POS@GOTPAGEOFF]
Lloh2:
	adrp	x10, _ICP_QAT_CSS_FWSK_PUB_LEN@GOTPAGE
Lloh3:
	ldr	x10, [x10, _ICP_QAT_CSS_FWSK_PUB_LEN@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x9]
Lloh5:
	ldr	x9, [x10]
	add	x9, x1, x9
	add	x9, x9, #8
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
Lloh6:
	adrp	x9, _ICP_QAT_CSS_SIGNATURE_LEN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ICP_QAT_CSS_SIGNATURE_LEN@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	str	x9, [sp]                        ; 8-byte Folded Spill
Lloh9:
	adrp	x26, _FW_AUTH_WAIT_PERIOD@GOTPAGE
Lloh10:
	ldr	x26, [x26, _FW_AUTH_WAIT_PERIOD@GOTPAGEOFF]
Lloh11:
	adrp	x27, _FCU_STATUS@GOTPAGE
Lloh12:
	ldr	x27, [x27, _FCU_STATUS@GOTPAGEOFF]
Lloh13:
	adrp	x28, _FCU_AUTH_STS_MASK@GOTPAGE
Lloh14:
	ldr	x28, [x28, _FCU_AUTH_STS_MASK@GOTPAGEOFF]
Lloh15:
	adrp	x25, _FCU_STS_LOAD_DONE@GOTPAGE
Lloh16:
	ldr	x25, [x25, _FCU_STS_LOAD_DONE@GOTPAGEOFF]
Lloh17:
	adrp	x23, _FW_AUTH_MAX_RETRY@GOTPAGE
Lloh18:
	ldr	x23, [x23, _FW_AUTH_MAX_RETRY@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w20, w20, #1
	ldr	w9, [x8]
	cmp	w20, w9
	b.hs	LBB0_11
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	ldp	x10, x9, [sp]                   ; 16-byte Folded Reload
	ldr	w9, [x10, x9]
	mov	w10, #1
	lsl	w24, w10, w20
	tst	w9, w24
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_qat_hal_check_ae_active
	cbnz	x0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh19:
	adrp	x8, _FCU_CONTROL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _FCU_CONTROL@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x8, _FCU_CTRL_CMD_LOAD@GOTPAGE
Lloh23:
	ldr	x8, [x8, _FCU_CTRL_CMD_LOAD@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _FCU_CTRL_AE_POS@GOTPAGE
Lloh26:
	ldr	x9, [x9, _FCU_CTRL_AE_POS@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	lsl	w9, w20, w9
	orr	w2, w9, w8
	mov	x0, x19
	bl	_SET_CAP_CSR
	mov	w21, #0
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x26]
	bl	_msleep
	ldr	w1, [x27]
	mov	x0, x19
	bl	_GET_CAP_CSR
	ldr	w8, [x28]
	and	w8, w8, w0
	ldr	w9, [x25]
	cmp	w8, w9
	lsr	w8, w0, w22
	and	w8, w8, w24
	ccmp	w8, #0, #4, eq
	b.ne	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	add	w9, w21, #1
	ldr	w8, [x23]
	cmp	w21, w8
	mov	x21, x9
	b.lt	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x21, x9
	cmp	w21, w8
	b.le	LBB0_10
	b	LBB0_13
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x23]
	cmp	w21, w8
	b.gt	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19]
	b	LBB0_2
LBB0_11:
	mov	w0, #0
	b	LBB0_15
LBB0_12:
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	b	LBB0_14
LBB0_13:
Lloh30:
	adrp	x0, l_.str.1@PAGE
Lloh31:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
LBB0_14:
	bl	_pr_err
Lloh32:
	adrp	x8, _EINVAL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_FCU_LOADED_AE_POS,4,2          ; @FCU_LOADED_AE_POS
	.comm	_ICP_QAT_CSS_FWSK_PUB_LEN,8,3   ; @ICP_QAT_CSS_FWSK_PUB_LEN
	.comm	_ICP_QAT_CSS_SIGNATURE_LEN,8,3  ; @ICP_QAT_CSS_SIGNATURE_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QAT: AE %d is active\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FCU_CONTROL,4,2                ; @FCU_CONTROL
	.comm	_FCU_CTRL_CMD_LOAD,4,2          ; @FCU_CTRL_CMD_LOAD
	.comm	_FCU_CTRL_AE_POS,4,2            ; @FCU_CTRL_AE_POS
	.comm	_FW_AUTH_WAIT_PERIOD,4,2        ; @FW_AUTH_WAIT_PERIOD
	.comm	_FCU_STATUS,4,2                 ; @FCU_STATUS
	.comm	_FCU_AUTH_STS_MASK,4,2          ; @FCU_AUTH_STS_MASK
	.comm	_FCU_STS_LOAD_DONE,4,2          ; @FCU_STS_LOAD_DONE
	.comm	_FW_AUTH_MAX_RETRY,4,2          ; @FW_AUTH_MAX_RETRY
l_.str.1:                               ; @.str.1
	.asciz	"QAT: firmware load failed timeout %x\n"

	.no_dead_strip	_qat_uclo_load_fw
.subsections_via_symbols
