	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_afu_mmio_region_add            ## -- Begin function afu_mmio_region_add
	.p2align	4, 0x90
_afu_mmio_region_add:                   ## @afu_mmio_region_add
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	movq	%rcx, %rbx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	(%rdi), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%r13, 32(%rax)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%r12)
	movq	%rbx, 16(%r12)
	movq	%r15, 8(%r12)
	leaq	8(%r14), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_dfl_fpga_pdata_get_private
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_get_region_by_index
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_EEXIST@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	(%r14), %rdi
	movq	%r12, %rsi
	callq	_devm_kfree
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_4:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_PAGE_ALIGN
	movq	%rax, %r14
	movl	4(%r15), %eax
	movl	%eax, 4(%r12)
	movq	%r15, %rsi
	addq	$8, %rsi
	movq	%r12, %rdi
	callq	_list_add
	addl	%r14d, 4(%r15)
	incl	(%r15)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EEXIST,4,2                     ## @EEXIST
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_afu_mmio_region_add            ; -- Begin function afu_mmio_region_add
	.p2align	2
_afu_mmio_region_add:                   ; @afu_mmio_region_add
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x24, x4
	mov	x25, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
	ldr	x0, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #40
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	stp	x22, x23, [x0, #24]
	add	x21, x20, #8
	stp	x24, x25, [x0, #8]
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x20
	bl	_dfl_fpga_pdata_get_private
	mov	x24, x0
	mov	x1, x23
	bl	_get_region_by_index
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x21
	bl	_mutex_unlock
Lloh3:
	adrp	x8, _EEXIST@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x0, [x20]
	mov	x1, x19
	bl	_devm_kfree
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_5
LBB0_4:
	mov	x0, x22
	bl	_PAGE_ALIGN
	mov	x20, x0
	ldr	w8, [x24, #4]
	str	w8, [x19, #4]
	add	x1, x24, #8
	mov	x0, x19
	bl	_list_add
	ldp	w9, w8, [x24]
	add	w8, w20, w8
	add	w9, w9, #1
	stp	w9, w8, [x24]
	mov	x0, x21
	bl	_mutex_unlock
	mov	w21, #0
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EEXIST,4,2                     ; @EEXIST
.subsections_via_symbols
