	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ikev2_build_sa_init
_ikev2_build_sa_init:                   ## @ikev2_build_sa_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	48(%rdi), %edi
	movq	_IKEV2_SPI_LEN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_os_get_random
	testq	%rax, %rax
	jne	LBB0_14
## %bb.2:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movl	48(%r12), %edx
	movl	(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	callq	_wpa_hexdump
	movq	_IKEV2_NONCE_MIN_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%esi, 40(%r12)
	movl	44(%r12), %edi
	callq	_random_get_bytes
	testq	%rax, %rax
	jne	LBB0_14
## %bb.4:
	movl	(%r14), %edi
	movl	40(%r12), %ecx
	movl	44(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_wpa_hexdump
	movl	$1504, %edi                     ## imm = 0x5E0
	addq	32(%r12), %rdi
	callq	_wpabuf_alloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.5:
	movq	%rax, %r14
	movq	_IKE_SA_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_IKEV2_PAYLOAD_SA@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%r8d, %r8d
	callq	_ikev2_build_hdr
	movq	_IKEV2_PAYLOAD_KEY_EXCHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ikev2_build_sar1
	testq	%rax, %rax
	jne	LBB0_13
## %bb.6:
	movq	_IKEV2_PAYLOAD_NONCE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ikev2_build_ker
	testq	%rax, %rax
	jne	LBB0_13
## %bb.7:
	movq	(%r12), %rax
	movq	_PEER_AUTH_SECRET@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_10
## %bb.8:
	movq	_IKEV2_PAYLOAD_ENCRYPTED@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_IKEV2_PAYLOAD_NO_NEXT_PAYLOAD@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ikev2_build_nr
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	movq	%r12, %rdi
	callq	_ikev2_derive_keys
	testq	%rax, %rax
	je	LBB0_16
LBB0_13:
	movq	%r14, %rdi
	callq	_wpabuf_free
LBB0_14:
	xorl	%r14d, %r14d
LBB0_15:
	movq	%r14, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	(%r12), %rax
	cmpq	(%r15), %rax
	jne	LBB0_22
## %bb.17:
	movl	$1000, %edi                     ## imm = 0x3E8
	addq	32(%r12), %rdi
	callq	_wpabuf_alloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.18:
	movq	%rax, %r15
	movq	_IKEV2_PAYLOAD_NO_NEXT_PAYLOAD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_ikev2_build_idr
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:
	movl	24(%r12), %esi
	movl	28(%r12), %edi
	leaq	20(%r12), %rdx
	movq	_IKEV2_PAYLOAD_IDr@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	xorl	%ecx, %ecx
	movq	%r14, %r8
	movq	%r15, %r9
	callq	_ikev2_build_encrypted
	testq	%rax, %rax
	je	LBB0_21
LBB0_20:
	movq	%r15, %rdi
	callq	_wpabuf_free
	jmp	LBB0_13
LBB0_21:
	movq	%r15, %rdi
	callq	_wpabuf_free
LBB0_22:
	movq	%r14, %rdi
	callq	_ikev2_update_hdr
	movq	_MSG_MSGDUMP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdx
	callq	_wpa_hexdump_buf
	movq	_SA_AUTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r12)
	movq	8(%r12), %rdi
	callq	_wpabuf_free
	movq	%r14, %rdi
	callq	_wpabuf_dup
	movq	%rax, 8(%r12)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_IKEV2_SPI_LEN,4,2              ## @IKEV2_SPI_LEN
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IKEV2: IKE_SA Responder's SPI"

	.comm	_IKEV2_NONCE_MIN_LEN,4,2        ## @IKEV2_NONCE_MIN_LEN
L_.str.1:                               ## @.str.1
	.asciz	"IKEV2: Nr"

	.comm	_IKE_SA_INIT,4,2                ## @IKE_SA_INIT
	.comm	_IKEV2_PAYLOAD_SA,4,2           ## @IKEV2_PAYLOAD_SA
	.comm	_IKEV2_PAYLOAD_KEY_EXCHANGE,4,2 ## @IKEV2_PAYLOAD_KEY_EXCHANGE
	.comm	_IKEV2_PAYLOAD_NONCE,4,2        ## @IKEV2_PAYLOAD_NONCE
	.comm	_PEER_AUTH_SECRET,8,3           ## @PEER_AUTH_SECRET
	.comm	_IKEV2_PAYLOAD_ENCRYPTED,4,2    ## @IKEV2_PAYLOAD_ENCRYPTED
	.comm	_IKEV2_PAYLOAD_NO_NEXT_PAYLOAD,4,2 ## @IKEV2_PAYLOAD_NO_NEXT_PAYLOAD
	.comm	_PEER_AUTH_CERT,8,3             ## @PEER_AUTH_CERT
	.comm	_IKEV2_PAYLOAD_IDr,4,2          ## @IKEV2_PAYLOAD_IDr
	.comm	_MSG_MSGDUMP,4,2                ## @MSG_MSGDUMP
L_.str.2:                               ## @.str.2
	.asciz	"IKEV2: Sending message (SA_INIT)"

	.comm	_SA_AUTH,4,2                    ## @SA_AUTH
	.no_dead_strip	_ikev2_build_sa_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ikev2_build_sa_init
_ikev2_build_sa_init:                   ; @ikev2_build_sa_init
	.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
	mov	x19, x0
	ldr	w0, [x0, #48]
Lloh0:
	adrp	x21, _IKEV2_SPI_LEN@GOTPAGE
Lloh1:
	ldr	x21, [x21, _IKEV2_SPI_LEN@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_os_get_random
	cbnz	x0, LBB0_8
; %bb.1:
Lloh2:
	adrp	x20, _MSG_DEBUG@GOTPAGE
Lloh3:
	ldr	x20, [x20, _MSG_DEBUG@GOTPAGEOFF]
	ldr	w0, [x20]
	ldr	w2, [x19, #48]
	ldr	w3, [x21]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wpa_hexdump
Lloh6:
	adrp	x8, _IKEV2_NONCE_MIN_LEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IKEV2_NONCE_MIN_LEN@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	str	w1, [x19, #40]
	ldr	w0, [x19, #44]
	bl	_random_get_bytes
	cbnz	x0, LBB0_8
; %bb.2:
	ldr	w0, [x20]
	ldp	w3, w2, [x19, #40]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wpa_hexdump
	ldr	x8, [x19, #32]
	add	x0, x8, #1504
	bl	_wpabuf_alloc
	mov	x20, x0
	cbz	x0, LBB0_9
; %bb.3:
Lloh11:
	adrp	x8, _IKE_SA_INIT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IKE_SA_INIT@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _IKEV2_PAYLOAD_SA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _IKEV2_PAYLOAD_SA@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w4, #0
	bl	_ikev2_build_hdr
Lloh17:
	adrp	x8, _IKEV2_PAYLOAD_KEY_EXCHANGE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IKEV2_PAYLOAD_KEY_EXCHANGE@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_ikev2_build_sar1
	cbnz	x0, LBB0_7
; %bb.4:
Lloh20:
	adrp	x8, _IKEV2_PAYLOAD_NONCE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _IKEV2_PAYLOAD_NONCE@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_ikev2_build_ker
	cbnz	x0, LBB0_7
; %bb.5:
	ldr	x8, [x19]
Lloh23:
	adrp	x21, _PEER_AUTH_SECRET@GOTPAGE
Lloh24:
	ldr	x21, [x21, _PEER_AUTH_SECRET@GOTPAGEOFF]
Lloh25:
	adrp	x9, _IKEV2_PAYLOAD_ENCRYPTED@GOTPAGE
Lloh26:
	ldr	x9, [x9, _IKEV2_PAYLOAD_ENCRYPTED@GOTPAGEOFF]
	ldr	x10, [x21]
Lloh27:
	adrp	x22, _IKEV2_PAYLOAD_NO_NEXT_PAYLOAD@GOTPAGE
Lloh28:
	ldr	x22, [x22, _IKEV2_PAYLOAD_NO_NEXT_PAYLOAD@GOTPAGEOFF]
	cmp	x8, x10
	csel	x8, x9, x22, eq
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_ikev2_build_nr
	cbnz	x0, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_ikev2_derive_keys
	cbz	x0, LBB0_10
LBB0_7:
	mov	x0, x20
	bl	_wpabuf_free
LBB0_8:
	mov	x20, #0
LBB0_9:
	mov	x0, x20
	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
LBB0_10:
	ldr	x8, [x19]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.11:
	ldr	x8, [x19, #32]
	add	x0, x8, #1000
	bl	_wpabuf_alloc
	cbz	x0, LBB0_7
; %bb.12:
	mov	x21, x0
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x21
	bl	_ikev2_build_idr
	cbnz	x0, LBB0_14
; %bb.13:
	ldp	w1, w0, [x19, #24]
	add	x2, x19, #20
Lloh29:
	adrp	x8, _IKEV2_PAYLOAD_IDr@GOTPAGE
Lloh30:
	ldr	x8, [x8, _IKEV2_PAYLOAD_IDr@GOTPAGEOFF]
Lloh31:
	ldr	w6, [x8]
	mov	w3, #0
	mov	x4, x20
	mov	x5, x21
	bl	_ikev2_build_encrypted
	cbz	x0, LBB0_15
LBB0_14:
	mov	x0, x21
	bl	_wpabuf_free
	b	LBB0_7
LBB0_15:
	mov	x0, x21
	bl	_wpabuf_free
LBB0_16:
	mov	x0, x20
	bl	_ikev2_update_hdr
Lloh32:
	adrp	x8, _MSG_MSGDUMP@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MSG_MSGDUMP@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
Lloh35:
	adrp	x1, l_.str.2@PAGE
Lloh36:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_wpa_hexdump_buf
Lloh37:
	adrp	x8, _SA_AUTH@GOTPAGE
Lloh38:
	ldr	x8, [x8, _SA_AUTH@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	ldr	x0, [x19, #8]
	bl	_wpabuf_free
	mov	x0, x20
	bl	_wpabuf_dup
	str	x0, [x19, #8]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_IKEV2_SPI_LEN,4,2              ; @IKEV2_SPI_LEN
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IKEV2: IKE_SA Responder's SPI"

	.comm	_IKEV2_NONCE_MIN_LEN,4,2        ; @IKEV2_NONCE_MIN_LEN
l_.str.1:                               ; @.str.1
	.asciz	"IKEV2: Nr"

	.comm	_IKE_SA_INIT,4,2                ; @IKE_SA_INIT
	.comm	_IKEV2_PAYLOAD_SA,4,2           ; @IKEV2_PAYLOAD_SA
	.comm	_IKEV2_PAYLOAD_KEY_EXCHANGE,4,2 ; @IKEV2_PAYLOAD_KEY_EXCHANGE
	.comm	_IKEV2_PAYLOAD_NONCE,4,2        ; @IKEV2_PAYLOAD_NONCE
	.comm	_PEER_AUTH_SECRET,8,3           ; @PEER_AUTH_SECRET
	.comm	_IKEV2_PAYLOAD_ENCRYPTED,4,2    ; @IKEV2_PAYLOAD_ENCRYPTED
	.comm	_IKEV2_PAYLOAD_NO_NEXT_PAYLOAD,4,2 ; @IKEV2_PAYLOAD_NO_NEXT_PAYLOAD
	.comm	_PEER_AUTH_CERT,8,3             ; @PEER_AUTH_CERT
	.comm	_IKEV2_PAYLOAD_IDr,4,2          ; @IKEV2_PAYLOAD_IDr
	.comm	_MSG_MSGDUMP,4,2                ; @MSG_MSGDUMP
l_.str.2:                               ; @.str.2
	.asciz	"IKEV2: Sending message (SA_INIT)"

	.comm	_SA_AUTH,4,2                    ; @SA_AUTH
	.no_dead_strip	_ikev2_build_sa_init
.subsections_via_symbols
