	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbridge_get_onedevice
_sbridge_get_onedevice:                 ## @sbridge_get_onedevice
	.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	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %r12
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r14d
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	shlq	$5, %r14
	leaq	(%r12,%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	(%r12,%r14), %rbx
	addq	$8, %rbx
	movq	(%r12,%r14), %rdx
	movq	8(%r12,%r14), %rcx
	movq	_PCI_VENDOR_ID_INTEL@GOTPCREL(%rip), %r13
	movslq	(%r13), %r8
	movslq	16(%r12,%r14), %r9
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_sbridge_printk
	movl	(%r13), %edi
	movl	16(%r12,%r14), %esi
	movq	(%r15), %rdx
	callq	_pci_get_device
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r13
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r14
	movq	8(%rax), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_get_sbridge_dev
	testq	%rax, %rax
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jne	LBB0_4
## %bb.2:
	movl	%ebx, %edi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_alloc_sbridge_dev
	testq	%rax, %rax
	je	LBB0_16
## %bb.3:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	incl	(%rcx)
LBB0_4:
	movslq	%ebx, %r15
	movq	(%rax), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_9
## %bb.5:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r12), %rcx
	movq	(%r14), %r8
	movq	_PCI_VENDOR_ID_INTEL@GOTPCREL(%rip), %rax
	movslq	(%rax), %r9
	movl	8(%r14), %r10d
	subq	$8, %rsp
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdx
	xorl	%eax, %eax
	pushq	%r10
	callq	_sbridge_printk
	addq	$16, %rsp
	movq	%r13, %rdi
	callq	_pci_dev_put
	jmp	LBB0_20
LBB0_6:
	movq	_KERN_INFO@GOTPCREL(%rip), %rdx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpq	$0, (%r15)
	je	LBB0_13
## %bb.7:
	movq	$0, (%r15)
LBB0_8:
	xorl	%ebx, %ebx
	jmp	LBB0_22
LBB0_9:
	movq	%r13, (%rax,%rcx,8)
	movl	(%r13), %edi
	callq	_PCI_SLOT
	movl	$1, %edi
	cmpq	(%r12), %rax
	movq	%r14, %rbx
	jne	LBB0_11
## %bb.10:
	movl	(%r13), %edi
	callq	_PCI_FUNC
	xorl	%edi, %edi
	cmpq	(%rbx), %rax
	setne	%dil
LBB0_11:
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_18
## %bb.12:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_PCI_VENDOR_ID_INTEL@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movslq	8(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%r13), %edi
	callq	_PCI_SLOT
	movq	%r13, %rcx
	movq	%rax, %r13
	movl	(%rcx), %edi
	callq	_PCI_FUNC
	movq	%rax, %r10
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %r11
	xorl	%ebx, %ebx
	movl	%r14d, %edi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%r15, %r8
	movq	%r13, %r9
	xorl	%eax, %eax
	pushq	(%r11)
	pushq	(%r12)
	pushq	%r15
	pushq	%r10
	callq	_sbridge_printk
	addq	$32, %rsp
	jmp	LBB0_20
LBB0_13:
	movq	%rbx, %rax
	xorl	%ebx, %ebx
	cmpq	$0, 24(%r12,%r14)
	jne	LBB0_22
## %bb.14:
	testl	%ecx, %ecx
	je	LBB0_24
## %bb.15:
	movl	(%rdx), %edi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rdx
	movq	(%rax), %rcx
	movq	_PCI_VENDOR_ID_INTEL@GOTPCREL(%rip), %rsi
	movslq	(%rsi), %r8
	movslq	8(%rax), %r9
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_sbridge_printk
	jmp	LBB0_20
LBB0_16:
	movq	%r13, %rdi
	callq	_pci_dev_put
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_17:
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_18:
	movq	%r13, %rdi
	callq	_pci_enable_device
	shrq	$63, %rax
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_23
## %bb.19:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r12), %rcx
	movq	(%rbx), %r8
	movq	_PCI_VENDOR_ID_INTEL@GOTPCREL(%rip), %rax
	movslq	(%rax), %r9
	movl	8(%rbx), %r10d
	subq	$8, %rsp
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdx
	xorl	%eax, %eax
	pushq	%r10
	callq	_sbridge_printk
	addq	$16, %rsp
LBB0_20:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_21:
	subl	(%rax), %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	(%r12), %rdx
	movq	(%rbx), %rcx
	movq	_PCI_VENDOR_ID_INTEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	8(%rbx), %r9d
	leaq	L_.str.5(%rip), %rdi
	movl	%r15d, %esi
	callq	_debugf0
	movq	%r13, %rdi
	callq	_pci_dev_get
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax)
	jmp	LBB0_8
LBB0_24:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Seeking for: dev %02x.%d PCI ID %04x:%04x\n"

	.comm	_PCI_VENDOR_ID_INTEL,4,2        ## @PCI_VENDOR_ID_INTEL
	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"Device not found: dev %02x.%d PCI ID %04x:%04x\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
L_.str.2:                               ## @.str.2
	.asciz	"Duplicated device for dev %02x:%d.%d PCI ID %04x:%04x\n"

L_.str.3:                               ## @.str.3
	.asciz	"Device PCI ID %04x:%04x has dev %02x:%d.%d instead of dev %02x:%02x.%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Couldn't enable dev %02x:%d.%d PCI ID %04x:%04x\n"

L_.str.5:                               ## @.str.5
	.asciz	"Detected dev %02x:%d.%d PCI ID %04x:%04x\n"

	.no_dead_strip	_sbridge_get_onedevice
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbridge_get_onedevice
_sbridge_get_onedevice:                 ; @sbridge_get_onedevice
	.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	x20, x3
	mov	x23, x2
	str	x1, [sp, #40]                   ; 8-byte Folded Spill
	mov	x19, x0
	ldr	x22, [x2]
	mov	w28, w3
Lloh0:
	adrp	x27, _KERN_INFO@GOTPAGE
Lloh1:
	ldr	x27, [x27, _KERN_INFO@GOTPAGEOFF]
	ldr	w0, [x27]
	add	x26, x22, x28, lsl #5
	ldr	x2, [x26]
	mov	x25, x26
	ldr	x3, [x25, #8]!
Lloh2:
	adrp	x21, _PCI_VENDOR_ID_INTEL@GOTPAGE
Lloh3:
	ldr	x21, [x21, _PCI_VENDOR_ID_INTEL@GOTPAGEOFF]
	ldrsw	x4, [x21]
	mov	x24, x26
	ldrsw	x5, [x24, #16]!
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_sbridge_printk
	ldr	w0, [x21]
	ldr	w1, [x24]
	ldr	x2, [x19]
	bl	_pci_get_device
	cbz	x0, LBB0_6
; %bb.1:
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	sxtw	x20, w0
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_get_sbridge_dev
	cbnz	x0, LBB0_4
; %bb.2:
	mov	x0, x20
	mov	x1, x23
	bl	_alloc_sbridge_dev
	cbz	x0, LBB0_16
; %bb.3:
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	w8, [x9]
	add	w8, w8, #1
	str	w8, [x9]
LBB0_4:
	ldr	x8, [x0]
	ldr	x9, [x8, x28, lsl #3]
	cbz	x9, LBB0_8
; %bb.5:
Lloh6:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	x3, [x26]
	ldr	x4, [x25]
Lloh9:
	adrp	x8, _PCI_VENDOR_ID_INTEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_VENDOR_ID_INTEL@GOTPAGEOFF]
Lloh11:
	ldrsw	x5, [x8]
	ldr	w8, [x24]
	str	x8, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_sbridge_printk
	mov	x0, x21
	bl	_pci_dev_put
	b	LBB0_20
LBB0_6:
	ldr	x8, [x19]
	cbz	x8, LBB0_11
; %bb.7:
	mov	w0, #0
	str	xzr, [x19]
	b	LBB0_22
LBB0_8:
	str	x21, [x8, x28, lsl #3]
	ldr	w0, [x21]
	bl	_PCI_SLOT
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.9:
	ldr	w0, [x21]
	bl	_PCI_FUNC
	ldr	x8, [x25]
	cmp	x0, x8
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_14
LBB0_10:
Lloh14:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh16:
	ldr	w19, [x8]
Lloh17:
	adrp	x8, _PCI_VENDOR_ID_INTEL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PCI_VENDOR_ID_INTEL@GOTPAGEOFF]
Lloh19:
	ldrsw	x22, [x8]
	ldrsw	x23, [x24]
	ldr	w0, [x21]
	bl	_PCI_SLOT
	mov	x24, x0
	ldr	w0, [x21]
	bl	_PCI_FUNC
	ldr	x8, [x26]
	ldr	x9, [x25]
	stp	x8, x9, [sp, #16]
	stp	x0, x20, [sp]
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	mov	x3, x23
	mov	x4, x20
	mov	x5, x24
	b	LBB0_19
LBB0_11:
	add	x8, x22, x28, lsl #5
	ldr	x8, [x8, #24]
	cbz	x8, LBB0_17
; %bb.12:
	mov	w0, #0
	b	LBB0_22
LBB0_13:
	mov	w0, #1
	bl	_unlikely
	cbnz	x0, LBB0_10
LBB0_14:
	mov	x0, x21
	bl	_pci_enable_device
	lsr	x0, x0, #63
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_unlikely
	cbz	x0, LBB0_23
; %bb.15:
Lloh22:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldr	x3, [x26]
	ldr	x4, [x25]
Lloh25:
	adrp	x8, _PCI_VENDOR_ID_INTEL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PCI_VENDOR_ID_INTEL@GOTPAGEOFF]
Lloh27:
	ldrsw	x5, [x8]
	ldr	w8, [x24]
	str	x8, [sp]
Lloh28:
	adrp	x1, l_.str.4@PAGE
Lloh29:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x20
	b	LBB0_19
LBB0_16:
	mov	x0, x21
	bl	_pci_dev_put
Lloh30:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_21
LBB0_17:
	cbz	w20, LBB0_20
; %bb.18:
	ldr	w0, [x27]
	ldr	x2, [x26]
	ldr	x3, [x25]
Lloh32:
	adrp	x8, _PCI_VENDOR_ID_INTEL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _PCI_VENDOR_ID_INTEL@GOTPAGEOFF]
Lloh34:
	ldrsw	x4, [x8]
	ldrsw	x5, [x24]
Lloh35:
	adrp	x1, l_.str.1@PAGE
Lloh36:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_19:
	bl	_sbridge_printk
LBB0_20:
Lloh37:
	adrp	x8, _ENODEV@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_22:
	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
	ret
LBB0_23:
	ldr	x2, [x26]
	ldr	x3, [x25]
Lloh39:
	adrp	x8, _PCI_VENDOR_ID_INTEL@GOTPAGE
Lloh40:
	ldr	x8, [x8, _PCI_VENDOR_ID_INTEL@GOTPAGEOFF]
Lloh41:
	ldr	w4, [x8]
	ldr	w5, [x24]
Lloh42:
	adrp	x0, l_.str.5@PAGE
Lloh43:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x20
	bl	_debugf0
	mov	x0, x21
	bl	_pci_dev_get
	mov	w0, #0
	str	x21, [x19]
	b	LBB0_22
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Seeking for: dev %02x.%d PCI ID %04x:%04x\n"

	.comm	_PCI_VENDOR_ID_INTEL,4,2        ; @PCI_VENDOR_ID_INTEL
	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"Device not found: dev %02x.%d PCI ID %04x:%04x\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
l_.str.2:                               ; @.str.2
	.asciz	"Duplicated device for dev %02x:%d.%d PCI ID %04x:%04x\n"

l_.str.3:                               ; @.str.3
	.asciz	"Device PCI ID %04x:%04x has dev %02x:%d.%d instead of dev %02x:%02x.%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Couldn't enable dev %02x:%d.%d PCI ID %04x:%04x\n"

l_.str.5:                               ; @.str.5
	.asciz	"Detected dev %02x:%d.%d PCI ID %04x:%04x\n"

	.no_dead_strip	_sbridge_get_onedevice
.subsections_via_symbols
