	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function virtio_crypto_ablkcipher_setkey
_virtio_crypto_ablkcipher_setkey:       ## @virtio_crypto_ablkcipher_setkey
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	callq	_crypto_ablkcipher_ctx
	movq	%rax, %r12
	leaq	-36(%rbp), %rsi
	movl	%r14d, %edi
	callq	_virtio_crypto_alg_validate_key
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	cmpq	$0, (%r12)
	je	LBB0_2
## %bb.5:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_virtio_crypto_alg_ablkcipher_close_session
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_virtio_crypto_alg_ablkcipher_close_session
	jmp	LBB0_6
LBB0_2:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_virtio_crypto_get_current_node
	movq	_VIRTIO_CRYPTO_SERVICE_CIPHER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	-36(%rbp), %edx
	movl	%eax, %edi
	callq	_virtcrypto_get_dev_node
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, (%r12)
LBB0_6:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_virtio_crypto_alg_ablkcipher_init_sessions
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %ebx
	movq	(%r12), %rdi
	callq	_virtcrypto_dev_put
	movq	$0, (%r12)
	jmp	LBB0_9
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIRTIO_CRYPTO_SERVICE_CIPHER,4,2 ## @VIRTIO_CRYPTO_SERVICE_CIPHER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"virtio_crypto: Could not find a virtio device in the system or unsupported algo\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_virtio_crypto_ablkcipher_setkey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function virtio_crypto_ablkcipher_setkey
_virtio_crypto_ablkcipher_setkey:       ; @virtio_crypto_ablkcipher_setkey
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x21, x1
	bl	_crypto_ablkcipher_ctx
	mov	x19, x0
	add	x1, sp, #12
	mov	x0, x20
	bl	_virtio_crypto_alg_validate_key
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	x8, [x19]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	mov	w1, #1
	bl	_virtio_crypto_alg_ablkcipher_close_session
	mov	x0, x19
	mov	w1, #0
	bl	_virtio_crypto_alg_ablkcipher_close_session
	b	LBB0_5
LBB0_3:
	bl	_virtio_crypto_get_current_node
Lloh0:
	adrp	x8, _VIRTIO_CRYPTO_SERVICE_CIPHER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIRTIO_CRYPTO_SERVICE_CIPHER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [sp, #12]
	bl	_virtcrypto_get_dev_node
	cbz	x0, LBB0_7
; %bb.4:
	str	x0, [x19]
LBB0_5:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_virtio_crypto_alg_ablkcipher_init_sessions
	mov	x22, x0
	cbz	w0, LBB0_8
; %bb.6:
	ldr	x0, [x19]
	bl	_virtcrypto_dev_put
	str	xzr, [x19]
	b	LBB0_8
LBB0_7:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh5:
	adrp	x8, _ENODEV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_VIRTIO_CRYPTO_SERVICE_CIPHER,4,2 ; @VIRTIO_CRYPTO_SERVICE_CIPHER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"virtio_crypto: Could not find a virtio device in the system or unsupported algo\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_virtio_crypto_ablkcipher_setkey
.subsections_via_symbols
