	.file	"extr_smc_ib.c_smc_ib_get_memory_region.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	smc_ib_get_memory_region
	.type	smc_ib_get_memory_region, @function
smc_ib_get_memory_region:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rax, QWORD PTR 8[rdx]
	mov	rdx, QWORD PTR SMC_SINGLE_LINK[rip]
	lea	rbx, [rax+rdx*8]
	cmp	QWORD PTR [rbx], 0
	je	.L2
.L5:
	xor	eax, eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	ecx, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR IB_MR_TYPE_MEM_REG[rip]
	mov	edx, 1
	sal	edx, cl
	call	ib_alloc_mr@PLT
	mov	rdx, QWORD PTR SMC_SINGLE_LINK[rip]
	mov	QWORD PTR [rbx], rax
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L11
	mov	rdi, rbp
	call	smc_ib_map_mr_sg@PLT
	cmp	eax, 1
	je	.L5
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdx, QWORD PTR SMC_SINGLE_LINK[rip]
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	PTR_ERR@PLT
	mov	rdx, QWORD PTR 8[rbp]
	mov	rcx, QWORD PTR SMC_SINGLE_LINK[rip]
	mov	QWORD PTR [rdx+rcx*8], 0
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	smc_ib_get_memory_region, .-smc_ib_get_memory_region
	.comm	SMC_SINGLE_LINK,8,8
	.comm	IB_MR_TYPE_MEM_REG,4,4
	.comm	EINVAL,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_smc_ib.c_smc_ib_get_memory_region.c"
	.text
	.align	2
	.global	smc_ib_get_memory_region
	.syntax unified
	.arm
	.fpu softvfp
	.type	smc_ib_get_memory_region, %function
smc_ib_get_memory_region:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r7, .L12
	ldr	r5, [r2, #4]
	ldr	r6, [r7]
	ldr	r8, [r5, r6, lsl #2]
	cmp	r8, #0
	beq	.L2
.L5:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r1, #1
	ldr	r3, .L12+4
	mov	r4, r2
	ldr	r2, [r2]
	lsl	r2, r1, r2
	ldr	r1, [r3]
	bl	ib_alloc_mr
	ldr	r2, [r7]
	ldr	r3, [r4, #4]
	str	r0, [r5, r6, lsl #2]
	ldr	r0, [r3, r2, lsl #2]
	bl	IS_ERR
	cmp	r0, #0
	bne	.L11
	mov	r0, r4
	bl	smc_ib_map_mr_sg
	cmp	r0, #1
	beq	.L5
	ldr	r3, .L12+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L11:
	ldr	r2, [r7]
	ldr	r3, [r4, #4]
	ldr	r0, [r3, r2, lsl #2]
	bl	PTR_ERR
	ldr	r2, [r7]
	ldr	r3, [r4, #4]
	str	r8, [r3, r2, lsl #2]
	pop	{r4, r5, r6, r7, r8, pc}
.L13:
	.align	2
.L12:
	.word	SMC_SINGLE_LINK
	.word	IB_MR_TYPE_MEM_REG
	.word	EINVAL
	.size	smc_ib_get_memory_region, .-smc_ib_get_memory_region
	.comm	SMC_SINGLE_LINK,4,4
	.comm	IB_MR_TYPE_MEM_REG,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
