	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmbus_allocate_mmio            ## -- Begin function vmbus_allocate_mmio
	.p2align	4, 0x90
_vmbus_allocate_mmio:                   ## @vmbus_allocate_mmio
	.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	%r9, -48(%rbp)                  ## 8-byte Spill
	movq	%r8, %rbx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_dev_name
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movq	_hyperv_mmio_lock@GOTPCREL(%rip), %rdi
	callq	_down
	cmpl	$0, 16(%rbp)
	je	LBB0_6
## %bb.1:
	movq	_fb_mmio@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	(%rax), %r15
	cmpq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	jl	LBB0_6
## %bb.3:
	movq	8(%rax), %rax
	cmpq	-72(%rbp), %rax                 ## 8-byte Folded Reload
	jle	LBB0_4
LBB0_6:
	movq	_hyperv_mmio@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	testq	%r12, %r12
	je	LBB0_22
## %bb.7:
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	-1(%rax), %rcx
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	negq	%rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	leaq	-1(%rbx), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	24(%r12), %r12
	testq	%r12, %r12
	je	LBB0_21
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movq	(%r12), %r14
	cmpq	-72(%rbp), %r14                 ## 8-byte Folded Reload
	jge	LBB0_20
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r12), %r15
	cmpq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	jle	LBB0_20
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	addq	-112(%rbp), %r14                ## 8-byte Folded Reload
	andq	-104(%rbp), %r14                ## 8-byte Folded Reload
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	addq	%r14, %rax
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_11 Depth=2
	addq	-48(%rbp), %r14                 ## 8-byte Folded Reload
	leaq	(%rbx,%r14), %rax
	decq	%rax
LBB0_11:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%r15, %rax
	jg	LBB0_20
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	_IORESOURCE_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	callq	___request_region
	testq	%rax, %rax
	je	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	%rax, %r13
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	callq	_request_mem_region_exclusive
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jne	LBB0_14
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	___release_region
	jmp	LBB0_19
LBB0_14:
	movq	%rax, 16(%r13)
	xorl	%r13d, %r13d
	jmp	LBB0_22
LBB0_21:
	movl	-52(%rbp), %r13d                ## 4-byte Reload
LBB0_22:
	movq	_hyperv_mmio_lock@GOTPCREL(%rip), %rdi
	callq	_up
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	addq	%r14, %rax
	decq	%rax
	negq	%r14
	andq	%rax, %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%rbx,%r14), %rax
	decq	%rax
	cmpq	%r15, %rax
	jg	LBB0_6
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	callq	_request_mem_region_exclusive
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jne	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	addq	-48(%rbp), %r14                 ## 8-byte Folded Reload
	jmp	LBB0_5
LBB0_17:
	xorl	%r13d, %r13d
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_hyperv_mmio_lock,4,2           ## @hyperv_mmio_lock
	.comm	_fb_mmio,8,3                    ## @fb_mmio
	.comm	_hyperv_mmio,8,3                ## @hyperv_mmio
	.comm	_IORESOURCE_BUSY,4,2            ## @IORESOURCE_BUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmbus_allocate_mmio            ; -- Begin function vmbus_allocate_mmio
	.p2align	2
_vmbus_allocate_mmio:                   ; @vmbus_allocate_mmio
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x25, x6
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	str	x2, [sp, #40]                   ; 8-byte Folded Spill
	mov	x23, x0
	mov	x0, x1
	bl	_dev_name
	mov	x24, x0
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x0, _hyperv_mmio_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _hyperv_mmio_lock@GOTPAGEOFF]
	bl	_down
	cbz	w25, LBB0_4
; %bb.1:
Lloh5:
	adrp	x8, _fb_mmio@GOTPAGE
Lloh6:
	ldr	x8, [x8, _fb_mmio@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	x26, [x8]
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	cmp	x26, x9
	b.lt	LBB0_4
; %bb.3:
	ldr	x8, [x8, #8]
	cmp	x8, x21
	b.le	LBB0_16
LBB0_4:
	neg	w22, w22
Lloh8:
	adrp	x8, _hyperv_mmio@GOTPAGE
Lloh9:
	ldr	x8, [x8, _hyperv_mmio@GOTPAGEOFF]
Lloh10:
	ldr	x26, [x8]
	cbz	x26, LBB0_15
; %bb.5:
	str	w22, [sp, #12]                  ; 4-byte Folded Spill
	sub	x9, x19, #1
	neg	x8, x19
	stp	x8, x9, [sp, #24]               ; 16-byte Folded Spill
	sub	x8, x20, #1
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
Lloh11:
	adrp	x22, _IORESOURCE_BUSY@GOTPAGE
Lloh12:
	ldr	x22, [x22, _IORESOURCE_BUSY@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x26, [x26, #24]
	cbz	x26, LBB0_14
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	ldr	x8, [x26]
	cmp	x8, x21
	b.ge	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x25, [x26, #8]
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	cmp	x25, x9
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	add	x8, x9, x8
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	and	x27, x8, x9
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	add	x8, x8, x27
	ccmp	x8, x25, #0, gt
	b.gt	LBB0_6
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=2
	mov	x0, x26
	mov	x1, x27
	mov	x2, x20
	bl	___release_region
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=2
	add	x27, x27, x19
	add	x8, x20, x27
	sub	x8, x8, #1
	cmp	x8, x25
	b.gt	LBB0_6
LBB0_11:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w4, [x22]
	mov	x0, x26
	mov	x1, x27
	mov	x2, x20
	mov	x3, #0
	bl	___request_region
	cbz	x0, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	mov	x28, x0
	mov	x0, x27
	mov	x1, x20
	mov	x2, x24
	bl	_request_mem_region_exclusive
	str	x0, [x23]
	cbz	x0, LBB0_9
; %bb.13:
	mov	w22, #0
	str	x0, [x28, #16]
	b	LBB0_15
LBB0_14:
	ldr	w22, [sp, #12]                  ; 4-byte Folded Reload
LBB0_15:
Lloh13:
	adrp	x0, _hyperv_mmio_lock@GOTPAGE
Lloh14:
	ldr	x0, [x0, _hyperv_mmio_lock@GOTPAGEOFF]
	bl	_up
	mov	x0, x22
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_16:
	add	x8, x19, x8
	sub	x8, x8, #1
	neg	x9, x19
	and	x25, x8, x9
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	add	x8, x20, x25
	sub	x8, x8, #1
	cmp	x8, x26
	b.gt	LBB0_4
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x25
	mov	x1, x20
	mov	x2, x24
	bl	_request_mem_region_exclusive
	str	x0, [x23]
	cbnz	x0, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	add	x25, x25, x19
	b	LBB0_17
LBB0_20:
	mov	w22, #0
	b	LBB0_15
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_hyperv_mmio_lock,4,2           ; @hyperv_mmio_lock
	.comm	_fb_mmio,8,3                    ; @fb_mmio
	.comm	_hyperv_mmio,8,3                ; @hyperv_mmio
	.comm	_IORESOURCE_BUSY,4,2            ; @IORESOURCE_BUSY
.subsections_via_symbols
