	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cipher_init                    ## -- Begin function cipher_init
	.p2align	4, 0x90
_cipher_init:                           ## @cipher_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movq	%r8, %rbx
	movl	%ecx, %r12d
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	$0, (%rdi)
	movl	$40, %edi
	movl	$1, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movl	16(%rbp), %ecx
	movl	(%r13), %eax
	movq	_CFLAG_NONE@GOTPCREL(%rip), %rdi
	xorl	%edx, %edx
	movl	(%rdi), %esi
	andl	%eax, %esi
	setne	%dl
	movl	%edx, (%r15)
	movl	%ecx, 4(%r15)
	cmpl	%r12d, 4(%r13)
	jg	LBB0_11
## %bb.3:
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.4:
	movq	%r13, %rdi
	callq	_cipher_ivlen
	movq	_CFLAG_NONE@GOTPCREL(%rip), %rdi
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jle	LBB0_5
LBB0_11:
	movq	_SSH_ERR_INVALID_ARGUMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	jne	LBB0_14
	jmp	LBB0_13
LBB0_1:
	movq	_SSH_ERR_ALLOC_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_15
LBB0_5:
	movl	(%r13), %eax
LBB0_6:
	movq	%r13, 24(%r15)
	movq	_CFLAG_CHACHAPOLY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	%r15, %rdi
	addq	$32, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_chachapoly_init
	movl	%eax, %ebx
	testl	%ebx, %ebx
	je	LBB0_13
LBB0_14:
	movq	%r15, %rdi
	movl	$40, %esi
	callq	_explicit_bzero
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_15
LBB0_8:
	testl	%eax, (%rdi)
	jne	LBB0_13
## %bb.9:
	movq	_CFLAG_AESCTR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.10:
	movq	%r15, %r13
	addq	$16, %r13
	shll	$3, %r12d
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	shll	$3, %ecx
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_aesctr_keysetup
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_aesctr_ivsetup
LBB0_13:
	movq	%r15, (%r14)
	xorl	%ebx, %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SSH_ERR_INTERNAL_ERROR,4,2     ## @SSH_ERR_INTERNAL_ERROR
	.comm	_SSH_ERR_ALLOC_FAIL,4,2         ## @SSH_ERR_ALLOC_FAIL
	.comm	_CFLAG_NONE,4,2                 ## @CFLAG_NONE
	.comm	_SSH_ERR_INVALID_ARGUMENT,4,2   ## @SSH_ERR_INVALID_ARGUMENT
	.comm	_CFLAG_CHACHAPOLY,4,2           ## @CFLAG_CHACHAPOLY
	.comm	_CFLAG_AESCTR,4,2               ## @CFLAG_AESCTR
	.comm	_CIPHER_ENCRYPT,4,2             ## @CIPHER_ENCRYPT
	.comm	_EVP_CTRL_GCM_SET_IV_FIXED,4,2  ## @EVP_CTRL_GCM_SET_IV_FIXED
	.comm	_SSH_ERR_LIBCRYPTO_ERROR,4,2    ## @SSH_ERR_LIBCRYPTO_ERROR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cipher_init                    ; -- Begin function cipher_init
	.p2align	2
_cipher_init:                           ; @cipher_init
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x26, x6
	mov	x24, x5
	mov	x21, x4
	mov	x23, x3
	mov	x22, x2
	mov	x25, x1
	mov	x19, x0
	str	xzr, [x0]
	mov	w0, #40
	mov	w1, #1
	bl	_calloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x27, _CFLAG_NONE@GOTPAGE
Lloh1:
	ldr	x27, [x27, _CFLAG_NONE@GOTPAGEOFF]
	ldr	w9, [x27]
	ldp	w8, w10, [x25]
	tst	w9, w8
	cset	w9, ne
	stp	w9, w26, [x0]
	cmp	w10, w23
	b.gt	LBB0_4
; %bb.2:
	cbz	x21, LBB0_7
; %bb.3:
	mov	x0, x25
	bl	_cipher_ivlen
	cmp	w0, w24
	b.le	LBB0_6
LBB0_4:
Lloh2:
	adrp	x8, _SSH_ERR_INVALID_ARGUMENT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SSH_ERR_INVALID_ARGUMENT@GOTPAGEOFF]
Lloh4:
	ldr	w21, [x8]
	cbnz	w21, LBB0_9
	b	LBB0_13
LBB0_5:
Lloh5:
	adrp	x8, _SSH_ERR_ALLOC_FAIL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SSH_ERR_ALLOC_FAIL@GOTPAGEOFF]
Lloh7:
	ldr	w21, [x8]
	b	LBB0_14
LBB0_6:
	ldr	w8, [x25]
LBB0_7:
	str	x25, [x20, #24]
Lloh8:
	adrp	x9, _CFLAG_CHACHAPOLY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CFLAG_CHACHAPOLY@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.8:
	add	x0, x20, #32
	mov	x1, x22
	mov	x2, x23
	bl	_chachapoly_init
	mov	x21, x0
	cbz	w21, LBB0_13
LBB0_9:
	mov	x0, x20
	mov	w1, #40
	bl	_explicit_bzero
	mov	x0, x20
	bl	_free
	b	LBB0_14
LBB0_10:
	ldr	w9, [x27]
	tst	w9, w8
	b.ne	LBB0_13
; %bb.11:
Lloh11:
	adrp	x9, _CFLAG_AESCTR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CFLAG_AESCTR@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.12:
	add	x25, x20, #16
	lsl	w2, w23, #3
	lsl	w3, w24, #3
	mov	x0, x25
	mov	x1, x22
	bl	_aesctr_keysetup
	mov	x0, x25
	mov	x1, x21
	bl	_aesctr_ivsetup
LBB0_13:
	mov	w21, #0
	str	x20, [x19]
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SSH_ERR_INTERNAL_ERROR,4,2     ; @SSH_ERR_INTERNAL_ERROR
	.comm	_SSH_ERR_ALLOC_FAIL,4,2         ; @SSH_ERR_ALLOC_FAIL
	.comm	_CFLAG_NONE,4,2                 ; @CFLAG_NONE
	.comm	_SSH_ERR_INVALID_ARGUMENT,4,2   ; @SSH_ERR_INVALID_ARGUMENT
	.comm	_CFLAG_CHACHAPOLY,4,2           ; @CFLAG_CHACHAPOLY
	.comm	_CFLAG_AESCTR,4,2               ; @CFLAG_AESCTR
	.comm	_CIPHER_ENCRYPT,4,2             ; @CIPHER_ENCRYPT
	.comm	_EVP_CTRL_GCM_SET_IV_FIXED,4,2  ; @EVP_CTRL_GCM_SET_IV_FIXED
	.comm	_SSH_ERR_LIBCRYPTO_ERROR,4,2    ; @SSH_ERR_LIBCRYPTO_ERROR
.subsections_via_symbols
