	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	16(%rdi), %edi
	movq	_IKEV2_SPI_LEN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_os_get_random
	testq	%rax, %rax
	jne	LBB0_9
## %bb.2:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movl	16(%r15), %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, 8(%r15)
	movl	12(%r15), %edi
	callq	_random_get_bytes
	testq	%rax, %rax
	jne	LBB0_9
## %bb.4:
	movl	(%r14), %edi
	movl	8(%r15), %ecx
	movl	12(%r15), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_wpa_hexdump
	movl	$1004, %edi                     ## imm = 0x3EC
	callq	_wpabuf_alloc
	testq	%rax, %rax
	je	LBB0_9
## %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	%r15, %rdi
	movq	%r14, %rsi
	xorl	%r8d, %r8d
	callq	_ikev2_build_hdr
	movq	_IKEV2_PAYLOAD_KEY_EXCHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ikev2_build_sai
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:
	movq	_IKEV2_PAYLOAD_NONCE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ikev2_build_kei
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	movq	_IKEV2_PAYLOAD_NO_NEXT_PAYLOAD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ikev2_build_ni
	testq	%rax, %rax
	je	LBB0_11
LBB0_8:
	movq	%r14, %rdi
	callq	_wpabuf_free
LBB0_9:
	xorl	%r14d, %r14d
LBB0_10:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	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	(%r15), %rdi
	callq	_wpabuf_free
	movq	%r14, %rdi
	callq	_wpabuf_dup
	movq	%rax, (%r15)
	jmp	LBB0_10
	.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 Initiator's SPI"

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

	.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	_IKEV2_PAYLOAD_NO_NEXT_PAYLOAD,4,2 ## @IKEV2_PAYLOAD_NO_NEXT_PAYLOAD
	.comm	_MSG_MSGDUMP,4,2                ## @MSG_MSGDUMP
L_.str.2:                               ## @.str.2
	.asciz	"IKEV2: Sending message (SA_INIT)"

	.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, #16]
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_7
; %bb.1:
Lloh2:
	adrp	x20, _MSG_DEBUG@GOTPAGE
Lloh3:
	ldr	x20, [x20, _MSG_DEBUG@GOTPAGEOFF]
	ldr	w0, [x20]
	ldr	w2, [x19, #16]
	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, #8]
	ldr	w0, [x19, #12]
	bl	_random_get_bytes
	cbnz	x0, LBB0_7
; %bb.2:
	ldr	w0, [x20]
	ldp	w3, w2, [x19, #8]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wpa_hexdump
	mov	w0, #1004
	bl	_wpabuf_alloc
	mov	x20, x0
	cbz	x0, LBB0_8
; %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_sai
	cbnz	x0, LBB0_6
; %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_kei
	cbnz	x0, LBB0_6
; %bb.5:
Lloh23:
	adrp	x8, _IKEV2_PAYLOAD_NO_NEXT_PAYLOAD@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IKEV2_PAYLOAD_NO_NEXT_PAYLOAD@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_ikev2_build_ni
	cbz	x0, LBB0_9
LBB0_6:
	mov	x0, x20
	bl	_wpabuf_free
LBB0_7:
	mov	x20, #0
LBB0_8:
	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_9:
	mov	x0, x20
	bl	_ikev2_update_hdr
Lloh26:
	adrp	x8, _MSG_MSGDUMP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MSG_MSGDUMP@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_wpa_hexdump_buf
	ldr	x0, [x19]
	bl	_wpabuf_free
	mov	x0, x20
	bl	_wpabuf_dup
	str	x0, [x19]
	b	LBB0_8
	.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 AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.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 Initiator's SPI"

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

	.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	_IKEV2_PAYLOAD_NO_NEXT_PAYLOAD,4,2 ; @IKEV2_PAYLOAD_NO_NEXT_PAYLOAD
	.comm	_MSG_MSGDUMP,4,2                ; @MSG_MSGDUMP
l_.str.2:                               ; @.str.2
	.asciz	"IKEV2: Sending message (SA_INIT)"

	.no_dead_strip	_ikev2_build_sa_init
.subsections_via_symbols
