	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_aes_restore_sg
_mtk_aes_restore_sg:                    ## @mtk_aes_restore_sg
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpq	$0, 8(%rdi)
	je	LBB0_7
## %bb.1:
	movq	%rdi, %r14
	movl	(%rdi), %ebx
	movq	16(%rdi), %rax
	testq	%rax, %rax
	setne	%cl
	cmpl	$2, %ebx
	jl	LBB0_5
	.p2align	4, 0x90
## %bb.2:
	testq	%rax, %rax
	je	LBB0_5
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	callq	_sg_next
	testq	%rax, %rax
	setne	%cl
	cmpl	$3, %ebx
	jb	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	decl	%ebx
	testq	%rax, %rax
	jne	LBB0_3
LBB0_5:
	testb	%cl, %cl
	je	LBB0_7
## %bb.6:
	movl	8(%r14), %ecx
	addl	%ecx, (%rax)
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_mtk_aes_restore_sg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_aes_restore_sg
_mtk_aes_restore_sg:                    ; @mtk_aes_restore_sg
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	w20, [x0]
	ldr	x0, [x0, #16]
	cmp	x0, #0
	cset	w8, ne
	cmp	w20, #2
	ccmp	x0, #0, #4, ge
	b.eq	LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_sg_next
	cmp	x0, #0
	cset	w8, ne
	cmp	w20, #3
	b.lo	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w20, w20, #1
	cbnz	x0, LBB0_2
LBB0_4:
	cbz	w8, LBB0_6
; %bb.5:
	ldr	w8, [x19, #8]
	ldr	w9, [x0]
	add	w8, w9, w8
	str	w8, [x0]
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_mtk_aes_restore_sg
.subsections_via_symbols
