	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ikev2_build_encrypted          ## -- Begin function ikev2_build_encrypted
	.p2align	4, 0x90
_ikev2_build_encrypted:                 ## @ikev2_build_encrypted
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r8, %r15
	movl	%esi, %r12d
	movl	%edi, %ebx
	movl	16(%rbp), %r14d
	xorl	%eax, %eax
	testl	%ecx, %ecx
	setne	%al
	movq	8(%rdx,%rax,8), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	24(%rdx,%rax,8), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_wpa_printf
	movl	%ebx, %edi
	callq	_ikev2_get_encr
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r13
	movq	(%rax), %rbx
	movl	%r12d, %edi
	callq	_ikev2_get_integ
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	cmpq	$0, -80(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_8
## %bb.3:
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_9
## %bb.4:
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	$24, %esi
	movq	%r15, %rdi
	callq	_wpabuf_put
	movl	%r14d, 16(%rax)
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	$0, 8(%rax)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_wpabuf_put
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_random_get_bytes
	testq	%rax, %rax
	je	LBB0_12
## %bb.5:
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_10
LBB0_6:
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_10
LBB0_7:
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_10
LBB0_8:
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_10
LBB0_9:
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
LBB0_10:
	callq	_wpa_printf
LBB0_11:
	movl	$-1, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_wpabuf_len
	incq	%rax
	movq	%rax, %rcx
	orq	%rbx, %rcx
	shrq	$32, %rcx
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	je	LBB0_14
## %bb.13:
	xorl	%edx, %edx
	divq	%rbx
	jmp	LBB0_15
LBB0_14:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_15:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r15, %r14
	subq	%rdx, %rbx
	testq	%rdx, %rdx
	cmoveq	%rdx, %rbx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_wpabuf_put
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_wpabuf_put_u8
	movl	8(%r13), %r13d
	movl	4(%r12), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_wpabuf_head
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_wpabuf_mhead
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_wpabuf_len
	movq	%rax, (%rsp)
	movl	%r13d, %edi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%ebx, %r8d
	movl	%r12d, %r9d
	callq	_ikev2_encr_encrypt
	testq	%rax, %rax
	js	LBB0_11
## %bb.16:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_wpabuf_put_buf
	movq	-104(%rbp), %r13                ## 8-byte Reload
	movq	(%r13), %rsi
	movq	%r14, %rdi
	callq	_wpabuf_put
	movq	%r14, %rbx
	movq	%rax, %r14
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_wpabuf_put
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	subq	%rcx, %rax
	sarq	$2, %rax
	movl	(%rcx), %edi
	movq	%rax, %rsi
	callq	_WPA_PUT_BE16
	movq	%rbx, %rdi
	callq	_ikev2_update_hdr
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_wpabuf_head
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_wpabuf_len
	subq	(%r13), %rax
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movq	%rax, %r8
	movq	%r14, %r9
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ikev2_integ_hash               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IKEV2: Adding Encrypted payload"

	.comm	_MSG_INFO,4,2                   ## @MSG_INFO
L_.str.1:                               ## @.str.1
	.asciz	"IKEV2: Unsupported encryption type"

L_.str.2:                               ## @.str.2
	.asciz	"IKEV2: Unsupported intergrity type"

L_.str.3:                               ## @.str.3
	.asciz	"IKEV2: No SK_e available"

L_.str.4:                               ## @.str.4
	.asciz	"IKEV2: No SK_a available"

L_.str.5:                               ## @.str.5
	.asciz	"IKEV2: Could not generate IV"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ikev2_build_encrypted          ; -- Begin function ikev2_build_encrypted
	.p2align	2
_ikev2_build_encrypted:                 ; @ikev2_build_encrypted
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x28, x6
	mov	x23, x5
	mov	x20, x4
	mov	x21, x2
	mov	x19, x1
	mov	x24, x0
	cmp	w3, #0
	mov	w8, #32
	mov	w9, #24
	csel	x8, x9, x8, eq
	ldr	x25, [x2, x8]
	mov	w8, #16
	mov	w9, #8
	csel	x8, x9, x8, eq
	ldr	x22, [x2, x8]
Lloh0:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wpa_printf
	mov	x0, x24
	bl	_ikev2_get_encr
	cbz	x0, LBB0_6
; %bb.1:
	mov	x27, x0
	ldr	x26, [x0]
	mov	x0, x19
	bl	_ikev2_get_integ
	cbz	x0, LBB0_7
; %bb.2:
	cbz	x25, LBB0_8
; %bb.3:
	cbz	x22, LBB0_9
; %bb.4:
	mov	x24, x0
	str	x22, [sp, #8]                   ; 8-byte Folded Spill
	mov	x0, x20
	mov	w1, #24
	bl	_wpabuf_put
	mov	x22, x0
	str	w28, [x0, #16]
	str	xzr, [x0, #8]
	mov	x0, x20
	mov	x1, x26
	bl	_wpabuf_put
	mov	x28, x0
	mov	x1, x26
	bl	_random_get_bytes
	cbz	x0, LBB0_12
; %bb.5:
Lloh5:
	adrp	x8, _MSG_INFO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MSG_INFO@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str.5@PAGE
Lloh9:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_10
LBB0_6:
Lloh10:
	adrp	x8, _MSG_INFO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MSG_INFO@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_7:
Lloh15:
	adrp	x8, _MSG_INFO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MSG_INFO@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_8:
Lloh20:
	adrp	x8, _MSG_INFO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MSG_INFO@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh25:
	adrp	x8, _MSG_INFO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MSG_INFO@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
Lloh28:
	adrp	x1, l_.str.4@PAGE
Lloh29:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_10:
	bl	_wpa_printf
LBB0_11:
	mov	w0, #-1
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_12:
	mov	x0, x23
	bl	_wpabuf_len
	add	x8, x0, #1
	udiv	x9, x8, x26
	msub	x8, x9, x26, x8
	sub	x9, x26, x8
	cmp	x8, #0
	csel	x26, xzr, x9, eq
	mov	x0, x23
	mov	x1, x26
	bl	_wpabuf_put
	mov	x0, x23
	mov	x1, x26
	bl	_wpabuf_put_u8
	ldr	w9, [x27, #8]
	ldr	w8, [x21, #4]
	stp	w9, w8, [sp]                    ; 8-byte Folded Spill
	mov	x0, x23
	bl	_wpabuf_head
	mov	x27, x0
	mov	x0, x23
	bl	_wpabuf_mhead
	mov	x26, x0
	mov	x0, x23
	bl	_wpabuf_len
	mov	x6, x0
	ldp	w0, w2, [sp]                    ; 8-byte Folded Reload
	mov	x1, x25
	mov	x3, x28
	mov	x4, x27
	mov	x5, x26
	bl	_ikev2_encr_encrypt
	tbnz	x0, #63, LBB0_11
; %bb.13:
	mov	x0, x20
	mov	x1, x23
	bl	_wpabuf_put_buf
	ldr	x1, [x24]
	mov	x0, x20
	bl	_wpabuf_put
	mov	x23, x0
	mov	x0, x20
	mov	x1, #0
	bl	_wpabuf_put
	sub	x8, x0, x22
	asr	x1, x8, #2
	ldr	w0, [x22]
	bl	_WPA_PUT_BE16
	mov	x0, x20
	bl	_ikev2_update_hdr
	ldr	w21, [x21]
	mov	x0, x20
	bl	_wpabuf_head
	mov	x25, x0
	mov	x0, x20
	bl	_wpabuf_len
	ldr	x8, [x24]
	sub	x4, x0, x8
	mov	x0, x19
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, x21
	mov	x3, x25
	mov	x5, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_ikev2_integ_hash
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IKEV2: Adding Encrypted payload"

	.comm	_MSG_INFO,4,2                   ; @MSG_INFO
l_.str.1:                               ; @.str.1
	.asciz	"IKEV2: Unsupported encryption type"

l_.str.2:                               ; @.str.2
	.asciz	"IKEV2: Unsupported intergrity type"

l_.str.3:                               ; @.str.3
	.asciz	"IKEV2: No SK_e available"

l_.str.4:                               ; @.str.4
	.asciz	"IKEV2: No SK_a available"

l_.str.5:                               ; @.str.5
	.asciz	"IKEV2: Could not generate IV"

.subsections_via_symbols
