	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GetBestTransformSettingForIPsecSa ## -- Begin function GetBestTransformSettingForIPsecSa
	.p2align	4, 0x90
_GetBestTransformSettingForIPsecSa:     ## @GetBestTransformSettingForIPsecSa
	.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	%rcx, -64(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.1:
	movq	%rsi, %rbx
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.2:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_20
## %bb.3:
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_20
## %bb.4:
	movq	%r15, %rdi
	movl	$16, %esi
	callq	_Zero
	movl	(%rbx), %edi
	movq	_IKE_PAYLOAD_SA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	xorl	%edx, %edx
	callq	_IkeGetPayload
	testq	%rax, %rax
	je	LBB0_20
## %bb.5:
	movq	%rax, %rbx
	movl	32(%rax), %edi
	movq	_IKE_PAYLOAD_PROPOSAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_IkeGetPayloadNum
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	jle	LBB0_20
## %bb.6:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%r14
	cmpq	-80(%rbp), %r14                 ## 8-byte Folded Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_19
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movl	32(%rbx), %edi
	movq	_IKE_PAYLOAD_PROPOSAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_IkeGetPayload
	testq	%rax, %rax
	je	LBB0_18
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %r12
	movq	8(%rax), %rax
	movq	_IKE_PROTOCOL_ID_IPSEC_ESP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	16(%r12), %rax
	cmpl	$4, (%rax)
	jne	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	24(%r12), %edi
	movq	_IKE_PAYLOAD_TRANSFORM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_IkeGetPayloadNum
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	jle	LBB0_18
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_12 Depth=2
	incq	%rbx
	cmpq	%rbx, -96(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_18
LBB0_12:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	24(%r12), %edi
	movq	_IKE_PAYLOAD_TRANSFORM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_IkeGetPayload
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	movq	%rax, %r13
	leaq	-112(%rbp), %r15
	movq	%r15, %rdi
	movl	$16, %esi
	callq	_Zero
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r15, %rdx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	callq	_TransformPayloadToTransformSettingForIPsecSa
	testq	%rax, %rax
	jne	LBB0_21
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=2
	cmpq	$0, -112(%rbp)
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=2
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	-112(%rbp), %rsi
	movl	$16, %edx
	callq	_Copy
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_17
LBB0_21:
	leaq	-112(%rbp), %rsi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$16, %edx
	callq	_Copy
	movq	16(%r12), %rax
	movl	4(%rax), %edi
	callq	_READ_UINT
	movl	%eax, 8(%rbx)
	movl	$1, %r14d
	jmp	LBB0_20
LBB0_19:
	xorl	%r14d, %r14d
LBB0_20:
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IKE_PAYLOAD_SA,4,2             ## @IKE_PAYLOAD_SA
	.comm	_IKE_PAYLOAD_PROPOSAL,4,2       ## @IKE_PAYLOAD_PROPOSAL
	.comm	_IKE_PROTOCOL_ID_IPSEC_ESP,8,3  ## @IKE_PROTOCOL_ID_IPSEC_ESP
	.comm	_IKE_PAYLOAD_TRANSFORM,4,2      ## @IKE_PAYLOAD_TRANSFORM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GetBestTransformSettingForIPsecSa ; -- Begin function GetBestTransformSettingForIPsecSa
	.p2align	2
_GetBestTransformSettingForIPsecSa:     ; @GetBestTransformSettingForIPsecSa
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x21, x0
	mov	w0, #0
	cbz	x21, LBB0_21
; %bb.1:
	mov	x22, x1
	cbz	x1, LBB0_21
; %bb.2:
	mov	x19, x2
	cbz	x2, LBB0_21
; %bb.3:
	mov	x20, x3
	cbz	x3, LBB0_21
; %bb.4:
	mov	x0, x19
	mov	w1, #16
	bl	_Zero
	ldr	w0, [x22]
Lloh0:
	adrp	x8, _IKE_PAYLOAD_SA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IKE_PAYLOAD_SA@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_IkeGetPayload
	cbz	x0, LBB0_21
; %bb.5:
	mov	x22, x0
	ldr	w0, [x0, #32]
Lloh3:
	adrp	x8, _IKE_PAYLOAD_PROPOSAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IKE_PAYLOAD_PROPOSAL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_IkeGetPayloadNum
	cmp	x0, #1
	b.lt	LBB0_19
; %bb.6:
	mov	x23, x0
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	mov	x24, #0
	mov	w19, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x24, x24, #1
	cmp	x24, x23
	b.eq	LBB0_19
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_14 Depth 2
	ldr	w0, [x22, #32]
Lloh6:
	adrp	x8, _IKE_PAYLOAD_PROPOSAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IKE_PAYLOAD_PROPOSAL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x2, x24
	bl	_IkeGetPayload
	cbz	x0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x25, x0
	ldr	x8, [x0, #8]
Lloh9:
	adrp	x9, _IKE_PROTOCOL_ID_IPSEC_ESP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IKE_PROTOCOL_ID_IPSEC_ESP@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x25, #16]
	ldr	w8, [x8]
	cmp	w8, #4
	b.ne	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x25, #24]
Lloh12:
	adrp	x8, _IKE_PAYLOAD_TRANSFORM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IKE_PAYLOAD_TRANSFORM@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_IkeGetPayloadNum
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x26, x0
	mov	x27, #0
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=2
	add	x27, x27, #1
	cmp	x26, x27
	b.eq	LBB0_7
LBB0_14:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x25, #24]
Lloh15:
	adrp	x8, _IKE_PAYLOAD_TRANSFORM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IKE_PAYLOAD_TRANSFORM@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x2, x27
	bl	_IkeGetPayload
	cbz	x0, LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=2
	mov	x28, x0
	add	x0, sp, #16
	mov	w1, #16
	bl	_Zero
	add	x2, sp, #16
	mov	x0, x21
	mov	x1, x28
	mov	x3, x20
	bl	_TransformPayloadToTransformSettingForIPsecSa
	cbnz	x0, LBB0_20
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=2
	ldr	x8, [sp, #16]
	cbz	x8, LBB0_13
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=2
	cbnz	w19, LBB0_13
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=2
	add	x1, sp, #16
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	w2, #16
	bl	_Copy
	mov	w19, #1
	b	LBB0_13
LBB0_19:
	mov	w0, #0
	b	LBB0_21
LBB0_20:
	add	x1, sp, #16
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x19
	mov	w2, #16
	bl	_Copy
	ldr	x8, [x25, #16]
	ldr	w0, [x8, #4]
	bl	_READ_UINT
	str	w0, [x19, #8]
	mov	w0, #1
LBB0_21:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_IKE_PAYLOAD_SA,4,2             ; @IKE_PAYLOAD_SA
	.comm	_IKE_PAYLOAD_PROPOSAL,4,2       ; @IKE_PAYLOAD_PROPOSAL
	.comm	_IKE_PROTOCOL_ID_IPSEC_ESP,8,3  ; @IKE_PROTOCOL_ID_IPSEC_ESP
	.comm	_IKE_PAYLOAD_TRANSFORM,4,2      ; @IKE_PAYLOAD_TRANSFORM
.subsections_via_symbols
