	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_sha_update_start
_mtk_sha_update_start:                  ## @mtk_sha_update_start
	.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	%rsi, %r15
	movq	%rdi, %r14
	movl	4(%rsi), %edi
	callq	_ahash_request_ctx
	cmpq	$0, 40(%rax)
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	cmpq	$0, (%rax)
	jne	LBB0_26
## %bb.4:
	cmpl	$0, 8(%rbx)
	je	LBB0_5
LBB0_26:
	movq	%r14, %rdi
	movq	%r15, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_sha_update_slow            ## TAILCALL
LBB0_1:
	xorl	%eax, %eax
LBB0_2:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	24(%rbx), %r13
	movl	4(%r13), %edi
	movl	$4, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_26
## %bb.6:
	movq	%r13, %rdi
	callq	_sg_is_last
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	movl	(%r13), %edi
	movl	12(%rbx), %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_26
LBB0_8:
	movq	40(%rbx), %rdi
	movl	(%r13), %esi
	callq	_min
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_sg_is_last
	movq	_SHA_FLAGS_FINUP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	16(%rbx), %ecx
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	testl	%ecx, %ecx
	jne	LBB0_11
## %bb.10:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	subl	12(%rbx), %eax
	andl	%eax, %r12d
LBB0_11:
	movslq	%r12d, %rdx
	movq	40(%rbx), %rsi
	movq	%rsi, %rax
	subq	%rdx, %rax
	movq	%rax, 40(%rbx)
	movl	%edx, 8(%rbx)
	testl	%ecx, %ecx
	je	LBB0_23
## %bb.12:
	cmpq	%rdx, %rsi
	jne	LBB0_23
## %bb.13:
	movslq	12(%rbx), %r13
	decq	%r13
	andq	%rdx, %r13
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	subl	%r13d, %r12d
	addq	%r13, %rax
	movq	%rax, 40(%rbx)
	movl	%r12d, 8(%rbx)
	movq	24(%rbx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_mtk_sha_append_sg
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_mtk_sha_fill_padding
	movl	(%r14), %edi
	movl	36(%rbx), %esi
	movq	_SHA_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_map_single
	movl	%eax, 32(%rbx)
	movl	(%r14), %edi
	movl	%eax, %esi
	callq	_dma_mapping_error
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_15
LBB0_23:
	movl	(%r14), %edi
	movq	24(%rbx), %rsi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %edx
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_24
## %bb.25:
	movq	_SHA_FLAGS_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%rbx)
	movq	24(%rbx), %rdi
	callq	_sg_dma_address
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	movl	%r12d, %ecx
	jmp	LBB0_18
LBB0_16:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rdx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	_SHA_FLAGS_FINAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	movq	(%rbx), %rcx
	movq	$0, (%rbx)
	cmpl	%r13d, -44(%rbp)                ## 4-byte Folded Reload
	jne	LBB0_20
## %bb.17:
	movq	_SHA_FLAGS_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 16(%rbx)
	movl	32(%rbx), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
                                        ## kill: def $ecx killed $ecx killed $rcx
LBB0_18:
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_sha_xmit                   ## TAILCALL
LBB0_24:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_15:
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_2
LBB0_20:
	movq	%rcx, %r13
	movq	%rsi, 24(%rbx)
	movl	(%r14), %edi
	movl	(%rdx), %ecx
	movl	$1, %edx
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_21
## %bb.22:
	movq	_SHA_FLAGS_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%rbx)
	movq	24(%rbx), %rdi
	callq	_sg_dma_address
	movl	32(%rbx), %r8d
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	movl	%r12d, %ecx
	movq	%r13, %r9
	jmp	LBB0_19
LBB0_21:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_SHA_FLAGS_FINUP,4,2            ## @SHA_FLAGS_FINUP
	.comm	_SHA_BUF_SIZE,4,2               ## @SHA_BUF_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dma map bytes error\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SHA_FLAGS_FINAL,4,2            ## @SHA_FLAGS_FINAL
	.comm	_SHA_FLAGS_SG,4,2               ## @SHA_FLAGS_SG
L_.str.1:                               ## @.str.1
	.asciz	"dma_map_sg error\n"

L_.str.2:                               ## @.str.2
	.asciz	"dma_map_sg  error\n"

	.no_dead_strip	_mtk_sha_update_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_sha_update_start
_mtk_sha_update_start:                  ; @mtk_sha_update_start
	.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, x1
	mov	x20, x0
	ldr	w0, [x1, #4]
	bl	_ahash_request_ctx
	ldr	x8, [x0, #40]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x21, x0
	ldr	x8, [x0]
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_6
LBB0_3:
	mov	x0, x20
	mov	x1, x19
	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
	b	_mtk_sha_update_slow
LBB0_4:
	mov	w0, #0
LBB0_5:
	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_6:
	ldr	x23, [x21, #24]
	ldr	w0, [x23, #4]
	mov	w1, #4
	bl	_IS_ALIGNED
	cbz	w0, LBB0_3
; %bb.7:
	mov	x0, x23
	bl	_sg_is_last
	cbnz	x0, LBB0_9
; %bb.8:
	ldr	w0, [x23]
	ldr	w1, [x21, #12]
	bl	_IS_ALIGNED
	cbz	w0, LBB0_3
LBB0_9:
	ldr	x0, [x21, #40]
	ldr	w1, [x23]
	bl	_min
	mov	x22, x0
	mov	x0, x23
	bl	_sg_is_last
	ldr	w8, [x21, #16]
Lloh0:
	adrp	x9, _SHA_FLAGS_FINUP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SHA_FLAGS_FINUP@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w9, w8
	cmp	x0, #0
	ccmp	w8, #0, #0, ne
	b.ne	LBB0_11
; %bb.10:
	mov	w8, #0
	ldr	w9, [x21, #12]
	neg	w9, w9
	and	w22, w22, w9
LBB0_11:
	sxtw	x10, w22
	ldr	x11, [x21, #40]
	sub	x9, x11, x10
	str	x9, [x21, #40]
	str	w22, [x21, #8]
	cbz	w8, LBB0_15
; %bb.12:
	cmp	x11, x10
	b.ne	LBB0_15
; %bb.13:
	ldrsw	x8, [x21, #12]
	sub	x8, x8, #1
	mov	x10, x22
	sxtw	x10, w10
	and	x26, x8, x10
	sub	w23, w22, w26
	add	x8, x9, x26
	str	x8, [x21, #40]
	str	w23, [x21, #8]
	ldr	x24, [x21, #24]
	mov	x0, x21
	bl	_mtk_sha_append_sg
	mov	x0, x21
	mov	x1, x23
	bl	_mtk_sha_fill_padding
	ldr	w0, [x20]
	ldr	w1, [x21, #36]
Lloh3:
	adrp	x8, _SHA_BUF_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SHA_BUF_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x27, _DMA_TO_DEVICE@GOTPAGE
Lloh7:
	ldr	x27, [x27, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w3, [x27]
	bl	_dma_map_single
	mov	x1, x0
	str	w0, [x21, #32]
	ldr	w0, [x20]
	bl	_dma_mapping_error
	bl	_unlikely
	cbz	x0, LBB0_17
; %bb.14:
	ldr	w0, [x20]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_22
LBB0_15:
	ldr	w0, [x20]
	ldr	x1, [x21, #24]
Lloh10:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	mov	w2, #1
	bl	_dma_map_sg
	cbz	w0, LBB0_21
; %bb.16:
Lloh13:
	adrp	x8, _SHA_FLAGS_SG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SHA_FLAGS_SG@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x21, #16]
	orr	w8, w9, w8
	str	w8, [x21, #16]
	ldr	x0, [x21, #24]
	bl	_sg_dma_address
	mov	x2, x0
	mov	x0, x20
	mov	x1, x19
	mov	x3, x22
	b	LBB0_19
LBB0_17:
Lloh16:
	adrp	x8, _SHA_FLAGS_FINAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SHA_FLAGS_FINAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	ldr	x25, [x21]
	str	xzr, [x21]
	cmp	w22, w26
	b.ne	LBB0_23
; %bb.18:
Lloh19:
	adrp	x8, _SHA_FLAGS_SG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SHA_FLAGS_SG@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	w9, [x21, #16]
	bic	w8, w9, w8
	str	w8, [x21, #16]
	ldr	w2, [x21, #32]
	mov	x0, x20
	mov	x1, x19
	mov	x3, x25
LBB0_19:
	mov	w4, #0
	mov	x5, #0
LBB0_20:
	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
	b	_mtk_sha_xmit
LBB0_21:
	ldr	w0, [x20]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_22:
	bl	_dev_err
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_23:
	str	x24, [x21, #24]
	ldr	w0, [x20]
	ldr	w3, [x27]
	mov	x1, x24
	mov	w2, #1
	bl	_dma_map_sg
	cbz	w0, LBB0_25
; %bb.24:
Lloh27:
	adrp	x8, _SHA_FLAGS_SG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SHA_FLAGS_SG@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [x21, #16]
	orr	w8, w9, w8
	str	w8, [x21, #16]
	ldr	x0, [x21, #24]
	bl	_sg_dma_address
	mov	x2, x0
	ldr	w4, [x21, #32]
	mov	x0, x20
	mov	x1, x19
	mov	x3, x23
	mov	x5, x25
	b	LBB0_20
LBB0_25:
	ldr	w0, [x20]
Lloh30:
	adrp	x1, l_.str.1@PAGE
Lloh31:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_22
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_SHA_FLAGS_FINUP,4,2            ; @SHA_FLAGS_FINUP
	.comm	_SHA_BUF_SIZE,4,2               ; @SHA_BUF_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dma map bytes error\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SHA_FLAGS_FINAL,4,2            ; @SHA_FLAGS_FINAL
	.comm	_SHA_FLAGS_SG,4,2               ; @SHA_FLAGS_SG
l_.str.1:                               ; @.str.1
	.asciz	"dma_map_sg error\n"

l_.str.2:                               ; @.str.2
	.asciz	"dma_map_sg  error\n"

	.no_dead_strip	_mtk_sha_update_start
.subsections_via_symbols
