	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kex_send_kexinit               ## -- Begin function kex_send_kexinit
	.p2align	4, 0x90
_kex_send_kexinit:                      ## @kex_send_kexinit
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.1:
	movq	_KEX_INIT_SENT@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	xorl	%eax, %eax
	testl	%ecx, (%rbx)
	jne	LBB0_11
## %bb.2:
	movq	%rdi, %r14
	movq	$0, 8(%rbx)
	movl	4(%rbx), %edi
	callq	_sshbuf_len
	movq	_KEX_COOKIE_LEN@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jge	LBB0_4
## %bb.3:
	movq	_SSH_ERR_INVALID_FORMAT@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_4:
	movl	4(%rbx), %edi
	callq	_sshbuf_mutable_ptr
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	(%r12), %rsi
	movq	%rax, %rdi
	callq	_arc4random_buf
	movq	_SSH2_MSG_KEXINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sshpkt_start
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movl	4(%rbx), %esi
	movq	%r14, %rdi
	callq	_sshpkt_putb
	testl	%eax, %eax
	jne	LBB0_11
## %bb.7:
	movq	%r14, %rdi
	callq	_sshpkt_send
	testl	%eax, %eax
	jne	LBB0_11
## %bb.8:
	leaq	L_.str(%rip), %rdi
	callq	_debug
	movl	(%r15), %eax
	orl	%eax, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_9:
	movq	_SSH_ERR_INTERNAL_ERROR@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SSH_ERR_INTERNAL_ERROR,4,2     ## @SSH_ERR_INTERNAL_ERROR
	.comm	_KEX_INIT_SENT,4,2              ## @KEX_INIT_SENT
	.comm	_KEX_COOKIE_LEN,8,3             ## @KEX_COOKIE_LEN
	.comm	_SSH_ERR_INVALID_FORMAT,4,2     ## @SSH_ERR_INVALID_FORMAT
	.comm	_SSH2_MSG_KEXINIT,4,2           ## @SSH2_MSG_KEXINIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SSH2_MSG_KEXINIT sent"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kex_send_kexinit               ; -- Begin function kex_send_kexinit
	.p2align	2
_kex_send_kexinit:                      ; @kex_send_kexinit
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x20, [x0]
	cbz	x20, LBB0_10
; %bb.1:
	ldr	w8, [x20]
Lloh0:
	adrp	x21, _KEX_INIT_SENT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _KEX_INIT_SENT@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	mov	w0, #0
	b	LBB0_12
LBB0_3:
	mov	x19, x0
	str	xzr, [x20, #8]
	ldr	w0, [x20, #4]
	bl	_sshbuf_len
Lloh2:
	adrp	x22, _KEX_COOKIE_LEN@GOTPAGE
Lloh3:
	ldr	x22, [x22, _KEX_COOKIE_LEN@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ge	LBB0_5
; %bb.4:
Lloh4:
	adrp	x8, _SSH_ERR_INVALID_FORMAT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SSH_ERR_INVALID_FORMAT@GOTPAGEOFF]
	b	LBB0_11
LBB0_5:
	ldr	w0, [x20, #4]
	bl	_sshbuf_mutable_ptr
	cbz	x0, LBB0_10
; %bb.6:
	ldr	x1, [x22]
	bl	_arc4random_buf
Lloh6:
	adrp	x8, _SSH2_MSG_KEXINIT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SSH2_MSG_KEXINIT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sshpkt_start
	cbnz	w0, LBB0_12
; %bb.7:
	ldr	w1, [x20, #4]
	mov	x0, x19
	bl	_sshpkt_putb
	cbnz	w0, LBB0_12
; %bb.8:
	mov	x0, x19
	bl	_sshpkt_send
	cbnz	w0, LBB0_12
; %bb.9:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debug
	mov	w0, #0
	ldr	w8, [x21]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	b	LBB0_12
LBB0_10:
Lloh11:
	adrp	x8, _SSH_ERR_INTERNAL_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SSH_ERR_INTERNAL_ERROR@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SSH_ERR_INTERNAL_ERROR,4,2     ; @SSH_ERR_INTERNAL_ERROR
	.comm	_KEX_INIT_SENT,4,2              ; @KEX_INIT_SENT
	.comm	_KEX_COOKIE_LEN,8,3             ; @KEX_COOKIE_LEN
	.comm	_SSH_ERR_INVALID_FORMAT,4,2     ; @SSH_ERR_INVALID_FORMAT
	.comm	_SSH2_MSG_KEXINIT,4,2           ; @SSH2_MSG_KEXINIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SSH2_MSG_KEXINIT sent"

.subsections_via_symbols
