	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_sha_handle_queue
_mtk_sha_handle_queue:                  ## @mtk_sha_handle_queue
	.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	%rdx, %rbx
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	(%rax,%rsi,8), %r12
	leaq	16(%r12), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	leaq	20(%r12), %rdi
	movq	%rbx, %rsi
	callq	_ahash_enqueue_request
	movl	%eax, %ebx
	jmp	LBB0_3
LBB0_1:
	xorl	%ebx, %ebx
LBB0_3:
	movq	_SHA_FLAGS_BUSY@GOTPCREL(%rip), %r13
	movl	(%r12), %eax
	testl	%eax, (%r13)
	je	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
LBB0_16:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	leaq	20(%r12), %rbx
	movq	%rbx, %rdi
	callq	_crypto_get_backlog
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_crypto_dequeue_request
	testq	%rax, %rax
	je	LBB0_17
## %bb.6:
	movq	%rax, %r14
	movl	(%r13), %eax
	orl	%eax, (%r12)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	subl	(%rax), %esi
	callq	*(%rdi)
LBB0_8:
	movq	%r14, %rdi
	callq	_ahash_request_cast
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_ahash_request_ctx
	movq	%rax, %r15
	movq	%rbx, 8(%r12)
	movq	%rax, %rdi
	callq	_mtk_sha_info_init
	movq	(%r15), %rax
	movq	_SHA_OP_UPDATE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.9:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_mtk_sha_update_start
	movl	%eax, %r14d
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	movl	%r14d, %ecx
	addl	(%rax), %ecx
	jne	LBB0_11
## %bb.10:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_14
LBB0_17:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_16
LBB0_12:
	movq	_SHA_OP_FINAL@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_14
LBB0_13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_mtk_sha_final_req
	movl	%eax, %r14d
LBB0_14:
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movl	(%rax), %eax
	addl	%r14d, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_mtk_sha_finish_req
	jmp	LBB0_16
LBB0_11:
	movq	_SHA_FLAGS_FINUP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r15)
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_13
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_SHA_FLAGS_BUSY,4,2             ## @SHA_FLAGS_BUSY
	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.comm	_SHA_OP_UPDATE,8,3              ## @SHA_OP_UPDATE
	.comm	_SHA_FLAGS_FINUP,4,2            ## @SHA_FLAGS_FINUP
	.comm	_SHA_OP_FINAL,8,3               ## @SHA_OP_FINAL
	.no_dead_strip	_mtk_sha_handle_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_sha_handle_queue
_mtk_sha_handle_queue:                  ; @mtk_sha_handle_queue
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x20, [x8, x1, lsl #3]
	add	x22, x20, #16
	mov	x0, x22
	bl	_spin_lock_irqsave
	cbz	x21, LBB0_2
; %bb.1:
	add	x0, x20, #20
	mov	x1, x21
	bl	_ahash_enqueue_request
	mov	x21, x0
LBB0_2:
Lloh0:
	adrp	x25, _SHA_FLAGS_BUSY@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SHA_FLAGS_BUSY@GOTPAGEOFF]
	ldr	w8, [x25]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_5
LBB0_3:
	mov	x0, x22
	bl	_spin_unlock_irqrestore
LBB0_4:
	mov	x0, x21
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_5:
	add	x23, x20, #20
	mov	x0, x23
	bl	_crypto_get_backlog
	mov	x24, x0
	mov	x0, x23
	bl	_crypto_dequeue_request
	cbz	x0, LBB0_3
; %bb.6:
	mov	x23, x0
	ldr	w8, [x25]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
Lloh2:
	adrp	x25, _EINPROGRESS@GOTPAGE
Lloh3:
	ldr	x25, [x25, _EINPROGRESS@GOTPAGEOFF]
	cbz	x24, LBB0_8
; %bb.7:
	ldr	x8, [x24]
	ldr	w9, [x25]
	neg	w1, w9
	mov	x0, x24
	blr	x8
LBB0_8:
	mov	x0, x23
	bl	_ahash_request_cast
	mov	x22, x0
	bl	_ahash_request_ctx
	mov	x23, x0
	str	x22, [x20, #8]
	bl	_mtk_sha_info_init
	ldr	x8, [x23]
Lloh4:
	adrp	x9, _SHA_OP_UPDATE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _SHA_OP_UPDATE@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.9:
	mov	x0, x19
	mov	x1, x20
	bl	_mtk_sha_update_start
	mov	x22, x0
	ldr	w8, [x25]
	cmn	w0, w8
	b.eq	LBB0_14
; %bb.10:
	ldr	w8, [x23, #8]
Lloh7:
	adrp	x9, _SHA_FLAGS_FINUP@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SHA_FLAGS_FINUP@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_12
	b	LBB0_14
LBB0_11:
Lloh10:
	adrp	x9, _SHA_OP_FINAL@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SHA_OP_FINAL@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
LBB0_12:
	mov	x0, x19
	mov	x1, x20
	bl	_mtk_sha_final_req
	mov	x22, x0
	b	LBB0_14
LBB0_13:
	mov	w22, #0
LBB0_14:
	ldr	w8, [x25]
	cmn	w22, w8
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_4
; %bb.15:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_mtk_sha_finish_req
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SHA_FLAGS_BUSY,4,2             ; @SHA_FLAGS_BUSY
	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.comm	_SHA_OP_UPDATE,8,3              ; @SHA_OP_UPDATE
	.comm	_SHA_FLAGS_FINUP,4,2            ; @SHA_FLAGS_FINUP
	.comm	_SHA_OP_FINAL,8,3               ; @SHA_OP_FINAL
	.no_dead_strip	_mtk_sha_handle_queue
.subsections_via_symbols
