	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssh_set_newkeys                ## -- Begin function ssh_set_newkeys
	.p2align	4, 0x90
_ssh_set_newkeys:                       ## @ssh_set_newkeys
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r14
	leaq	L_.str(%rip), %rdi
	callq	_debug2
	movq	_MODE_OUT@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	88(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	32(%r14), %r15
	movq	_CIPHER_ENCRYPT@GOTPCREL(%rip), %rax
	movq	%r14, %rsi
	jmp	LBB0_3
LBB0_2:
	leaq	80(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	56(%r14), %r15
	leaq	4(%r14), %rsi
	movq	_CIPHER_DECRYPT@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r12d
	movq	24(%r14), %rax
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movslq	%ebx, %rbx
	cmpq	$0, (%rax,%rbx,8)
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_5
## %bb.4:
	movq	72(%r14), %rsi
	movq	56(%r14), %rdx
	movq	32(%r14), %r8
	movq	48(%r14), %rcx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_debug
	movl	%r12d, %r13d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	(%r12), %rdi
	callq	_cipher_free
	movq	$0, (%r12)
	movl	%r13d, %r12d
	movq	24(%r14), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_kex_free_newkeys
	movq	24(%r14), %rax
	movq	$0, (%rax,%rbx,8)
	movq	24(%r14), %rax
LBB0_5:
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movq	%rcx, (%rax,%rbx,8)
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.7:
	movq	(%rdx), %rax
	movq	(%rax), %rax
	movq	$0, (%rax,%rbx,8)
	movq	24(%r14), %rax
	movq	(%rax,%rbx,8), %r15
	movl	40(%r15), %edi
	callq	_cipher_authlen
	testq	%rax, %rax
	je	LBB0_8
LBB0_9:
	movl	$1, 16(%r15)
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_debug
	movl	%eax, %edi
	callq	_DBG
	movl	40(%r15), %esi
	movl	36(%r15), %edx
	movl	32(%r15), %ecx
	movl	24(%r15), %r9d
	movl	28(%r15), %r8d
	movl	%r12d, (%rsp)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_cipher_init
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_30
## %bb.10:
	cmpl	$0, 8(%r14)
	jne	LBB0_13
## %bb.11:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_cipher_warning_message
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rsi
	callq	_error
	movl	$1, 8(%r14)
LBB0_13:
	movq	(%r15), %rax
	movq	_COMP_ZLIB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_16
## %bb.14:
	movq	_COMP_DELAYED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.15:
	cmpq	$0, 16(%r14)
	je	LBB0_24
LBB0_16:
	cmpl	$0, 8(%r15)
	je	LBB0_17
LBB0_24:
	movl	20(%r15), %ecx
	cmpl	$16, %ecx
	jl	LBB0_26
## %bb.25:
	addl	%ecx, %ecx
	movl	$1, %edi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edi
	jmp	LBB0_27
LBB0_6:
	movq	_SSH_ERR_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_30
LBB0_8:
	leaq	16(%r15), %rdi
	callq	_mac_init
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_30
	jmp	LBB0_9
LBB0_26:
	movl	$1073741824, %eax               ## imm = 0x40000000
	xorl	%edx, %edx
	idivl	%ecx
	movl	%eax, %edi
LBB0_27:
	movl	%edi, (%rbx)
	movl	12(%r14), %eax
	testl	%eax, %eax
	je	LBB0_29
## %bb.28:
	cltd
	idivl	20(%r15)
	movl	%eax, %esi
	callq	_MINIMUM
	movl	%eax, %edi
	movl	%eax, (%rbx)
LBB0_29:
	movslq	%edi, %rsi
	leaq	L_.str.4(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_debug
LBB0_30:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ssh_packet_init_compression
	testl	%eax, %eax
	js	LBB0_18
## %bb.19:
	movq	_MODE_OUT@GOTPCREL(%rip), %rax
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rax)
	jne	LBB0_21
## %bb.20:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	$6, %esi
	callq	_start_compression_out
	jmp	LBB0_22
LBB0_18:
	movl	%eax, %r13d
	jmp	LBB0_30
LBB0_21:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_start_compression_in
LBB0_22:
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_30
## %bb.23:
	movl	$1, 8(%r15)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set_newkeys: mode %d"

	.comm	_MODE_OUT,4,2                   ## @MODE_OUT
	.comm	_CIPHER_ENCRYPT,4,2             ## @CIPHER_ENCRYPT
	.comm	_CIPHER_DECRYPT,4,2             ## @CIPHER_DECRYPT
L_.str.1:                               ## @.str.1
	.asciz	"set_newkeys: rekeying, input %llu bytes %llu blocks, output %llu bytes %llu blocks"

	.comm	_SSH_ERR_INTERNAL_ERROR,4,2     ## @SSH_ERR_INTERNAL_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"cipher_init_context: %d"

L_.str.3:                               ## @.str.3
	.asciz	"Warning: %s"

	.comm	_COMP_ZLIB,8,3                  ## @COMP_ZLIB
	.comm	_COMP_DELAYED,8,3               ## @COMP_DELAYED
L_.str.4:                               ## @.str.4
	.asciz	"rekey after %llu blocks"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssh_set_newkeys                ; -- Begin function ssh_set_newkeys
	.p2align	2
_ssh_set_newkeys:                       ; @ssh_set_newkeys
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x1
	mov	x19, x0
	ldr	x24, [x0, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debug2
Lloh2:
	adrp	x26, _MODE_OUT@GOTPAGE
Lloh3:
	ldr	x26, [x26, _MODE_OUT@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, w20
	add	x8, x24, #80
	add	x9, x24, #56
	add	x10, x24, #4
Lloh4:
	adrp	x11, _CIPHER_DECRYPT@GOTPAGE
Lloh5:
	ldr	x11, [x11, _CIPHER_DECRYPT@GOTPAGEOFF]
	add	x12, x24, #88
	add	x13, x24, #32
Lloh6:
	adrp	x14, _CIPHER_ENCRYPT@GOTPAGE
Lloh7:
	ldr	x14, [x14, _CIPHER_ENCRYPT@GOTPAGEOFF]
	csel	x21, x8, x12, ne
	csel	x28, x9, x13, ne
	csel	x25, x10, x24, ne
	csel	x8, x11, x14, ne
	ldr	w22, [x8]
	ldr	x8, [x24, #24]
	sxtw	x23, w20
	ldr	x9, [x8, w20, sxtw #3]
	lsl	x27, x23, #3
	cbz	x9, LBB0_2
; %bb.1:
	ldr	x1, [x24, #72]
	ldp	x9, x8, [x24, #48]
	ldr	x10, [x24, #32]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_debug
	ldr	x0, [x21]
	bl	_cipher_free
	str	xzr, [x21]
	ldr	x8, [x24, #24]
	ldr	x0, [x8, x27]
	bl	_kex_free_newkeys
	ldr	x8, [x24, #24]
	str	xzr, [x8, x27]
	ldr	x8, [x24, #24]
LBB0_2:
	stp	xzr, xzr, [x28]
	ldr	x9, [x19]
	ldr	x9, [x9]
	ldr	x9, [x9, x27]
	str	x9, [x8, x27]
	cbz	x9, LBB0_15
; %bb.3:
	ldr	x8, [x19]
	ldr	x8, [x8]
	str	xzr, [x8, x27]
	ldr	x8, [x24, #24]
	ldr	x27, [x8, x27]
	ldr	w0, [x27, #40]
	bl	_cipher_authlen
	cbz	x0, LBB0_16
LBB0_4:
	mov	w8, #1
	str	w8, [x27, #16]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x23
	bl	_debug
	bl	_DBG
	ldp	w2, w1, [x27, #36]
	ldp	w4, w3, [x27, #28]
	ldr	w5, [x27, #24]
	mov	x0, x21
	mov	x6, x22
	bl	_cipher_init
	cbnz	w0, LBB0_17
; %bb.5:
	ldr	w8, [x24, #8]
	cbnz	w8, LBB0_8
; %bb.6:
	ldr	x0, [x21]
	bl	_cipher_warning_message
	cbz	x0, LBB0_8
; %bb.7:
	mov	x1, x0
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_error
	mov	w8, #1
	str	w8, [x24, #8]
LBB0_8:
	ldr	x8, [x27]
Lloh14:
	adrp	x9, _COMP_ZLIB@GOTPAGE
Lloh15:
	ldr	x9, [x9, _COMP_ZLIB@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.9:
Lloh17:
	adrp	x9, _COMP_DELAYED@GOTPAGE
Lloh18:
	ldr	x9, [x9, _COMP_DELAYED@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.10:
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_12
LBB0_11:
	ldr	w8, [x27, #8]
	cbz	w8, LBB0_18
LBB0_12:
	ldr	w8, [x27, #20]
	mov	w9, #1073741824
	sdiv	w9, w9, w8
	lsl	w10, w8, #1
	mov	w11, #1
	lsl	w10, w11, w10
	cmp	w8, #16
	csel	w0, w9, w10, lt
	str	w0, [x25]
	ldr	w8, [x24, #12]
	cbz	w8, LBB0_14
; %bb.13:
	ldr	w9, [x27, #20]
	sdiv	w1, w8, w9
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_MINIMUM
                                        ; kill: def $w0 killed $w0 def $x0
	str	w0, [x25]
LBB0_14:
	sxtw	x1, w0
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_debug
	mov	w0, #0
	b	LBB0_17
LBB0_15:
Lloh22:
	adrp	x8, _SSH_ERR_INTERNAL_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SSH_ERR_INTERNAL_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	b	LBB0_17
LBB0_16:
	add	x0, x27, #16
	bl	_mac_init
	cbz	w0, LBB0_4
LBB0_17:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_18:
	mov	x0, x19
	bl	_ssh_packet_init_compression
	tbnz	w0, #31, LBB0_17
; %bb.19:
	ldr	w8, [x26]
	mov	x0, x19
	cmp	w8, w20
	b.ne	LBB0_21
; %bb.20:
	mov	w1, #6
	bl	_start_compression_out
	cbnz	w0, LBB0_17
	b	LBB0_22
LBB0_21:
	bl	_start_compression_in
	cbnz	w0, LBB0_17
LBB0_22:
	mov	w8, #1
	str	w8, [x27, #8]
	b	LBB0_12
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set_newkeys: mode %d"

	.comm	_MODE_OUT,4,2                   ; @MODE_OUT
	.comm	_CIPHER_ENCRYPT,4,2             ; @CIPHER_ENCRYPT
	.comm	_CIPHER_DECRYPT,4,2             ; @CIPHER_DECRYPT
l_.str.1:                               ; @.str.1
	.asciz	"set_newkeys: rekeying, input %llu bytes %llu blocks, output %llu bytes %llu blocks"

	.comm	_SSH_ERR_INTERNAL_ERROR,4,2     ; @SSH_ERR_INTERNAL_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"cipher_init_context: %d"

l_.str.3:                               ; @.str.3
	.asciz	"Warning: %s"

	.comm	_COMP_ZLIB,8,3                  ; @COMP_ZLIB
	.comm	_COMP_DELAYED,8,3               ; @COMP_DELAYED
l_.str.4:                               ; @.str.4
	.asciz	"rekey after %llu blocks"

.subsections_via_symbols
