	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmbus_walk_resources
_vmbus_walk_resources:                  ## @vmbus_walk_resources
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %eax
	movq	_AE_OK@GOTPCREL(%rip), %r14
	cmpl	$128, %eax
	je	LBB0_3
## %bb.1:
	cmpl	$129, %eax
	jne	LBB0_20
## %bb.2:
	leaq	12(%rdi), %rax
	addq	$16, %rdi
	jmp	LBB0_4
LBB0_3:
	leaq	4(%rdi), %rax
	addq	$8, %rdi
LBB0_4:
	movl	(%rdi), %ebx
	cmpl	$1048576, %ebx                  ## imm = 0x100000
	jl	LBB0_20
## %bb.5:
	movl	(%rax), %r15d
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	_VTPM_BASE_ADDRESS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	%edx, %r15d
	movl	%ebx, %r9d
	cmovll	%edx, %r9d
	cmpl	%edx, %ebx
	cmovlel	%ebx, %r9d
	leaq	L_.str(%rip), %rdx
	movq	%rdx, (%rax)
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 24(%rax)
	movl	%r15d, 8(%rax)
	movl	%r9d, 12(%rax)
	movq	_hyperv_mmio@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rdi
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.8:
	leal	1(%r9), %r8d
	movq	_hyperv_mmio@GOTPCREL(%rip), %rdx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	12(%rdi), %esi
	incl	%esi
	cmpl	%r15d, %esi
	je	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	8(%rdi), %esi
	cmpl	%r8d, %esi
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpl	%r9d, %esi
	jg	LBB0_15
## %bb.18:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rdi, %rsi
	movq	16(%rdi), %rcx
	addq	$16, %rsi
	movq	%rcx, %rdi
	movq	%rdx, %rbx
	movq	%rsi, %rdx
	testq	%rcx, %rcx
	jne	LBB0_9
LBB0_19:
	movq	%rax, (%rsi)
	jmp	LBB0_20
LBB0_6:
	movq	_AE_NO_MEMORY@GOTPCREL(%rip), %r14
	jmp	LBB0_20
LBB0_10:
	movl	%r9d, 12(%rdi)
	jmp	LBB0_11
LBB0_13:
	movl	%r15d, 8(%rdi)
LBB0_11:
	movq	%rax, %rdi
	callq	_kfree
	jmp	LBB0_20
LBB0_15:
	movq	%rdi, 16(%rax)
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.16:
	movq	(%rbx), %rcx
	movq	%rax, 16(%rcx)
LBB0_17:
	movq	%rax, (%rdx)
LBB0_20:
	movl	(%r14), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_hyperv_mmio,8,3                ## @hyperv_mmio
	.comm	_AE_OK,4,2                      ## @AE_OK
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_AE_NO_MEMORY,4,2               ## @AE_NO_MEMORY
	.comm	_VTPM_BASE_ADDRESS,4,2          ## @VTPM_BASE_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hyperv mmio"

	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.no_dead_strip	_vmbus_walk_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmbus_walk_resources
_vmbus_walk_resources:                  ; @vmbus_walk_resources
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
	cmp	w8, #128
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #129
	b.ne	LBB0_19
; %bb.2:
	add	x8, x0, #12
	add	x9, x0, #16
	b	LBB0_4
LBB0_3:
	add	x8, x0, #4
	add	x9, x0, #8
LBB0_4:
	ldr	w20, [x9]
	cmp	w20, #256, lsl #12              ; =1048576
	b.lt	LBB0_19
; %bb.5:
	ldr	w19, [x8]
Lloh0:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_13
; %bb.6:
Lloh3:
	adrp	x8, _VTPM_BASE_ADDRESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VTPM_BASE_ADDRESS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w19, w8
	ccmp	w20, w8, #4, lt
	csel	w8, w8, w20, gt
Lloh6:
	adrp	x9, l_.str@PAGE
Lloh7:
	add	x9, x9, l_.str@PAGEOFF
	str	x9, [x0]
Lloh8:
	adrp	x9, _IORESOURCE_MEM@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	str	w9, [x0, #24]
	stp	w19, w8, [x0, #8]
Lloh11:
	adrp	x13, _hyperv_mmio@GOTPAGE
Lloh12:
	ldr	x13, [x13, _hyperv_mmio@GOTPAGEOFF]
	ldr	x10, [x13]
	cbz	x10, LBB0_12
; %bb.7:
	mov	x11, #0
	add	w12, w8, #1
Lloh13:
	adrp	x9, _hyperv_mmio@GOTPAGE
Lloh14:
	ldr	x9, [x9, _hyperv_mmio@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x10, #12]
	add	w13, w13, #1
	cmp	w13, w19
	b.eq	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w13, [x10, #8]
	cmp	w13, w12
	b.eq	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w13, w8
	b.gt	LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x14, [x10, #16]!
	mov	x13, x10
	mov	x10, x14
	mov	x11, x9
	mov	x9, x13
	cbnz	x14, LBB0_8
LBB0_12:
	str	x0, [x13]
	b	LBB0_19
LBB0_13:
Lloh15:
	adrp	x8, _AE_NO_MEMORY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AE_NO_MEMORY@GOTPAGEOFF]
	b	LBB0_20
LBB0_14:
	str	w8, [x10, #12]
	bl	_kfree
	b	LBB0_19
LBB0_15:
	str	w19, [x10, #8]
	bl	_kfree
	b	LBB0_19
LBB0_16:
	str	x10, [x0, #16]
	cbz	x11, LBB0_18
; %bb.17:
	ldr	x8, [x11]
	str	x0, [x8, #16]
LBB0_18:
	str	x0, [x9]
LBB0_19:
Lloh17:
	adrp	x8, _AE_OK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AE_OK@GOTPAGEOFF]
LBB0_20:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_hyperv_mmio,8,3                ; @hyperv_mmio
	.comm	_AE_OK,4,2                      ; @AE_OK
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_AE_NO_MEMORY,4,2               ; @AE_NO_MEMORY
	.comm	_VTPM_BASE_ADDRESS,4,2          ; @VTPM_BASE_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hyperv mmio"

	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.no_dead_strip	_vmbus_walk_resources
.subsections_via_symbols
