	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qat_hal_clr_reset              ## -- Begin function qat_hal_clr_reset
	.p2align	4, 0x90
_qat_hal_clr_reset:                     ## @qat_hal_clr_reset
	.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, %r14
	movq	_ICP_RESET@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_GET_GLB_CSR
	movq	(%r14), %rdx
	movq	_RST_CSR_AE_LSB@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	(%rdx), %esi
	movl	4(%rdx), %r13d
	shll	%cl, %esi
	movq	_RST_CSR_QAT_LSB@GOTPCREL(%rip), %r12
	movb	(%r12), %cl
	shll	%cl, %r13d
	orl	%esi, %r13d
	notl	%r13d
	andl	%eax, %r13d
	movl	$-101, %ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_SET_GLB_CSR
	incl	%ebx
	je	LBB0_10
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_GET_GLB_CSR
	movq	(%r14), %rdx
	movl	4(%rdx), %esi
	movzbl	(%r12), %ecx
	shll	%cl, %esi
	orl	(%rdx), %esi
	testl	%eax, %esi
	jne	LBB0_1
## %bb.3:
	movq	_ICP_GLOBAL_CLK_ENABLE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_GET_GLB_CSR
	movq	(%r14), %rcx
	orl	(%rcx), %eax
	movl	4(%rcx), %edx
	shll	$20, %edx
	orl	%eax, %edx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_SET_GLB_CSR
	movq	%r14, %rdi
	callq	_qat_hal_check_ae_alive
	testq	%rax, %rax
	jne	LBB0_10
## %bb.4:
	movq	(%r14), %rax
	cmpb	$0, 8(%rax)
	je	LBB0_7
## %bb.5:
	xorl	%ebx, %ebx
	movq	_ICP_QAT_UCLO_AE_ALL_CTX@GOTPCREL(%rip), %r13
	movq	_INIT_WAKEUP_EVENTS_VALUE@GOTPCREL(%rip), %r15
	movq	_INIT_SIG_EVENTS_VALUE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_CTX_ENABLES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_INIT_CTX_ENABLE_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movzbl	%bl, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_qat_hal_wr_ae_csr
	movl	(%r13), %edx
	movq	_CTX_STS_INDIRECT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	(%r14), %rax
	movq	_INIT_PC_VALUE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	andl	12(%rax), %r8d
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_qat_hal_wr_indr_csr
	movq	_CTX_ARB_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_INIT_CTX_ARB_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_qat_hal_wr_ae_csr
	movq	_CC_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_INIT_CCENABLE_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_qat_hal_wr_ae_csr
	movl	(%r13), %edx
	movl	(%r15), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_qat_hal_put_wakeup_event
	movl	(%r13), %edx
	movl	(%r12), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_qat_hal_put_sig_event
	incb	%bl
	movq	(%r14), %rax
	cmpb	8(%rax), %bl
	jb	LBB0_6
LBB0_7:
	movq	%r14, %rdi
	callq	_qat_hal_init_esram
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:
	movq	_SHRAM_INIT_CYCLES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_qat_hal_wait_cycles
	testq	%rax, %rax
	je	LBB0_9
LBB0_10:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r14, %rdi
	callq	_qat_hal_reset_timestamp
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_ICP_RESET,4,2                  ## @ICP_RESET
	.comm	_RST_CSR_AE_LSB,4,2             ## @RST_CSR_AE_LSB
	.comm	_RST_CSR_QAT_LSB,4,2            ## @RST_CSR_QAT_LSB
	.comm	_ICP_GLOBAL_CLK_ENABLE,4,2      ## @ICP_GLOBAL_CLK_ENABLE
	.comm	_CTX_ENABLES,4,2                ## @CTX_ENABLES
	.comm	_INIT_CTX_ENABLE_VALUE,4,2      ## @INIT_CTX_ENABLE_VALUE
	.comm	_ICP_QAT_UCLO_AE_ALL_CTX,4,2    ## @ICP_QAT_UCLO_AE_ALL_CTX
	.comm	_CTX_STS_INDIRECT,4,2           ## @CTX_STS_INDIRECT
	.comm	_INIT_PC_VALUE,4,2              ## @INIT_PC_VALUE
	.comm	_CTX_ARB_CNTL,4,2               ## @CTX_ARB_CNTL
	.comm	_INIT_CTX_ARB_VALUE,4,2         ## @INIT_CTX_ARB_VALUE
	.comm	_CC_ENABLE,4,2                  ## @CC_ENABLE
	.comm	_INIT_CCENABLE_VALUE,4,2        ## @INIT_CCENABLE_VALUE
	.comm	_INIT_WAKEUP_EVENTS_VALUE,4,2   ## @INIT_WAKEUP_EVENTS_VALUE
	.comm	_INIT_SIG_EVENTS_VALUE,4,2      ## @INIT_SIG_EVENTS_VALUE
	.comm	_SHRAM_INIT_CYCLES,4,2          ## @SHRAM_INIT_CYCLES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QAT: failed to get device out of reset\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qat_hal_clr_reset              ; -- Begin function qat_hal_clr_reset
	.p2align	2
_qat_hal_clr_reset:                     ; @qat_hal_clr_reset
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _ICP_RESET@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ICP_RESET@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_GET_GLB_CSR
Lloh2:
	adrp	x8, _RST_CSR_AE_LSB@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RST_CSR_AE_LSB@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh4:
	ldr	w8, [x8]
	ldp	w10, w9, [x9]
Lloh5:
	adrp	x22, _RST_CSR_QAT_LSB@GOTPAGE
Lloh6:
	ldr	x22, [x22, _RST_CSR_QAT_LSB@GOTPAGEOFF]
	lsl	w8, w10, w8
	ldr	w10, [x22]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	bic	w20, w0, w8
	mov	w23, #-101
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_SET_GLB_CSR
	adds	w23, w23, #1
	b.hs	LBB0_9
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x21]
	mov	x0, x19
	bl	_GET_GLB_CSR
	ldr	x8, [x19]
	ldp	w9, w8, [x8]
	ldr	w10, [x22]
	lsl	w8, w8, w10
	orr	w8, w8, w9
	tst	w8, w0
	b.ne	LBB0_1
; %bb.3:
Lloh7:
	adrp	x20, _ICP_GLOBAL_CLK_ENABLE@GOTPAGE
Lloh8:
	ldr	x20, [x20, _ICP_GLOBAL_CLK_ENABLE@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_GET_GLB_CSR
	ldr	x8, [x19]
	ldp	w9, w8, [x8]
	orr	w9, w9, w0
	orr	w2, w9, w8, lsl #20
	ldr	w1, [x20]
	mov	x0, x19
	bl	_SET_GLB_CSR
	mov	x0, x19
	bl	_qat_hal_check_ae_alive
	cbnz	x0, LBB0_9
; %bb.4:
	ldr	x8, [x19]
	ldrb	w8, [x8, #8]
	cbz	w8, LBB0_7
; %bb.5:
	mov	w21, #0
Lloh9:
	adrp	x24, _ICP_QAT_UCLO_AE_ALL_CTX@GOTPAGE
Lloh10:
	ldr	x24, [x24, _ICP_QAT_UCLO_AE_ALL_CTX@GOTPAGEOFF]
Lloh11:
	adrp	x27, _CTX_ARB_CNTL@GOTPAGE
Lloh12:
	ldr	x27, [x27, _CTX_ARB_CNTL@GOTPAGEOFF]
Lloh13:
	adrp	x28, _INIT_CTX_ARB_VALUE@GOTPAGE
Lloh14:
	ldr	x28, [x28, _INIT_CTX_ARB_VALUE@GOTPAGEOFF]
Lloh15:
	adrp	x22, _CC_ENABLE@GOTPAGE
Lloh16:
	ldr	x22, [x22, _CC_ENABLE@GOTPAGEOFF]
Lloh17:
	adrp	x23, _INIT_CCENABLE_VALUE@GOTPAGE
Lloh18:
	ldr	x23, [x23, _INIT_CCENABLE_VALUE@GOTPAGEOFF]
Lloh19:
	adrp	x25, _INIT_WAKEUP_EVENTS_VALUE@GOTPAGE
Lloh20:
	ldr	x25, [x25, _INIT_WAKEUP_EVENTS_VALUE@GOTPAGEOFF]
Lloh21:
	adrp	x26, _INIT_SIG_EVENTS_VALUE@GOTPAGE
Lloh22:
	ldr	x26, [x26, _INIT_SIG_EVENTS_VALUE@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
Lloh23:
	adrp	x8, _CTX_ENABLES@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CTX_ENABLES@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
Lloh26:
	adrp	x8, _INIT_CTX_ENABLE_VALUE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _INIT_CTX_ENABLE_VALUE@GOTPAGEOFF]
Lloh28:
	ldr	w3, [x8]
	and	w20, w21, #0xff
	mov	x0, x19
	mov	x1, x20
	bl	_qat_hal_wr_ae_csr
	ldr	w2, [x24]
Lloh29:
	adrp	x8, _CTX_STS_INDIRECT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CTX_STS_INDIRECT@GOTPAGEOFF]
Lloh31:
	ldr	w3, [x8]
	ldr	x8, [x19]
	ldr	w8, [x8, #12]
Lloh32:
	adrp	x9, _INIT_PC_VALUE@GOTPAGE
Lloh33:
	ldr	x9, [x9, _INIT_PC_VALUE@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	and	w4, w9, w8
	mov	x0, x19
	mov	x1, x20
	bl	_qat_hal_wr_indr_csr
	ldr	w2, [x27]
	ldr	w3, [x28]
	mov	x0, x19
	mov	x1, x20
	bl	_qat_hal_wr_ae_csr
	ldr	w2, [x22]
	ldr	w3, [x23]
	mov	x0, x19
	mov	x1, x20
	bl	_qat_hal_wr_ae_csr
	ldr	w2, [x24]
	ldr	w3, [x25]
	mov	x0, x19
	mov	x1, x20
	bl	_qat_hal_put_wakeup_event
	ldr	w2, [x24]
	ldr	w3, [x26]
	mov	x0, x19
	mov	x1, x20
	bl	_qat_hal_put_sig_event
	add	w21, w21, #1
	ldr	x8, [x19]
	ldrb	w8, [x8, #8]
	cmp	w8, w21, uxtb
	b.hi	LBB0_6
LBB0_7:
	mov	x0, x19
	bl	_qat_hal_init_esram
	cbnz	x0, LBB0_9
; %bb.8:
Lloh35:
	adrp	x8, _SHRAM_INIT_CYCLES@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SHRAM_INIT_CYCLES@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	w3, #0
	bl	_qat_hal_wait_cycles
	cbz	x0, LBB0_11
LBB0_9:
Lloh38:
	adrp	x0, l_.str@PAGE
Lloh39:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh40:
	adrp	x8, _EFAULT@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x0, x19
	bl	_qat_hal_reset_timestamp
	mov	w0, #0
	b	LBB0_10
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_ICP_RESET,4,2                  ; @ICP_RESET
	.comm	_RST_CSR_AE_LSB,4,2             ; @RST_CSR_AE_LSB
	.comm	_RST_CSR_QAT_LSB,4,2            ; @RST_CSR_QAT_LSB
	.comm	_ICP_GLOBAL_CLK_ENABLE,4,2      ; @ICP_GLOBAL_CLK_ENABLE
	.comm	_CTX_ENABLES,4,2                ; @CTX_ENABLES
	.comm	_INIT_CTX_ENABLE_VALUE,4,2      ; @INIT_CTX_ENABLE_VALUE
	.comm	_ICP_QAT_UCLO_AE_ALL_CTX,4,2    ; @ICP_QAT_UCLO_AE_ALL_CTX
	.comm	_CTX_STS_INDIRECT,4,2           ; @CTX_STS_INDIRECT
	.comm	_INIT_PC_VALUE,4,2              ; @INIT_PC_VALUE
	.comm	_CTX_ARB_CNTL,4,2               ; @CTX_ARB_CNTL
	.comm	_INIT_CTX_ARB_VALUE,4,2         ; @INIT_CTX_ARB_VALUE
	.comm	_CC_ENABLE,4,2                  ; @CC_ENABLE
	.comm	_INIT_CCENABLE_VALUE,4,2        ; @INIT_CCENABLE_VALUE
	.comm	_INIT_WAKEUP_EVENTS_VALUE,4,2   ; @INIT_WAKEUP_EVENTS_VALUE
	.comm	_INIT_SIG_EVENTS_VALUE,4,2      ; @INIT_SIG_EVENTS_VALUE
	.comm	_SHRAM_INIT_CYCLES,4,2          ; @SHRAM_INIT_CYCLES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QAT: failed to get device out of reset\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
.subsections_via_symbols
