	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_parse_slot                 ## -- Begin function pci_parse_slot
	.p2align	4, 0x90
_pci_parse_slot:                        ## @pci_parse_slot
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_strdup
	movq	%rax, %r14
	movq	%rax, %rdi
	movl	$44, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	%rax, %rbx
	movb	$0, (%rax)
	incq	%rbx
	movq	%rbx, %rdi
	movl	$44, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r15
	movb	$0, (%rax)
	incq	%r15
	jmp	LBB0_4
LBB0_2:
	xorl	%r15d, %r15d
LBB0_4:
	leaq	L_.str(%rip), %rsi
	leaq	-52(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-44(%rbp), %r8
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$3, %eax
	je	LBB0_8
## %bb.5:
	movl	$0, -52(%rbp)
	leaq	L_.str.1(%rip), %rsi
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$2, %eax
	je	LBB0_8
## %bb.6:
	movl	$0, -44(%rbp)
	leaq	L_.str.2(%rip), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$1, %eax
	je	LBB0_8
## %bb.7:
	movl	$-1, -48(%rbp)
LBB0_8:
	movl	-52(%rbp), %r13d
	testl	%r13d, %r13d
	js	LBB0_14
## %bb.9:
	movq	_MAXBUSES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jge	LBB0_14
## %bb.10:
	movl	-48(%rbp), %edx
	testl	%edx, %edx
	js	LBB0_14
## %bb.11:
	movq	_MAXSLOTS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jge	LBB0_14
## %bb.12:
	movl	-44(%rbp), %ecx
	testl	%ecx, %ecx
	js	LBB0_14
## %bb.13:
	movq	_MAXFUNCS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jge	LBB0_14
## %bb.15:
	movq	_pci_businfo@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movq	(%r12,%r13,8), %rax
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:
	movl	$1, %edi
	movl	$8, %esi
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	callq	_calloc
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, (%r12,%r13,8)
	movq	_pci_businfo@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r13,8), %rax
LBB0_17:
	movq	(%rax), %r12
	movq	(%r12,%rdx,8), %rax
	movq	%rcx, %rsi
	shlq	$4, %rsi
	cmpq	$0, (%rax,%rsi)
	je	LBB0_19
## %bb.18:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_21
LBB0_14:
	movq	%r12, %rdi
	callq	_pci_parse_slot_usage
LBB0_21:
	movq	%r14, %rdi
	callq	_free
	movl	$-1, %eax
LBB0_22:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	%rdx, %r13
	movq	%rbx, %rdi
	callq	_pci_emul_finddev
	testq	%rax, %rax
	je	LBB0_20
## %bb.23:
	movq	(%r12,%r13,8), %rax
	movslq	-44(%rbp), %rcx
	shlq	$4, %rcx
	movq	%rbx, (%rax,%rcx)
	movq	%r15, 8(%rax,%rcx)
	xorl	%eax, %eax
	jmp	LBB0_22
LBB0_20:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %r8
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d:%d:%d"

L_.str.1:                               ## @.str.1
	.asciz	"%d:%d"

L_.str.2:                               ## @.str.2
	.asciz	"%d"

	.comm	_MAXBUSES,4,2                   ## @MAXBUSES
	.comm	_MAXSLOTS,4,2                   ## @MAXSLOTS
	.comm	_MAXFUNCS,4,2                   ## @MAXFUNCS
	.comm	_pci_businfo,8,3                ## @pci_businfo
	.comm	_stderr,4,2                     ## @stderr
L_.str.3:                               ## @.str.3
	.asciz	"pci slot %d:%d already occupied!\n"

L_.str.4:                               ## @.str.4
	.asciz	"pci slot %d:%d: unknown device \"%s\"\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_parse_slot                 ; -- Begin function pci_parse_slot
	.p2align	2
_pci_parse_slot:                        ; @pci_parse_slot
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x22, x0
	bl	_strdup
	mov	x19, x0
	mov	w1, #44
	bl	_strchr
	cbz	x0, LBB0_18
; %bb.1:
	mov	x20, x0
	strb	wzr, [x20], #1
	mov	x0, x20
	mov	w1, #44
	bl	_strchr
	mov	x21, x0
	cbz	x0, LBB0_3
; %bb.2:
	strb	wzr, [x21], #1
LBB0_3:
	add	x23, sp, #20
	add	x8, sp, #24
	stp	x8, x23, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #28
	mov	x0, x19
	bl	_sscanf
	cmp	w0, #3
	b.eq	LBB0_7
; %bb.4:
	str	wzr, [sp, #28]
	str	x23, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #24
	mov	x0, x19
	bl	_sscanf
	cmp	w0, #2
	b.eq	LBB0_7
; %bb.5:
	str	wzr, [sp, #20]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #24
	mov	x0, x19
	bl	_sscanf
	cmp	w0, #1
	b.eq	LBB0_7
; %bb.6:
	mov	w8, #-1
	str	w8, [sp, #24]
LBB0_7:
	ldr	w25, [sp, #28]
	tbnz	w25, #31, LBB0_18
; %bb.8:
Lloh6:
	adrp	x8, _MAXBUSES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAXBUSES@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w25, w8
	b.ge	LBB0_18
; %bb.9:
	ldr	w23, [sp, #24]
	tbnz	w23, #31, LBB0_18
; %bb.10:
Lloh9:
	adrp	x8, _MAXSLOTS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAXSLOTS@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w23, w8
	b.ge	LBB0_18
; %bb.11:
	ldr	w24, [sp, #20]
	tbnz	w24, #31, LBB0_18
; %bb.12:
Lloh12:
	adrp	x8, _MAXFUNCS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAXFUNCS@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w24, w8
	b.ge	LBB0_18
; %bb.13:
Lloh15:
	adrp	x22, _pci_businfo@GOTPAGE
Lloh16:
	ldr	x22, [x22, _pci_businfo@GOTPAGEOFF]
	ldr	x26, [x22]
	ldr	x8, [x26, x25, lsl #3]
	cbnz	x8, LBB0_15
; %bb.14:
	mov	w0, #1
	mov	w1, #8
	bl	_calloc
	lsl	x8, x25, #3
	str	x0, [x26, x8]
	ldr	x9, [x22]
	ldr	x8, [x9, x8]
LBB0_15:
	ldr	x22, [x8]
	ldr	x8, [x22, x23, lsl #3]
	lsl	x9, x24, #4
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_21
; %bb.16:
Lloh17:
	adrp	x8, _stderr@GOTPAGE
Lloh18:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x23
	mov	x3, x24
LBB0_17:
	bl	_fprintf
	b	LBB0_19
LBB0_18:
	mov	x0, x22
	bl	_pci_parse_slot_usage
LBB0_19:
	mov	x0, x19
	bl	_free
	mov	w0, #-1
LBB0_20:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_21:
	mov	x0, x20
	bl	_pci_emul_finddev
	cbz	x0, LBB0_23
; %bb.22:
	mov	w0, #0
	ldr	x8, [x22, x23, lsl #3]
	ldrsw	x9, [sp, #20]
	add	x8, x8, x9, lsl #4
	stp	x20, x21, [x8]
	b	LBB0_20
LBB0_23:
Lloh22:
	adrp	x8, _stderr@GOTPAGE
Lloh23:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldp	w3, w2, [sp, #20]
	str	x20, [sp]
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d:%d:%d"

l_.str.1:                               ; @.str.1
	.asciz	"%d:%d"

l_.str.2:                               ; @.str.2
	.asciz	"%d"

	.comm	_MAXBUSES,4,2                   ; @MAXBUSES
	.comm	_MAXSLOTS,4,2                   ; @MAXSLOTS
	.comm	_MAXFUNCS,4,2                   ; @MAXFUNCS
	.comm	_pci_businfo,8,3                ; @pci_businfo
	.comm	_stderr,4,2                     ; @stderr
l_.str.3:                               ; @.str.3
	.asciz	"pci slot %d:%d already occupied!\n"

l_.str.4:                               ; @.str.4
	.asciz	"pci slot %d:%d: unknown device \"%s\"\n"

.subsections_via_symbols
