	.file	"extr_xpc_partition.c_xpc_get_remote_rp.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	xpc_get_remote_rp
	.type	xpc_get_remote_rp, @function
xpc_get_remote_rp:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	xpc_get_rsvd_page_pa@PLT
	mov	QWORD PTR 0[r13], rax
	test	rax, rax
	jne	.L2
	mov	eax, DWORD PTR xpNoRsvdPageAddr[rip]
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, r12
	mov	r13, QWORD PTR xpc_nasid_mask_nbytes[rip]
	mov	rbp, rax
	add	r13, QWORD PTR XPC_RP_HEADER_SIZE[rip]
	call	xp_pa@PLT
	mov	rdx, r13
	mov	rsi, rbp
	mov	edi, eax
	call	xp_remote_memcpy@PLT
	cmp	eax, DWORD PTR xpSuccess[rip]
	jne	.L1
	test	rbx, rbx
	je	.L5
	mov	rdi, r12
	call	XPC_RP_PART_NASIDS@PLT
	mov	edx, DWORD PTR xpc_nasid_mask_nlongs[rip]
	test	edx, edx
	jle	.L5
	lea	esi, -1[rdx]
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rcx, QWORD PTR [rax+rdx*8]
	or	QWORD PTR [rbx+rdx*8], rcx
	mov	rcx, rdx
	add	rdx, 1
	cmp	rcx, rsi
	jne	.L6
.L5:
	cmp	QWORD PTR [r12], 0
	mov	eax, DWORD PTR xpRsvdPageNotSet[rip]
	je	.L1
	mov	edi, DWORD PTR 24[r12]
	call	XPC_VERSION_MAJOR@PLT
	mov	edi, DWORD PTR XPC_RP_VERSION[rip]
	mov	rbx, rax
	call	XPC_VERSION_MAJOR@PLT
	cmp	rbx, rax
	je	.L8
	mov	eax, DWORD PTR xpBadVersion[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR 8[r12]
	test	rax, rax
	js	.L9
	cmp	rax, QWORD PTR xp_max_npartitions[rip]
	jge	.L9
	mov	rdx, QWORD PTR xp_partition_id[rip]
	cmp	QWORD PTR 16[r12], rdx
	jle	.L9
	cmp	rax, rdx
	mov	eax, DWORD PTR xpLocalPartid[rip]
	cmovne	eax, DWORD PTR xpSuccess[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	mov	eax, DWORD PTR xpInvalidPartid[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	xpc_get_remote_rp, .-xpc_get_remote_rp
	.comm	xpc_nasid_mask_nlongs,4,4
	.comm	xpc_nasid_mask_nbytes,8,8
	.comm	xp_partition_id,8,8
	.comm	xp_max_npartitions,8,8
	.comm	xpSuccess,4,4
	.comm	xpRsvdPageNotSet,4,4
	.comm	xpNoRsvdPageAddr,4,4
	.comm	xpLocalPartid,4,4
	.comm	xpInvalidPartid,4,4
	.comm	xpBadVersion,4,4
	.comm	XPC_RP_VERSION,4,4
	.comm	XPC_RP_HEADER_SIZE,8,8
	.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_xpc_partition.c_xpc_get_remote_rp.c"
	.text
	.align	2
	.global	xpc_get_remote_rp
	.syntax unified
	.arm
	.fpu softvfp
	.type	xpc_get_remote_rp, %function
xpc_get_remote_rp:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r3
	mov	r4, r1
	mov	r6, r2
	bl	xpc_get_rsvd_page_pa
	cmp	r0, #0
	str	r0, [r5]
	bne	.L2
	ldr	r3, .L18
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L2:
	mov	r0, r6
	bl	xp_pa
	ldr	r2, .L18+4
	ldr	r3, .L18+8
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r5]
	add	r2, r2, r3
	bl	xp_remote_memcpy
	ldr	r5, .L18+12
	ldr	r3, [r5]
	cmp	r0, r3
	popne	{r4, r5, r6, pc}
	cmp	r4, #0
	beq	.L5
	mov	r0, r6
	bl	XPC_RP_PART_NASIDS
	ldr	r3, .L18+16
	ldr	ip, [r3]
	cmp	ip, #0
	ble	.L5
	add	ip, r4, ip, lsl #2
	sub	ip, ip, #4
	sub	r1, r4, #4
	sub	r0, r0, #4
.L6:
	ldr	r3, [r1, #4]!
	ldr	r2, [r0, #4]!
	cmp	r1, ip
	orr	r3, r3, r2
	str	r3, [r1]
	bne	.L6
.L5:
	ldr	r3, [r6]
	cmp	r3, #0
	bne	.L7
	ldr	r3, .L18+20
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L7:
	ldr	r0, [r6, #12]
	bl	XPC_VERSION_MAJOR
	ldr	r3, .L18+24
	mov	r4, r0
	ldr	r0, [r3]
	bl	XPC_VERSION_MAJOR
	cmp	r4, r0
	beq	.L8
	ldr	r3, .L18+28
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L8:
	ldr	r3, [r6, #4]
	cmp	r3, #0
	blt	.L9
	ldr	r2, .L18+32
	ldr	r2, [r2]
	cmp	r3, r2
	bge	.L9
	ldr	r2, .L18+36
	ldr	r1, [r6, #8]
	ldr	r2, [r2]
	cmp	r1, r2
	ble	.L9
	cmp	r3, r2
	ldreq	r3, .L18+40
	ldreq	r0, [r3]
	ldrne	r0, [r5]
	pop	{r4, r5, r6, pc}
.L9:
	ldr	r3, .L18+44
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L19:
	.align	2
.L18:
	.word	xpNoRsvdPageAddr
	.word	XPC_RP_HEADER_SIZE
	.word	xpc_nasid_mask_nbytes
	.word	xpSuccess
	.word	xpc_nasid_mask_nlongs
	.word	xpRsvdPageNotSet
	.word	XPC_RP_VERSION
	.word	xpBadVersion
	.word	xp_max_npartitions
	.word	xp_partition_id
	.word	xpLocalPartid
	.word	xpInvalidPartid
	.size	xpc_get_remote_rp, .-xpc_get_remote_rp
	.comm	xpc_nasid_mask_nlongs,4,4
	.comm	xpc_nasid_mask_nbytes,4,4
	.comm	xp_partition_id,4,4
	.comm	xp_max_npartitions,4,4
	.comm	xpSuccess,4,4
	.comm	xpRsvdPageNotSet,4,4
	.comm	xpNoRsvdPageAddr,4,4
	.comm	xpLocalPartid,4,4
	.comm	xpInvalidPartid,4,4
	.comm	xpBadVersion,4,4
	.comm	XPC_RP_VERSION,4,4
	.comm	XPC_RP_HEADER_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
