	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IkeBuildEx                     ## -- Begin function IkeBuildEx
	.p2align	4, 0x90
_IkeBuildEx:                            ## @IkeBuildEx
	.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	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.1:
	movq	%rdi, %rbx
	xorl	%r15d, %r15d
	cmpq	$0, 16(%rdi)
	je	LBB0_21
## %bb.2:
	movl	%edx, %r12d
	movq	%rsi, %r14
	leaq	-88(%rbp), %rdi
	movl	$56, %esi
	callq	_Zero
	movl	56(%rbx), %edi
	callq	_Endian64
	movq	%rax, -40(%rbp)
	movl	52(%rbx), %edi
	callq	_Endian64
	movq	%rax, -48(%rbp)
	movq	16(%rbx), %rdi
	callq	_IkeGetFirstPayloadType
	movl	%eax, -56(%rbp)
	movq	_IKE_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movl	48(%rbx), %eax
	movl	%eax, -64(%rbp)
	cmpq	$0, (%rbx)
	movl	$0, %ecx
	je	LBB0_4
## %bb.3:
	movq	_IKE_HEADER_FLAG_ENCRYPTED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_4:
	cmpq	$0, 40(%rbx)
	movl	$0, %eax
	je	LBB0_6
## %bb.5:
	movq	_IKE_HEADER_FLAG_COMMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	orl	%ecx, %eax
	cmpq	$0, 32(%rbx)
	je	LBB0_8
## %bb.7:
	movq	_IKE_HEADER_FLAG_AUTH_ONLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
LBB0_8:
	orl	%r15d, %eax
	movl	%eax, -88(%rbp)
	movq	24(%rbx), %rdi
	callq	_Endian32
	movq	%rax, -72(%rbp)
	testl	%r12d, %r12d
	je	LBB0_12
## %bb.9:
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.10:
	callq	_CloneBuf
	jmp	LBB0_13
LBB0_12:
	movq	16(%rbx), %rdi
	callq	_IkeBuildPayloadList
LBB0_13:
	movq	%rax, %r12
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	callq	_FreeBuf
LBB0_15:
	movq	%r12, %rdi
	callq	_CloneBuf
	movq	%rax, 8(%rbx)
	cmpq	$0, (%rbx)
	je	LBB0_18
## %bb.16:
	movl	8(%r12), %edi
	movq	(%r12), %rsi
	movq	%r14, %rdx
	callq	_IkeEncryptWithPadding
	testq	%rax, %rax
	je	LBB0_19
## %bb.17:
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_FreeBuf
	movq	%rbx, %r12
LBB0_18:
	movq	(%r12), %rdi
	addq	$56, %rdi
	callq	_Endian32
	movq	%rax, -80(%rbp)
	xorl	%eax, %eax
	callq	_NewBuf
	movq	%rax, %r15
	leaq	-88(%rbp), %rsi
	movq	%rax, %rdi
	movl	$56, %edx
	callq	_WriteBuf
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_WriteBufBuf
	movq	%r12, %rdi
	callq	_FreeBuf
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_SeekBuf
	jmp	LBB0_21
LBB0_19:
	leaq	L_.str(%rip), %rdi
	callq	_Debug
	movq	%r12, %rdi
	callq	_FreeBuf
LBB0_20:
	xorl	%r15d, %r15d
LBB0_21:
	movq	%r15, %rax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IKE_VERSION,4,2                ## @IKE_VERSION
	.comm	_IKE_HEADER_FLAG_ENCRYPTED,4,2  ## @IKE_HEADER_FLAG_ENCRYPTED
	.comm	_IKE_HEADER_FLAG_COMMIT,4,2     ## @IKE_HEADER_FLAG_COMMIT
	.comm	_IKE_HEADER_FLAG_AUTH_ONLY,4,2  ## @IKE_HEADER_FLAG_AUTH_ONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ISAKMP: Packet Encrypt Failed\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IkeBuildEx                     ; -- Begin function IkeBuildEx
	.p2align	2
_IkeBuildEx:                            ; @IkeBuildEx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_5
; %bb.2:
	mov	x21, x2
	mov	x19, x1
	add	x0, sp, #8
	mov	w1, #56
	bl	_Zero
	ldr	w0, [x20, #56]
	bl	_Endian64
	str	x0, [sp, #56]
	ldr	w0, [x20, #52]
	bl	_Endian64
	str	x0, [sp, #48]
	ldr	x0, [x20, #16]
	bl	_IkeGetFirstPayloadType
Lloh0:
	adrp	x8, _IKE_VERSION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IKE_VERSION@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	stp	w8, w0, [sp, #36]
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _IKE_HEADER_FLAG_ENCRYPTED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IKE_HEADER_FLAG_ENCRYPTED@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w8, wzr, w9, eq
	ldr	x9, [x20, #40]
Lloh6:
	adrp	x10, _IKE_HEADER_FLAG_COMMIT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _IKE_HEADER_FLAG_COMMIT@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w8, w9, w8
	ldp	x0, x9, [x20, #24]
	cmp	x9, #0
Lloh9:
	adrp	x9, _IKE_HEADER_FLAG_AUTH_ONLY@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IKE_HEADER_FLAG_AUTH_ONLY@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	csel	w9, wzr, w9, eq
	orr	w8, w8, w9
	ldr	w9, [x20, #48]
	str	w9, [sp, #32]
	str	w8, [sp, #8]
	bl	_Endian32
	str	x0, [sp, #24]
	cbz	w21, LBB0_6
; %bb.3:
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_6
; %bb.4:
	bl	_CloneBuf
	b	LBB0_7
LBB0_5:
	mov	x19, #0
	b	LBB0_14
LBB0_6:
	ldr	x0, [x20, #16]
	bl	_IkeBuildPayloadList
LBB0_7:
	mov	x21, x0
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_9
; %bb.8:
	bl	_FreeBuf
LBB0_9:
	mov	x0, x21
	bl	_CloneBuf
	str	x0, [x20, #8]
	ldr	x8, [x20]
	cbz	x8, LBB0_12
; %bb.10:
	ldr	w0, [x21, #8]
	ldr	x1, [x21]
	mov	x2, x19
	bl	_IkeEncryptWithPadding
	mov	x19, x0
	cbz	x0, LBB0_13
; %bb.11:
	mov	x0, x21
	bl	_FreeBuf
	mov	x21, x19
LBB0_12:
	ldr	x8, [x21]
	add	x0, x8, #56
	bl	_Endian32
	str	x0, [sp, #16]
	bl	_NewBuf
	mov	x19, x0
	add	x1, sp, #8
	mov	w2, #56
	bl	_WriteBuf
	mov	x0, x19
	mov	x1, x21
	bl	_WriteBufBuf
	mov	x0, x21
	bl	_FreeBuf
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	bl	_SeekBuf
	b	LBB0_14
LBB0_13:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Debug
	mov	x0, x21
	bl	_FreeBuf
LBB0_14:
	mov	x0, x19
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_IKE_VERSION,4,2                ; @IKE_VERSION
	.comm	_IKE_HEADER_FLAG_ENCRYPTED,4,2  ; @IKE_HEADER_FLAG_ENCRYPTED
	.comm	_IKE_HEADER_FLAG_COMMIT,4,2     ; @IKE_HEADER_FLAG_COMMIT
	.comm	_IKE_HEADER_FLAG_AUTH_ONLY,4,2  ; @IKE_HEADER_FLAG_AUTH_ONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ISAKMP: Packet Encrypt Failed\n"

.subsections_via_symbols
