	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_aes_gcm_dma
_mtk_aes_gcm_dma:                       ## @mtk_aes_gcm_dma
	.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	%r8, %r13
	movq	%rcx, %rbx
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	leaq	40(%rsi), %rdx
	movq	%r12, 56(%rsi)
	movq	%rcx, 32(%rsi)
	movq	%rcx, 64(%rsi)
	movq	%r12, %rdi
	movq	%r8, %rsi
	callq	_mtk_aes_check_aligned
	movl	%eax, %edx
	cmpq	%rbx, %r12
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movl	%edx, %r14d
	leaq	16(%r15), %rdx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_mtk_aes_check_aligned
	movl	%r14d, %edx
	movl	%eax, %r14d
	testl	%edx, %edx
	jne	LBB0_4
	jmp	LBB0_5
LBB0_1:
	movl	%edx, %r14d
	testl	%edx, %edx
	je	LBB0_5
LBB0_4:
	testl	%r14d, %r14d
	jne	LBB0_11
LBB0_5:
	movq	(%r15), %rax
	movq	_AES_BUF_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_6
## %bb.12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	subl	(%rax), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_aes_complete               ## TAILCALL
LBB0_6:
	testl	%edx, %edx
	je	LBB0_7
## %bb.8:
	testl	%r14d, %r14d
	je	LBB0_9
LBB0_10:
	leaq	12(%r15), %rbx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_sg_init_table
	movl	8(%r15), %esi
	movq	(%r15), %rdx
	movq	%rbx, %rdi
	callq	_sg_set_buf
LBB0_11:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_mtk_aes_gcm_info_init
	movq	%rbx, %rdi
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_aes_map                    ## TAILCALL
LBB0_7:
	movq	%r12, %rdi
	callq	_sg_nents
	movl	8(%r15), %edx
	movq	%r12, %rdi
	movl	%eax, %esi
	movq	%r13, %rcx
	callq	_sg_copy_to_buffer
	leaq	12(%r15), %rax
	movq	%rax, 56(%r15)
	movl	$1, 40(%r15)
	movq	$0, 48(%r15)
	testl	%r14d, %r14d
	jne	LBB0_10
LBB0_9:
	leaq	12(%r15), %rax
	movq	%rax, 32(%r15)
	movl	$1, 16(%r15)
	movq	$0, 24(%r15)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_AES_BUF_SIZE,8,3               ## @AES_BUF_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mtk_aes_gcm_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_aes_gcm_dma
_mtk_aes_gcm_dma:                       ; @mtk_aes_gcm_dma
	.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, x4
	mov	x25, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	str	x3, [x1, #32]
	add	x2, x1, #40
	stp	x22, x3, [x1, #56]
	mov	x0, x22
	mov	x1, x4
	bl	_mtk_aes_check_aligned
	mov	x24, x0
	mov	x23, x0
	cmp	x22, x25
	b.eq	LBB0_2
; %bb.1:
	add	x2, x19, #16
	mov	x0, x25
	mov	x1, x21
	bl	_mtk_aes_check_aligned
	mov	x23, x0
LBB0_2:
	cbz	w24, LBB0_4
; %bb.3:
	cbnz	w23, LBB0_9
LBB0_4:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _AES_BUF_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AES_BUF_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_6
; %bb.5:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w2, w8
	mov	x0, x20
	mov	x1, x19
	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
	b	_mtk_aes_complete
LBB0_6:
	cbz	w24, LBB0_10
; %bb.7:
	cbz	w23, LBB0_11
LBB0_8:
	add	x22, x19, #12
	mov	x0, x22
	mov	w1, #1
	bl	_sg_init_table
	ldr	w1, [x19, #8]
	ldr	x2, [x19]
	mov	x0, x22
	bl	_sg_set_buf
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_mtk_aes_gcm_info_init
	mov	x0, x20
	mov	x1, x19
	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
	b	_mtk_aes_map
LBB0_10:
	mov	x0, x22
	bl	_sg_nents
	mov	x1, x0
	ldr	w2, [x19, #8]
	mov	x0, x22
	mov	x3, x21
	bl	_sg_copy_to_buffer
	mov	w8, #1
	str	w8, [x19, #40]
	add	x8, x19, #12
	stp	xzr, x8, [x19, #48]
	cbnz	w23, LBB0_8
LBB0_11:
	mov	w8, #1
	str	w8, [x19, #16]
	add	x8, x19, #12
	stp	xzr, x8, [x19, #24]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AES_BUF_SIZE,8,3               ; @AES_BUF_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mtk_aes_gcm_dma
.subsections_via_symbols
