	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_setup                      ## -- Begin function pci_setup
	.p2align	4, 0x90
_pci_setup:                             ## @pci_setup
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	%edi, -52(%rbp)                 ## 4-byte Spill
	movq	_pci1_desc@GOTPCREL(%rip), %rax
	movl	$2147486968, %ecx               ## imm = 0x80000CF8
	movq	%rcx, (%rax)
	leaq	L_str(%rip), %rdi
	callq	_puts
	xorl	%r13d, %r13d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	incl	%r13d
	cmpl	$32, %r13d
	je	LBB0_7
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	movq	_PCI_HEADER_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	movl	$1, %r9d
	callq	_pci_read
	movq	%rax, %r14
	movq	_PCI_VENDORID@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	movl	$2, %r9d
	callq	_pci_read
	movq	%rax, %r15
	movq	_PCI_DEVICEID@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	movl	$2, %r9d
	callq	_pci_read
	leal	1(%r15), %ecx
	cmpw	$2, %cx
	jb	LBB0_6
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movzwl	%r15w, %ecx
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	testb	$-128, %r14b
	movl	$8, %r12d
	movl	$1, %ecx
	cmovel	%ecx, %r12d
	movzwl	%ax, %r14d
	xorl	%r15d, %r15d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=2
	incl	%r15d
	cmpl	%r15d, %r12d
	je	LBB0_6
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_PCI_BASECLASS@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	movl	%r13d, %edx
	movl	%r15d, %ecx
	movl	$1, %r9d
	callq	_pci_read
	movzwl	%ax, %ebx
	leaq	L_.str.1(%rip), %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movl	%r14d, %r8d
	movl	%ebx, %r9d
	xorl	%eax, %eax
	callq	_printf
	cmpl	$3, %ebx
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	leaq	L_str.6(%rip), %rdi
	callq	_puts
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	_vga1_desc@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	movl	%r13d, %r8d
	movl	%r15d, %r9d
	callq	_vga_setup
	leaq	L_str.7(%rip), %rdi
	callq	_puts
	jmp	LBB0_5
LBB0_7:
	leaq	L_str.5(%rip), %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_puts                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_pci1_desc,8,3                  ## @pci1_desc
	.comm	_PCI_HEADER_TYPE,4,2            ## @PCI_HEADER_TYPE
	.comm	_PCI_VENDORID,4,2               ## @PCI_VENDORID
	.comm	_PCI_DEVICEID,4,2               ## @PCI_DEVICEID
	.comm	_PCI_BASECLASS,4,2              ## @PCI_BASECLASS
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	" %d:%d -> vendor:device:class %x:%x:%x\n"

	.comm	_vga1_desc,4,2                  ## @vga1_desc
L_str:                                  ## @str
	.asciz	"PCI Bus:"

L_str.5:                                ## @str.5
	.asciz	"^-- end PCI"

L_str.6:                                ## @str.6
	.asciz	"Setting up vga..."

L_str.7:                                ## @str.7
	.asciz	"Done with vga"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_setup                      ; -- Begin function pci_setup
	.p2align	2
_pci_setup:                             ; @pci_setup
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _pci1_desc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pci1_desc@GOTPAGEOFF]
	mov	w9, #3320
	movk	w9, #32768, lsl #16
Lloh2:
	str	x9, [x8]
Lloh3:
	adrp	x0, l_str@PAGE
Lloh4:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w21, #0
Lloh5:
	adrp	x28, _PCI_BASECLASS@GOTPAGE
Lloh6:
	ldr	x28, [x28, _PCI_BASECLASS@GOTPAGEOFF]
Lloh7:
	adrp	x22, l_.str.1@PAGE
Lloh8:
	add	x22, x22, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	w21, w21, #1
	cmp	w21, #32
	b.eq	LBB0_7
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
Lloh9:
	adrp	x8, _PCI_HEADER_TYPE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_HEADER_TYPE@GOTPAGEOFF]
Lloh11:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	mov	w3, #0
	mov	w5, #1
	bl	_pci_read
	mov	x27, x0
Lloh12:
	adrp	x8, _PCI_VENDORID@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PCI_VENDORID@GOTPAGEOFF]
Lloh14:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	mov	w3, #0
	mov	w5, #2
	bl	_pci_read
	mov	x26, x0
Lloh15:
	adrp	x8, _PCI_DEVICEID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PCI_DEVICEID@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	mov	w3, #0
	mov	w5, #2
	bl	_pci_read
	and	w23, w26, #0xffff
	cmp	w23, #0
	mov	w8, #65535
	ccmp	w23, w8, #4, ne
	b.eq	LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w26, #0
	tst	x27, #0x80
	mov	w8, #8
	csinc	w27, w8, wzr, ne
	and	w24, w0, #0xffff
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	w26, w26, #1
	cmp	w27, w26
	b.eq	LBB0_1
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w4, [x28]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	mov	x3, x26
	mov	w5, #1
	bl	_pci_read
	and	w25, w0, #0xffff
	stp	x23, x24, [sp, #16]
	stp	xzr, x21, [sp]
	str	x25, [sp, #32]
	mov	x0, x22
	bl	_printf
	cmp	w25, #3
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
Lloh18:
	adrp	x0, l_str.6@PAGE
Lloh19:
	add	x0, x0, l_str.6@PAGEOFF
	bl	_puts
	mov	x0, x20
	mov	x1, x19
Lloh20:
	adrp	x2, _vga1_desc@GOTPAGE
Lloh21:
	ldr	x2, [x2, _vga1_desc@GOTPAGEOFF]
	mov	w3, #0
	mov	x4, x21
	mov	x5, x26
	bl	_vga_setup
Lloh22:
	adrp	x0, l_str.7@PAGE
Lloh23:
	add	x0, x0, l_str.7@PAGEOFF
	bl	_puts
	b	LBB0_4
LBB0_7:
Lloh24:
	adrp	x0, l_str.5@PAGE
Lloh25:
	add	x0, x0, l_str.5@PAGEOFF
	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
	b	_puts
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_pci1_desc,8,3                  ; @pci1_desc
	.comm	_PCI_HEADER_TYPE,4,2            ; @PCI_HEADER_TYPE
	.comm	_PCI_VENDORID,4,2               ; @PCI_VENDORID
	.comm	_PCI_DEVICEID,4,2               ; @PCI_DEVICEID
	.comm	_PCI_BASECLASS,4,2              ; @PCI_BASECLASS
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	" %d:%d -> vendor:device:class %x:%x:%x\n"

	.comm	_vga1_desc,4,2                  ; @vga1_desc
l_str:                                  ; @str
	.asciz	"PCI Bus:"

l_str.5:                                ; @str.5
	.asciz	"^-- end PCI"

l_str.6:                                ; @str.6
	.asciz	"Setting up vga..."

l_str.7:                                ; @str.7
	.asciz	"Done with vga"

.subsections_via_symbols
