	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_cipher_set_iv          ## -- Begin function mbedtls_cipher_set_iv
	.p2align	4, 0x90
_mbedtls_cipher_set_iv:                 ## @mbedtls_cipher_set_iv
	.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
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.2:
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%rdx, %r14
	movq	_MBEDTLS_MAX_IV_LENGTH@GOTPCREL(%rip), %rcx
	cmpq	%rdx, (%rcx)
	jae	LBB0_5
## %bb.4:
	movq	_MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_5:
	movq	_MBEDTLS_CIPHER_VARIABLE_IV_LEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_10
## %bb.6:
	movq	8(%rax), %rax
	cmpq	%r14, %rax
	movq	%rax, %r14
	jbe	LBB0_10
LBB0_7:
	movq	_MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	movl	8(%rbx), %edi
	movq	%r14, %rdx
	callq	_memcpy
	movq	%r14, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA,4,2 ## @MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
	.comm	_MBEDTLS_MAX_IV_LENGTH,8,3      ## @MBEDTLS_MAX_IV_LENGTH
	.comm	_MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE,4,2 ## @MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE
	.comm	_MBEDTLS_CIPHER_VARIABLE_IV_LEN,4,2 ## @MBEDTLS_CIPHER_VARIABLE_IV_LEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_cipher_set_iv          ; -- Begin function mbedtls_cipher_set_iv
	.p2align	2
_mbedtls_cipher_set_iv:                 ; @mbedtls_cipher_set_iv
	.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
	cbz	x0, LBB0_7
; %bb.1:
	cbz	x1, LBB0_7
; %bb.2:
	mov	x20, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_7
; %bb.3:
	mov	x19, x2
Lloh0:
	adrp	x9, _MBEDTLS_MAX_IV_LENGTH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MBEDTLS_MAX_IV_LENGTH@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x9, x2
	b.hs	LBB0_5
; %bb.4:
Lloh3:
	adrp	x8, _MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	ldr	w9, [x8]
Lloh5:
	adrp	x10, _MBEDTLS_CIPHER_VARIABLE_IV_LEN@GOTPAGE
Lloh6:
	ldr	x10, [x10, _MBEDTLS_CIPHER_VARIABLE_IV_LEN@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_10
; %bb.6:
	ldr	x8, [x8, #8]
	cmp	x8, x19
	mov	x19, x8
	b.ls	LBB0_10
LBB0_7:
Lloh8:
	adrp	x8, _MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	w0, [x20, #8]
	mov	x2, x19
	bl	_memcpy
	mov	w0, #0
	str	x19, [x20]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA,4,2 ; @MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
	.comm	_MBEDTLS_MAX_IV_LENGTH,8,3      ; @MBEDTLS_MAX_IV_LENGTH
	.comm	_MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE,4,2 ; @MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE
	.comm	_MBEDTLS_CIPHER_VARIABLE_IV_LEN,4,2 ; @MBEDTLS_CIPHER_VARIABLE_IV_LEN
.subsections_via_symbols
