	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fb_is_primary_device           ## -- Begin function fb_is_primary_device
	.p2align	4, 0x90
_fb_is_primary_device:                  ## @fb_is_primary_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_vga_default_device
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.1:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_to_pci_dev
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	testq	%r14, %r14
	je	LBB0_4
## %bb.3:
	xorl	%r15d, %r15d
	cmpq	%r14, %rax
	sete	%r15b
	jmp	LBB0_7
LBB0_4:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_PCI_ROM_RESOURCE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_IORESOURCE_ROM_SHADOW@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	$1, %r15d
	testl	%edx, (%rax,%rcx,4)
	jne	LBB0_7
LBB0_6:
	xorl	%r15d, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_ROM_RESOURCE,8,3           ## @PCI_ROM_RESOURCE
	.comm	_IORESOURCE_ROM_SHADOW,4,2      ## @IORESOURCE_ROM_SHADOW
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fb_is_primary_device           ; -- Begin function fb_is_primary_device
	.p2align	2
_fb_is_primary_device:                  ; @fb_is_primary_device
	.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	x20, [x0]
	bl	_vga_default_device
	cbz	x20, LBB0_7
; %bb.1:
	mov	x19, x0
	mov	x0, x20
	bl	_to_pci_dev
	cbz	x0, LBB0_8
; %bb.2:
	cbz	x19, LBB0_4
; %bb.3:
	cmp	x0, x19
	cset	w0, eq
	b	LBB0_8
LBB0_4:
	ldr	x8, [x0]
	cbz	x8, LBB0_7
; %bb.5:
Lloh0:
	adrp	x9, _PCI_ROM_RESOURCE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_ROM_RESOURCE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
Lloh3:
	adrp	x9, _IORESOURCE_ROM_SHADOW@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IORESOURCE_ROM_SHADOW@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	w0, #1
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_ROM_RESOURCE,8,3           ; @PCI_ROM_RESOURCE
	.comm	_IORESOURCE_ROM_SHADOW,4,2      ; @IORESOURCE_ROM_SHADOW
.subsections_via_symbols
