	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_cryp_hw_init
_stm32_cryp_hw_init:                    ## @stm32_cryp_hw_init
	.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	%rdi, %r14
	movl	24(%rdi), %edi
	callq	_pm_runtime_get_sync
	movq	_CRYP_IMSCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_stm32_cryp_write
	movq	%r14, %rdi
	callq	_stm32_cryp_hw_write_key
	movq	_CR_DATA8@GOTPCREL(%rip), %rax
	movq	_CR_FFLUSH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movq	32(%r14), %rcx
	movl	(%rcx), %edx
	cmpl	$135, %edx
	jne	LBB0_1
## %bb.2:
	movq	_CR_KEY192@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movq	_CR_KEY256@GOTPCREL(%rip), %rcx
LBB0_3:
	orl	(%rax), %r15d
	cmpl	$136, %edx
	jne	LBB0_5
## %bb.4:
	movq	_CR_KEY128@GOTPCREL(%rip), %rcx
LBB0_5:
	orl	(%rcx), %r15d
	movq	%r14, %rdi
	callq	_stm32_cryp_get_hw_mode
	movl	%eax, %r12d
	movq	_CR_AES_UNKNOWN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_7
## %bb.6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_27
LBB0_7:
	movq	%r14, %rdi
	callq	_is_decrypt
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:
	cmpl	$133, %r12d
	je	LBB0_10
## %bb.9:
	movq	_CR_AES_ECB@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_12
LBB0_10:
	movq	_CRYP_CR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CR_AES_KP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	%r15d, %edx
	movq	_CR_CRYPEN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_stm32_cryp_write
	movq	%r14, %rdi
	callq	_stm32_cryp_wait_busy
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	movl	24(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_27
LBB0_12:
	orl	%r12d, %r15d
	movq	%r14, %rdi
	callq	_is_decrypt
	xorl	%ecx, %ecx
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	_CR_DEC_NOT_ENC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_14:
	orl	%ecx, %r15d
	movq	_CRYP_CR@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_stm32_cryp_write
	addl	$-128, %r12d
	cmpl	$5, %r12d
	ja	LBB0_26
## %bb.15:
	movl	$43, %eax
	btl	%r12d, %eax
	jae	LBB0_16
## %bb.25:
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	callq	_stm32_cryp_hw_write_iv
LBB0_26:
	movq	_CR_CRYPEN@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movl	(%r13), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_stm32_cryp_write
	movq	_FLG_CCM_PADDED_WA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%r14)
	xorl	%ebx, %ebx
LBB0_27:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%r14, %rdi
	movl	%r15d, %esi
	cmpl	$2, %r12d
	jne	LBB0_17
## %bb.18:
	callq	_stm32_cryp_gcm_init
	jmp	LBB0_19
LBB0_17:
	callq	_stm32_cryp_ccm_init
LBB0_19:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_27
## %bb.20:
	movq	16(%r14), %rax
	cmpl	$0, (%rax)
	je	LBB0_22
## %bb.21:
	movq	_CR_PH_HEADER@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	jmp	LBB0_26
LBB0_22:
	movq	%r14, %rdi
	callq	_stm32_cryp_get_input_text_len
	testl	%eax, %eax
	je	LBB0_24
## %bb.23:
	movq	_CR_PH_PAYLOAD@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movl	(%r13), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_stm32_cryp_write
	jmp	LBB0_26
LBB0_24:
	movq	_CR_PH_INIT@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_CRYP_IMSCR,4,2                 ## @CRYP_IMSCR
	.comm	_CR_DATA8,4,2                   ## @CR_DATA8
	.comm	_CR_FFLUSH,4,2                  ## @CR_FFLUSH
	.comm	_CR_KEY128,4,2                  ## @CR_KEY128
	.comm	_CR_KEY192,4,2                  ## @CR_KEY192
	.comm	_CR_KEY256,4,2                  ## @CR_KEY256
	.comm	_CR_AES_UNKNOWN,4,2             ## @CR_AES_UNKNOWN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CR_AES_ECB,4,2                 ## @CR_AES_ECB
	.comm	_CRYP_CR,4,2                    ## @CRYP_CR
	.comm	_CR_AES_KP,4,2                  ## @CR_AES_KP
	.comm	_CR_CRYPEN,4,2                  ## @CR_CRYPEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout (key preparation)\n"

	.comm	_CR_DEC_NOT_ENC,4,2             ## @CR_DEC_NOT_ENC
	.comm	_CR_PH_HEADER,4,2               ## @CR_PH_HEADER
	.comm	_CR_PH_PAYLOAD,4,2              ## @CR_PH_PAYLOAD
	.comm	_CR_PH_INIT,4,2                 ## @CR_PH_INIT
	.comm	_FLG_CCM_PADDED_WA,4,2          ## @FLG_CCM_PADDED_WA
	.no_dead_strip	_stm32_cryp_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32_cryp_hw_init
_stm32_cryp_hw_init:                    ; @stm32_cryp_hw_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	w0, [x0, #24]
	bl	_pm_runtime_get_sync
Lloh0:
	adrp	x8, _CRYP_IMSCR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CRYP_IMSCR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_stm32_cryp_write
	mov	x0, x19
	bl	_stm32_cryp_hw_write_key
Lloh3:
	adrp	x8, _CR_DATA8@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CR_DATA8@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
Lloh6:
	adrp	x8, _CR_FFLUSH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CR_FFLUSH@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
	ldr	x8, [x19, #32]
Lloh9:
	adrp	x9, _CR_KEY128@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CR_KEY128@GOTPAGEOFF]
Lloh11:
	adrp	x10, _CR_KEY192@GOTPAGE
Lloh12:
	ldr	x10, [x10, _CR_KEY192@GOTPAGEOFF]
Lloh13:
	adrp	x11, _CR_KEY256@GOTPAGE
Lloh14:
	ldr	x11, [x11, _CR_KEY256@GOTPAGEOFF]
	ldr	w8, [x8]
	cmp	w8, #135
	csel	x10, x10, x11, eq
	cmp	w8, #136
	csel	x8, x9, x10, eq
	ldr	w23, [x8]
	mov	x0, x19
	bl	_stm32_cryp_get_hw_mode
Lloh15:
	adrp	x8, _CR_AES_UNKNOWN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CR_AES_UNKNOWN@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.1:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_11
LBB0_2:
	mov	x21, x0
	orr	w8, w22, w20
	orr	w20, w8, w23
	mov	x0, x19
	bl	_is_decrypt
Lloh21:
	adrp	x23, _CRYP_CR@GOTPAGE
Lloh22:
	ldr	x23, [x23, _CRYP_CR@GOTPAGEOFF]
	cbz	x0, LBB0_7
; %bb.3:
	cmp	w21, #133
	b.eq	LBB0_5
; %bb.4:
Lloh23:
	adrp	x8, _CR_AES_ECB@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CR_AES_ECB@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ne	LBB0_7
LBB0_5:
	ldr	w1, [x23]
Lloh26:
	adrp	x8, _CR_AES_KP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CR_AES_KP@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	orr	w8, w8, w20
Lloh29:
	adrp	x9, _CR_CRYPEN@GOTPAGE
Lloh30:
	ldr	x9, [x9, _CR_CRYPEN@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_stm32_cryp_write
	mov	x0, x19
	bl	_stm32_cryp_wait_busy
	cbz	w0, LBB0_7
; %bb.6:
	mov	x22, x0
	ldr	w0, [x19, #24]
Lloh32:
	adrp	x1, l_.str@PAGE
Lloh33:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_11
LBB0_7:
	orr	w20, w20, w21
	mov	x0, x19
	bl	_is_decrypt
Lloh34:
	adrp	x8, _CR_DEC_NOT_ENC@GOTPAGE
Lloh35:
	ldr	x8, [x8, _CR_DEC_NOT_ENC@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
	orr	w20, w20, w8
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x20
	bl	_stm32_cryp_write
	sub	w8, w21, #128
	cmp	w8, #5
	b.hi	LBB0_10
; %bb.8:
	mov	w9, #1
	lsl	w9, w9, w8
	mov	w10, #43
	tst	w9, w10
	b.eq	LBB0_12
; %bb.9:
	ldr	x8, [x19, #8]
	ldr	x1, [x8]
	mov	x0, x19
	bl	_stm32_cryp_hw_write_iv
LBB0_10:
Lloh37:
	adrp	x8, _CR_CRYPEN@GOTPAGE
Lloh38:
	ldr	x8, [x8, _CR_CRYPEN@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	orr	w2, w8, w20
	ldr	w1, [x23]
	mov	x0, x19
	bl	_stm32_cryp_write
	mov	w22, #0
Lloh40:
	adrp	x8, _FLG_CCM_PADDED_WA@GOTPAGE
Lloh41:
	ldr	x8, [x8, _FLG_CCM_PADDED_WA@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
LBB0_11:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x0, x19
	mov	x1, x20
	cmp	w8, #2
	b.ne	LBB0_14
; %bb.13:
	bl	_stm32_cryp_gcm_init
	mov	x22, x0
	cbnz	w0, LBB0_11
	b	LBB0_15
LBB0_14:
	bl	_stm32_cryp_ccm_init
	mov	x22, x0
	cbnz	w0, LBB0_11
LBB0_15:
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	cbz	w8, LBB0_18
; %bb.16:
Lloh43:
	adrp	x8, _CR_PH_HEADER@GOTPAGE
Lloh44:
	ldr	x8, [x8, _CR_PH_HEADER@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	orr	w20, w8, w20
	b	LBB0_10
LBB0_18:
	mov	x0, x19
	bl	_stm32_cryp_get_input_text_len
	cbz	w0, LBB0_20
; %bb.19:
Lloh45:
	adrp	x8, _CR_PH_PAYLOAD@GOTPAGE
Lloh46:
	ldr	x8, [x8, _CR_PH_PAYLOAD@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
	orr	w20, w8, w20
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x20
	bl	_stm32_cryp_write
	b	LBB0_10
LBB0_20:
Lloh48:
	adrp	x8, _CR_PH_INIT@GOTPAGE
Lloh49:
	ldr	x8, [x8, _CR_PH_INIT@GOTPAGEOFF]
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_CRYP_IMSCR,4,2                 ; @CRYP_IMSCR
	.comm	_CR_DATA8,4,2                   ; @CR_DATA8
	.comm	_CR_FFLUSH,4,2                  ; @CR_FFLUSH
	.comm	_CR_KEY128,4,2                  ; @CR_KEY128
	.comm	_CR_KEY192,4,2                  ; @CR_KEY192
	.comm	_CR_KEY256,4,2                  ; @CR_KEY256
	.comm	_CR_AES_UNKNOWN,4,2             ; @CR_AES_UNKNOWN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CR_AES_ECB,4,2                 ; @CR_AES_ECB
	.comm	_CRYP_CR,4,2                    ; @CRYP_CR
	.comm	_CR_AES_KP,4,2                  ; @CR_AES_KP
	.comm	_CR_CRYPEN,4,2                  ; @CR_CRYPEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout (key preparation)\n"

	.comm	_CR_DEC_NOT_ENC,4,2             ; @CR_DEC_NOT_ENC
	.comm	_CR_PH_HEADER,4,2               ; @CR_PH_HEADER
	.comm	_CR_PH_PAYLOAD,4,2              ; @CR_PH_PAYLOAD
	.comm	_CR_PH_INIT,4,2                 ; @CR_PH_INIT
	.comm	_FLG_CCM_PADDED_WA,4,2          ; @FLG_CCM_PADDED_WA
	.no_dead_strip	_stm32_cryp_hw_init
.subsections_via_symbols
