	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vga_arbiter_add_pci_device
_vga_arbiter_add_pci_device:            ## @vga_arbiter_add_pci_device
	.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
	movl	(%rdi), %eax
	sarl	$8, %eax
	movq	_PCI_CLASS_DISPLAY_VGA@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	jne	LBB0_19
## %bb.1:
	movq	%rdi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r14
	xorl	%ebx, %ebx
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_vga_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	callq	_vgadev_find
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	$1, %edi
	callq	_BUG_ON
	movq	_vga_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_19
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_19
LBB0_5:
	movq	%r15, 16(%r14)
	movq	_VGA_RSRC_LEGACY_IO@GOTPCREL(%rip), %rbx
	movq	_VGA_RSRC_LEGACY_MEM@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	orl	(%rbx), %eax
	movq	_VGA_RSRC_NORMAL_IO@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_VGA_RSRC_NORMAL_MEM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r14)
	movq	_vga_decode_count@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_PCI_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_word
	movl	-48(%rbp), %eax
	movq	_PCI_COMMAND_IO@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movl	(%rbx), %ecx
	orl	%ecx, 4(%r14)
LBB0_7:
	movq	_PCI_COMMAND_MEMORY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.8:
	movl	(%r12), %eax
	orl	%eax, 4(%r14)
LBB0_9:
	movq	8(%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_15
## %bb.10:
	leaq	-44(%rbp), %r12
	movq	_PCI_BRIDGE_CTL_VGA@GOTPCREL(%rip), %r13
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_15
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_PCI_BRIDGE_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	callq	_pci_read_config_word
	movl	(%r13), %eax
	testl	%eax, -44(%rbp)
	jne	LBB0_14
## %bb.13:
	movl	$0, 4(%r14)
LBB0_15:
	movq	_vga_default@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	jne	LBB0_18
## %bb.16:
	movl	4(%r14), %eax
	movq	_VGA_RSRC_LEGACY_MASK@GOTPCREL(%rip), %rcx
	notl	%eax
	testl	%eax, (%rcx)
	jne	LBB0_18
## %bb.17:
	movq	%r15, %rdi
	callq	_pci_dev_get
	movq	%rax, (%rbx)
LBB0_18:
	movq	%r14, %rdi
	callq	_vga_arbiter_check_bridge_sharing
	movq	%r14, %rdi
	addq	$12, %rdi
	movq	_vga_list@GOTPCREL(%rip), %rsi
	callq	_list_add
	movq	_vga_count@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	%r15, %rdi
	callq	_pci_name
	movl	%eax, %r15d
	movl	(%r14), %edi
	callq	_vga_iostate_to_str
	movl	%eax, %r12d
	movl	4(%r14), %edi
	callq	_vga_iostate_to_str
	movl	%eax, %ebx
	movl	8(%r14), %edi
	callq	_vga_iostate_to_str
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	movl	%eax, %r8d
	callq	_pr_info
	movq	_vga_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movl	$1, %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_CLASS_DISPLAY_VGA,4,2      ## @PCI_CLASS_DISPLAY_VGA
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vgaarb: failed to allocate pci device\n"

	.comm	_vga_lock,4,2                   ## @vga_lock
	.comm	_VGA_RSRC_LEGACY_IO,4,2         ## @VGA_RSRC_LEGACY_IO
	.comm	_VGA_RSRC_LEGACY_MEM,4,2        ## @VGA_RSRC_LEGACY_MEM
	.comm	_VGA_RSRC_NORMAL_IO,4,2         ## @VGA_RSRC_NORMAL_IO
	.comm	_VGA_RSRC_NORMAL_MEM,4,2        ## @VGA_RSRC_NORMAL_MEM
	.comm	_vga_decode_count,4,2           ## @vga_decode_count
	.comm	_PCI_COMMAND,4,2                ## @PCI_COMMAND
	.comm	_PCI_COMMAND_IO,4,2             ## @PCI_COMMAND_IO
	.comm	_PCI_COMMAND_MEMORY,4,2         ## @PCI_COMMAND_MEMORY
	.comm	_PCI_BRIDGE_CONTROL,4,2         ## @PCI_BRIDGE_CONTROL
	.comm	_PCI_BRIDGE_CTL_VGA,4,2         ## @PCI_BRIDGE_CTL_VGA
	.comm	_vga_default,8,3                ## @vga_default
	.comm	_VGA_RSRC_LEGACY_MASK,4,2       ## @VGA_RSRC_LEGACY_MASK
	.comm	_vga_list,4,2                   ## @vga_list
	.comm	_vga_count,4,2                  ## @vga_count
L_.str.1:                               ## @.str.1
	.asciz	"vgaarb: device added: PCI:%s,decodes=%s,owns=%s,locks=%s\n"

	.no_dead_strip	_vga_arbiter_add_pci_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vga_arbiter_add_pci_device
_vga_arbiter_add_pci_device:            ; @vga_arbiter_add_pci_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _PCI_CLASS_DISPLAY_VGA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_CLASS_DISPLAY_VGA@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w9, w8, asr #8
	b.ne	LBB0_4
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	cbz	x0, LBB0_5
; %bb.2:
	mov	x19, x0
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh6:
	adrp	x0, _vga_lock@GOTPAGE
Lloh7:
	ldr	x0, [x0, _vga_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_vgadev_find
	cbz	x0, LBB0_6
; %bb.3:
	mov	w0, #1
	bl	_BUG_ON
Lloh8:
	adrp	x0, _vga_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _vga_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_kfree
LBB0_4:
	mov	w0, #0
	b	LBB0_20
LBB0_5:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	mov	w0, #0
	b	LBB0_20
LBB0_6:
Lloh12:
	adrp	x22, _VGA_RSRC_LEGACY_IO@GOTPAGE
Lloh13:
	ldr	x22, [x22, _VGA_RSRC_LEGACY_IO@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh14:
	adrp	x21, _VGA_RSRC_LEGACY_MEM@GOTPAGE
Lloh15:
	ldr	x21, [x21, _VGA_RSRC_LEGACY_MEM@GOTPAGEOFF]
	ldr	w9, [x21]
	orr	w8, w9, w8
Lloh16:
	adrp	x9, _VGA_RSRC_NORMAL_IO@GOTPAGE
Lloh17:
	ldr	x9, [x9, _VGA_RSRC_NORMAL_IO@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh19:
	adrp	x9, _VGA_RSRC_NORMAL_MEM@GOTPAGE
Lloh20:
	ldr	x9, [x9, _VGA_RSRC_NORMAL_MEM@GOTPAGEOFF]
	str	x20, [x19, #16]
Lloh21:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19]
Lloh22:
	adrp	x8, _vga_decode_count@GOTPAGE
Lloh23:
	ldr	x8, [x8, _vga_decode_count@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh24:
	adrp	x8, _PCI_COMMAND@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PCI_COMMAND@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_word
	ldr	w8, [sp, #12]
Lloh27:
	adrp	x9, _PCI_COMMAND_IO@GOTPAGE
Lloh28:
	ldr	x9, [x9, _PCI_COMMAND_IO@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	ldr	w9, [x22]
	ldr	w10, [x19, #4]
	orr	w9, w10, w9
	str	w9, [x19, #4]
LBB0_8:
Lloh30:
	adrp	x9, _PCI_COMMAND_MEMORY@GOTPAGE
Lloh31:
	ldr	x9, [x9, _PCI_COMMAND_MEMORY@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	ldr	w8, [x21]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
LBB0_10:
	ldr	x21, [x20, #8]
	cbz	x21, LBB0_16
; %bb.11:
Lloh33:
	adrp	x22, _PCI_BRIDGE_CONTROL@GOTPAGE
Lloh34:
	ldr	x22, [x22, _PCI_BRIDGE_CONTROL@GOTPAGEOFF]
Lloh35:
	adrp	x23, _PCI_BRIDGE_CTL_VGA@GOTPAGE
Lloh36:
	ldr	x23, [x23, _PCI_BRIDGE_CTL_VGA@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x21, [x21]
	cbz	x21, LBB0_16
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21, #8]
	cbz	x0, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w1, [x22]
	add	x2, sp, #8
	bl	_pci_read_config_word
	ldr	w8, [sp, #8]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_12
; %bb.15:
	str	wzr, [x19, #4]
LBB0_16:
Lloh37:
	adrp	x21, _vga_default@GOTPAGE
Lloh38:
	ldr	x21, [x21, _vga_default@GOTPAGEOFF]
	ldr	x8, [x21]
	cbnz	x8, LBB0_19
; %bb.17:
	ldr	w8, [x19, #4]
Lloh39:
	adrp	x9, _VGA_RSRC_LEGACY_MASK@GOTPAGE
Lloh40:
	ldr	x9, [x9, _VGA_RSRC_LEGACY_MASK@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	bics	wzr, w9, w8
	b.ne	LBB0_19
; %bb.18:
	mov	x0, x20
	bl	_pci_dev_get
	str	x0, [x21]
LBB0_19:
	mov	x0, x19
	bl	_vga_arbiter_check_bridge_sharing
	add	x0, x19, #12
Lloh42:
	adrp	x1, _vga_list@GOTPAGE
Lloh43:
	ldr	x1, [x1, _vga_list@GOTPAGEOFF]
	bl	_list_add
Lloh44:
	adrp	x8, _vga_count@GOTPAGE
Lloh45:
	ldr	x8, [x8, _vga_count@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	mov	x0, x20
	bl	_pci_name
	mov	x20, x0
	ldr	w0, [x19]
	bl	_vga_iostate_to_str
	mov	x21, x0
	ldr	w0, [x19, #4]
	bl	_vga_iostate_to_str
	mov	x22, x0
	ldr	w0, [x19, #8]
	bl	_vga_iostate_to_str
	mov	x4, x0
Lloh46:
	adrp	x0, l_.str.1@PAGE
Lloh47:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	mov	x3, x22
	bl	_pr_info
Lloh48:
	adrp	x0, _vga_lock@GOTPAGE
Lloh49:
	ldr	x0, [x0, _vga_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	w0, #1
LBB0_20:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_CLASS_DISPLAY_VGA,4,2      ; @PCI_CLASS_DISPLAY_VGA
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vgaarb: failed to allocate pci device\n"

	.comm	_vga_lock,4,2                   ; @vga_lock
	.comm	_VGA_RSRC_LEGACY_IO,4,2         ; @VGA_RSRC_LEGACY_IO
	.comm	_VGA_RSRC_LEGACY_MEM,4,2        ; @VGA_RSRC_LEGACY_MEM
	.comm	_VGA_RSRC_NORMAL_IO,4,2         ; @VGA_RSRC_NORMAL_IO
	.comm	_VGA_RSRC_NORMAL_MEM,4,2        ; @VGA_RSRC_NORMAL_MEM
	.comm	_vga_decode_count,4,2           ; @vga_decode_count
	.comm	_PCI_COMMAND,4,2                ; @PCI_COMMAND
	.comm	_PCI_COMMAND_IO,4,2             ; @PCI_COMMAND_IO
	.comm	_PCI_COMMAND_MEMORY,4,2         ; @PCI_COMMAND_MEMORY
	.comm	_PCI_BRIDGE_CONTROL,4,2         ; @PCI_BRIDGE_CONTROL
	.comm	_PCI_BRIDGE_CTL_VGA,4,2         ; @PCI_BRIDGE_CTL_VGA
	.comm	_vga_default,8,3                ; @vga_default
	.comm	_VGA_RSRC_LEGACY_MASK,4,2       ; @VGA_RSRC_LEGACY_MASK
	.comm	_vga_list,4,2                   ; @vga_list
	.comm	_vga_count,4,2                  ; @vga_count
l_.str.1:                               ; @.str.1
	.asciz	"vgaarb: device added: PCI:%s,decodes=%s,owns=%s,locks=%s\n"

	.no_dead_strip	_vga_arbiter_add_pci_device
.subsections_via_symbols
