	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function input_kex_dh_gex_request
_input_kex_dh_gex_request:              ## @input_kex_dh_gex_request
	.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
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	(%rdx), %r14
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_debug
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_sshpkt_get_u32
	testl	%eax, %eax
	jne	LBB0_17
## %bb.1:
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_sshpkt_get_u32
	testl	%eax, %eax
	jne	LBB0_17
## %bb.2:
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_sshpkt_get_u32
	testl	%eax, %eax
	jne	LBB0_17
## %bb.3:
	movq	%rbx, %rdi
	callq	_sshpkt_get_end
	testl	%eax, %eax
	jne	LBB0_17
## %bb.4:
	movq	-40(%rbp), %rax
	movq	%rax, (%r14)
	movq	-56(%rbp), %rsi
	movq	%rsi, 8(%r14)
	movq	-48(%rbp), %rax
	movq	%rax, 16(%r14)
	movq	_DH_GRP_MIN@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_MAXIMUM
	movq	%rax, -56(%rbp)
	movq	_DH_GRP_MAX@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	-48(%rbp), %rsi
	callq	_MINIMUM
	movq	%rax, -48(%rbp)
	movq	(%r15), %rdi
	movq	-40(%rbp), %rsi
	callq	_MAXIMUM
	movq	%rax, -40(%rbp)
	movl	(%r12), %edi
	movq	%rax, %rsi
	callq	_MINIMUM
	movq	%rax, -40(%rbp)
	movq	8(%r14), %rdx
	movq	16(%r14), %rcx
	cmpq	%rdx, %rcx
	jl	LBB0_15
## %bb.5:
	movq	(%r14), %rsi
	cmpq	%rdx, %rsi
	jl	LBB0_15
## %bb.6:
	cmpq	%rsi, %rcx
	jl	LBB0_15
## %bb.7:
	cmpq	(%r15), %rcx
	jl	LBB0_15
## %bb.8:
	movq	-56(%rbp), %rdi
	movq	-48(%rbp), %rdx
	movq	%rax, %rsi
	callq	_choose_dh
	movl	%eax, %edi
	callq	_PRIVSEP
	movq	%rax, 32(%r14)
	testq	%rax, %rax
	je	LBB0_18
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	callq	_debug
	movq	32(%r14), %rdi
	leaq	-72(%rbp), %rsi
	leaq	-64(%rbp), %rcx
	xorl	%edx, %edx
	callq	_DH_get0_pqg
	movq	_SSH2_MSG_KEX_DH_GEX_GROUP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sshpkt_start
	testl	%eax, %eax
	jne	LBB0_17
## %bb.10:
	movq	-72(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_sshpkt_put_bignum2
	testl	%eax, %eax
	jne	LBB0_17
## %bb.11:
	movq	-64(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_sshpkt_put_bignum2
	testl	%eax, %eax
	jne	LBB0_17
## %bb.12:
	movq	%rbx, %rdi
	callq	_sshpkt_send
	testl	%eax, %eax
	jne	LBB0_17
## %bb.13:
	movq	32(%r14), %rdi
	movl	24(%r14), %esi
	shll	$3, %esi
	callq	_dh_gen_key
	testl	%eax, %eax
	jne	LBB0_17
## %bb.14:
	leaq	L_.str.3(%rip), %rdi
	callq	_debug
	movq	_SSH2_MSG_KEX_DH_GEX_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_input_kex_dh_gex_init@GOTPCREL(%rip), %rdx
	movq	%rbx, %rdi
	callq	_ssh_dispatch_set
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_15:
	movq	_SSH_ERR_DH_GEX_OUT_OF_RANGE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %eax
LBB0_17:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_sshpkt_disconnect
	movq	_SSH_ERR_ALLOC_FAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SSH2_MSG_KEX_DH_GEX_REQUEST received"

	.comm	_DH_GRP_MIN,8,3                 ## @DH_GRP_MIN
	.comm	_DH_GRP_MAX,4,2                 ## @DH_GRP_MAX
	.comm	_SSH_ERR_DH_GEX_OUT_OF_RANGE,4,2 ## @SSH_ERR_DH_GEX_OUT_OF_RANGE
L_.str.1:                               ## @.str.1
	.asciz	"no matching DH grp found"

	.comm	_SSH_ERR_ALLOC_FAIL,4,2         ## @SSH_ERR_ALLOC_FAIL
L_.str.2:                               ## @.str.2
	.asciz	"SSH2_MSG_KEX_DH_GEX_GROUP sent"

	.comm	_SSH2_MSG_KEX_DH_GEX_GROUP,4,2  ## @SSH2_MSG_KEX_DH_GEX_GROUP
L_.str.3:                               ## @.str.3
	.asciz	"expecting SSH2_MSG_KEX_DH_GEX_INIT"

	.comm	_SSH2_MSG_KEX_DH_GEX_INIT,4,2   ## @SSH2_MSG_KEX_DH_GEX_INIT
	.comm	_input_kex_dh_gex_init,4,2      ## @input_kex_dh_gex_init
	.no_dead_strip	_input_kex_dh_gex_request
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function input_kex_dh_gex_request
_input_kex_dh_gex_request:              ; @input_kex_dh_gex_request
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x2
	ldr	x20, [x2]
	stp	xzr, xzr, [sp, #32]
	str	xzr, [sp, #24]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debug
	add	x1, sp, #40
	mov	x0, x19
	bl	_sshpkt_get_u32
	cbnz	w0, LBB0_17
; %bb.1:
	add	x1, sp, #24
	mov	x0, x19
	bl	_sshpkt_get_u32
	cbnz	w0, LBB0_17
; %bb.2:
	add	x1, sp, #32
	mov	x0, x19
	bl	_sshpkt_get_u32
	cbnz	w0, LBB0_17
; %bb.3:
	mov	x0, x19
	bl	_sshpkt_get_end
	cbnz	w0, LBB0_17
; %bb.4:
	ldr	x8, [sp, #24]
	str	x8, [x20]
	ldp	x8, x1, [sp, #32]
	stp	x1, x8, [x20, #8]
Lloh2:
	adrp	x21, _DH_GRP_MIN@GOTPAGE
Lloh3:
	ldr	x21, [x21, _DH_GRP_MIN@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_MAXIMUM
	str	x0, [sp, #40]
Lloh4:
	adrp	x22, _DH_GRP_MAX@GOTPAGE
Lloh5:
	ldr	x22, [x22, _DH_GRP_MAX@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	x1, [sp, #32]
	bl	_MINIMUM
	str	x0, [sp, #32]
	ldr	x0, [x21]
	ldr	x1, [sp, #24]
	bl	_MAXIMUM
	mov	x1, x0
	str	x0, [sp, #24]
	ldr	w0, [x22]
	bl	_MINIMUM
	str	x0, [sp, #24]
	ldp	x9, x8, [x20, #8]
	cmp	x8, x9
	b.lt	LBB0_15
; %bb.5:
	ldr	x10, [x20]
	cmp	x10, x9
	b.lt	LBB0_15
; %bb.6:
	cmp	x8, x10
	b.lt	LBB0_15
; %bb.7:
	ldr	x9, [x21]
	cmp	x8, x9
	b.lt	LBB0_15
; %bb.8:
	mov	x1, x0
	ldp	x2, x0, [sp, #32]
	bl	_choose_dh
	bl	_PRIVSEP
	str	x0, [x20, #32]
	cbz	x0, LBB0_18
; %bb.9:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_debug
	ldr	x0, [x20, #32]
	add	x1, sp, #16
	add	x3, sp, #8
	mov	x2, #0
	bl	_DH_get0_pqg
Lloh8:
	adrp	x8, _SSH2_MSG_KEX_DH_GEX_GROUP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SSH2_MSG_KEX_DH_GEX_GROUP@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sshpkt_start
	cbnz	w0, LBB0_17
; %bb.10:
	ldr	x1, [sp, #16]
	mov	x0, x19
	bl	_sshpkt_put_bignum2
	cbnz	w0, LBB0_17
; %bb.11:
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_sshpkt_put_bignum2
	cbnz	w0, LBB0_17
; %bb.12:
	mov	x0, x19
	bl	_sshpkt_send
	cbnz	w0, LBB0_17
; %bb.13:
	ldr	x0, [x20, #32]
	ldr	w8, [x20, #24]
	lsl	w1, w8, #3
	bl	_dh_gen_key
	cbnz	w0, LBB0_17
; %bb.14:
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_debug
Lloh13:
	adrp	x8, _SSH2_MSG_KEX_DH_GEX_INIT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SSH2_MSG_KEX_DH_GEX_INIT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x2, _input_kex_dh_gex_init@GOTPAGE
Lloh17:
	ldr	x2, [x2, _input_kex_dh_gex_init@GOTPAGEOFF]
	mov	x0, x19
	bl	_ssh_dispatch_set
	mov	w0, #0
	b	LBB0_17
LBB0_15:
Lloh18:
	adrp	x8, _SSH_ERR_DH_GEX_OUT_OF_RANGE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SSH_ERR_DH_GEX_OUT_OF_RANGE@GOTPAGEOFF]
LBB0_16:
	ldr	w0, [x8]
LBB0_17:
	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
	add	sp, sp, #96
	ret
LBB0_18:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_sshpkt_disconnect
Lloh22:
	adrp	x8, _SSH_ERR_ALLOC_FAIL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SSH_ERR_ALLOC_FAIL@GOTPAGEOFF]
	b	LBB0_16
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SSH2_MSG_KEX_DH_GEX_REQUEST received"

	.comm	_DH_GRP_MIN,8,3                 ; @DH_GRP_MIN
	.comm	_DH_GRP_MAX,4,2                 ; @DH_GRP_MAX
	.comm	_SSH_ERR_DH_GEX_OUT_OF_RANGE,4,2 ; @SSH_ERR_DH_GEX_OUT_OF_RANGE
l_.str.1:                               ; @.str.1
	.asciz	"no matching DH grp found"

	.comm	_SSH_ERR_ALLOC_FAIL,4,2         ; @SSH_ERR_ALLOC_FAIL
l_.str.2:                               ; @.str.2
	.asciz	"SSH2_MSG_KEX_DH_GEX_GROUP sent"

	.comm	_SSH2_MSG_KEX_DH_GEX_GROUP,4,2  ; @SSH2_MSG_KEX_DH_GEX_GROUP
l_.str.3:                               ; @.str.3
	.asciz	"expecting SSH2_MSG_KEX_DH_GEX_INIT"

	.comm	_SSH2_MSG_KEX_DH_GEX_INIT,4,2   ; @SSH2_MSG_KEX_DH_GEX_INIT
	.comm	_input_kex_dh_gex_init,4,2      ; @input_kex_dh_gex_init
	.no_dead_strip	_input_kex_dh_gex_request
.subsections_via_symbols
