	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_sg_done
_s5p_sg_done:                           ## @s5p_sg_done
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movq	%r14, %rdi
	callq	_ablkcipher_request_ctx
	movq	%rax, %r15
	leaq	8(%rbx), %r12
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movl	32(%rbx), %edi
	movq	24(%rbx), %rax
	movl	4(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	8(%rbx), %rdi
	callq	_sg_virt
	movq	24(%rbx), %rcx
	movl	4(%rcx), %edx
	movl	8(%rcx), %esi
	movl	%eax, %edi
	movl	$1, %ecx
	callq	_s5p_sg_copy_buf
LBB0_2:
	leaq	16(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_s5p_free_sg_cpy
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_s5p_free_sg_cpy
	movl	(%r15), %eax
	movq	_FLAGS_AES_CBC@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.3:
	movl	(%r14), %r14d
	movq	(%rbx), %rbx
	xorl	%edi, %edi
	callq	_SSS_REG_AES_IV_DATA
	jmp	LBB0_4
LBB0_5:
	movq	_FLAGS_AES_CTR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movl	(%r14), %r14d
	movq	(%rbx), %rbx
	xorl	%edi, %edi
	callq	_SSS_REG_AES_CNT_DATA
LBB0_4:
	addq	%rax, %rbx
	movq	_AES_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	movq	%rbx, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memcpy_fromio                  ## TAILCALL
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Copying %d bytes of output data back to original place\n"

	.comm	_FLAGS_AES_CBC,4,2              ## @FLAGS_AES_CBC
	.comm	_AES_BLOCK_SIZE,4,2             ## @AES_BLOCK_SIZE
	.comm	_FLAGS_AES_CTR,4,2              ## @FLAGS_AES_CTR
	.no_dead_strip	_s5p_sg_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5p_sg_done
_s5p_sg_done:                           ; @s5p_sg_done
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x20, [x0, #24]
	mov	x0, x20
	bl	_ablkcipher_request_ctx
	mov	x21, x0
	mov	x22, x19
	ldr	x8, [x22, #8]!
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w0, [x19, #32]
	ldr	x8, [x19, #24]
	ldr	w2, [x8, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	x0, [x19, #8]
	bl	_sg_virt
	ldr	x8, [x19, #24]
	ldp	w2, w1, [x8, #4]
	mov	w3, #1
	bl	_s5p_sg_copy_buf
LBB0_2:
	add	x1, x19, #16
	mov	x0, x19
	bl	_s5p_free_sg_cpy
	mov	x0, x19
	mov	x1, x22
	bl	_s5p_free_sg_cpy
	ldr	w8, [x21]
Lloh2:
	adrp	x9, _FLAGS_AES_CBC@GOTPAGE
Lloh3:
	ldr	x9, [x9, _FLAGS_AES_CBC@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	w20, [x20]
	ldr	x19, [x19]
	mov	w0, #0
	bl	_SSS_REG_AES_IV_DATA
	b	LBB0_6
LBB0_4:
Lloh5:
	adrp	x9, _FLAGS_AES_CTR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _FLAGS_AES_CTR@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	ldr	w20, [x20]
	ldr	x19, [x19]
	mov	w0, #0
	bl	_SSS_REG_AES_CNT_DATA
LBB0_6:
	add	x1, x0, x19
Lloh8:
	adrp	x8, _AES_BLOCK_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AES_BLOCK_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_memcpy_fromio
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Copying %d bytes of output data back to original place\n"

	.comm	_FLAGS_AES_CBC,4,2              ; @FLAGS_AES_CBC
	.comm	_AES_BLOCK_SIZE,4,2             ; @AES_BLOCK_SIZE
	.comm	_FLAGS_AES_CTR,4,2              ; @FLAGS_AES_CTR
	.no_dead_strip	_s5p_sg_done
.subsections_via_symbols
