	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dpp_set_keypair
_dpp_set_keypair:                       ## @dpp_set_keypair
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rdi, %r15
	movq	%rsi, -40(%rbp)
	xorl	%eax, %eax
	callq	_EVP_PKEY_new
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r12
	leaq	-40(%rbp), %rsi
	xorl	%edi, %edi
	movq	%rbx, %rdx
	callq	_d2i_ECPrivateKey
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_EC_KEY_get0_group
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movq	%rax, %rdi
	callq	_EC_GROUP_get_curve_name
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_dpp_get_curve_nid
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_EVP_PKEY_assign_EC_KEY
	cmpl	$1, %eax
	jne	LBB0_7
	jmp	LBB0_10
LBB0_2:
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_ERR_get_error
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_ERR_error_string
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_wpa_printf
	jmp	LBB0_8
LBB0_5:
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_wpa_printf
LBB0_7:
	movq	%r14, %rdi
	callq	_EC_KEY_free
LBB0_8:
	movq	%r12, %rdi
	callq	_EVP_PKEY_free
LBB0_9:
	xorl	%r12d, %r12d
LBB0_10:
	movq	%r12, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSG_INFO,4,2                   ## @MSG_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DPP: OpenSSL: d2i_ECPrivateKey() failed: %s"

L_.str.1:                               ## @.str.1
	.asciz	"DPP: Unsupported curve (nid=%d) in pre-assigned key"

	.no_dead_strip	_dpp_set_keypair
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dpp_set_keypair
_dpp_set_keypair:                       ; @dpp_set_keypair
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x21, x0
	str	x1, [sp, #8]
	bl	_EVP_PKEY_new
	mov	x19, x0
	cbz	x0, LBB0_9
; %bb.1:
	add	x1, sp, #8
	mov	x0, #0
	mov	x2, x20
	bl	_d2i_ECPrivateKey
	cbz	x0, LBB0_5
; %bb.2:
	mov	x20, x0
	bl	_EC_KEY_get0_group
	cbz	x0, LBB0_7
; %bb.3:
	bl	_EC_GROUP_get_curve_name
	mov	x22, x0
	bl	_dpp_get_curve_nid
	str	x0, [x21]
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x19
	mov	x1, x20
	bl	_EVP_PKEY_assign_EC_KEY
	cmp	w0, #1
	b.ne	LBB0_7
	b	LBB0_9
LBB0_5:
Lloh0:
	adrp	x8, _MSG_INFO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSG_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	bl	_ERR_get_error
	mov	x1, #0
	bl	_ERR_error_string
	mov	x2, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_wpa_printf
	b	LBB0_8
LBB0_6:
Lloh5:
	adrp	x8, _MSG_INFO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MSG_INFO@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_wpa_printf
LBB0_7:
	mov	x0, x20
	bl	_EC_KEY_free
LBB0_8:
	mov	x0, x19
	bl	_EVP_PKEY_free
	mov	x19, #0
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_INFO,4,2                   ; @MSG_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DPP: OpenSSL: d2i_ECPrivateKey() failed: %s"

l_.str.1:                               ; @.str.1
	.asciz	"DPP: Unsupported curve (nid=%d) in pre-assigned key"

	.no_dead_strip	_dpp_set_keypair
.subsections_via_symbols
