	.file	"extr_xfrm_policy.c_xfrm_tmpl_resolve.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	xfrm_tmpl_resolve, @function
xfrm_tmpl_resolve:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	QWORD PTR -88[rbp], rdx
	movsx	rdx, DWORD PTR XFRM_MAX_DEPTH[rip]
	mov	QWORD PTR -96[rbp], rcx
	mov	rbx, rsp
	mov	QWORD PTR -72[rbp], rdi
	mov	DWORD PTR -76[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rdx
	lea	rdx, 15[0+rdx*8]
	mov	rcx, rdx
	and	rdx, -4096
	sub	rbx, rdx
	and	rcx, -16
	mov	rdx, rbx
	cmp	rsp, rdx
	je	.L3
.L26:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rdx
	jne	.L26
.L3:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L27
	cmp	DWORD PTR -76[rbp], 1
	mov	r12, rsp
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L12:
	xor	r14d, r14d
	xor	r13d, r13d
	movzx	ebx, r8w
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	movsx	rax, r13d
	mov	rsi, QWORD PTR -88[rbp]
	mov	ecx, ebx
	lea	rdx, [r12+rax*8]
	call	xfrm_tmpl_resolve_one@PLT
	mov	r15d, eax
	test	eax, eax
	js	.L7
	add	r13d, eax
	add	r14, 1
	cmp	DWORD PTR -76[rbp], r14d
	jle	.L8
	mov	eax, DWORD PTR XFRM_MAX_DEPTH[rip]
.L9:
	mov	rsi, QWORD PTR -72[rbp]
	mov	rdi, QWORD PTR [rsi+r14*8]
	mov	edx, DWORD PTR [rdi]
	add	edx, r13d
	cmp	edx, eax
	jl	.L6
	mov	r15d, DWORD PTR ENOBUFS[rip]
	neg	r15d
.L7:
	lea	ebx, -1[r13]
	test	r13d, r13d
	je	.L1
	movsx	rbx, ebx
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, QWORD PTR [r12+rbx*8]
	sub	rbx, 1
	call	xfrm_state_put@PLT
	cmp	ebx, -1
	jne	.L11
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L28
	lea	rsp, -40[rbp]
	mov	eax, r15d
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	r12, QWORD PTR -96[rbp]
	je	.L12
	xor	r15d, r15d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	cmp	DWORD PTR -76[rbp], 1
	mov	r15d, r13d
	jle	.L1
	mov	rdi, QWORD PTR -96[rbp]
	mov	ecx, ebx
	mov	edx, r13d
	mov	rsi, r12
	call	xfrm_state_sort@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L27:
	or	QWORD PTR -8[rsp+rcx], 0
	cmp	DWORD PTR -76[rbp], 1
	mov	r12, rsp
	jg	.L12
	jmp	.L5
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	xfrm_tmpl_resolve, .-xfrm_tmpl_resolve
	.comm	XFRM_MAX_DEPTH,4,4
	.comm	ENOBUFS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_xfrm_policy.c_xfrm_tmpl_resolve.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	xfrm_tmpl_resolve, %function
xfrm_tmpl_resolve:
	@ args = 4, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #20
	cmp	r1, #1
	str	r1, [fp, #-48]
	ldr	r1, .L23
	str	r3, [fp, #-52]
	ldr	ip, [r1]
	ldr	r3, .L23+4
	lsl	lr, ip, #2
	add	lr, lr, #7
	bic	lr, lr, #7
	sub	sp, sp, lr
	mov	r9, r2
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	movgt	r7, sp
	ldrh	r8, [fp, #4]
	ble	.L21
.L9:
	mov	r4, #0
	ldr	r10, [fp, #-48]
	mov	r5, r4
	sub	r6, r0, #4
	b	.L6
.L3:
	mov	r3, r8
	mov	r1, r9
	add	r2, r7, r4, lsl #2
	bl	xfrm_tmpl_resolve_one
	cmp	r0, #0
	blt	.L17
	add	r5, r5, #1
	cmp	r10, r5
	add	r4, r4, r0
	ble	.L5
	ldr	r3, .L23
	ldr	ip, [r3]
.L6:
	ldr	r0, [r6, #4]!
	ldr	r3, [r0]
	add	r3, r4, r3
	cmp	r3, ip
	blt	.L3
	ldr	r3, .L23+8
	ldr	r0, [r3]
	rsb	r10, r0, #0
.L4:
	cmp	r4, #0
	beq	.L1
	add	r4, r7, r4, lsl #2
.L8:
	ldr	r0, [r4, #-4]!
	bl	xfrm_state_put
	cmp	r7, r4
	bne	.L8
.L1:
	ldr	r3, .L23+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L22
	mov	r0, r10
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	ldreq	r7, [fp, #-52]
	beq	.L9
	mov	r10, #0
	b	.L1
.L17:
	mov	r10, r0
	b	.L4
.L5:
	ldr	r3, [fp, #-48]
	cmp	r3, #1
	movle	r10, r4
	ble	.L1
	mov	r3, r8
	mov	r1, r7
	mov	r2, r4
	ldr	r0, [fp, #-52]
	bl	xfrm_state_sort
	mov	r10, r4
	b	.L1
.L22:
	bl	__stack_chk_fail
.L24:
	.align	2
.L23:
	.word	XFRM_MAX_DEPTH
	.word	.LC0
	.word	ENOBUFS
	.size	xfrm_tmpl_resolve, .-xfrm_tmpl_resolve
	.comm	XFRM_MAX_DEPTH,4,4
	.comm	ENOBUFS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
