	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wbsd_scan
_wbsd_scan:                             ## @wbsd_scan
	.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
	movq	%rdi, %r15
	movq	_config_ports@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_15
## %bb.1:
	xorl	%r14d, %r14d
	movq	_DRIVER_NAME@GOTPCREL(%rip), %r12
	movq	_unlock_codes@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rax
	movl	(%rax,%r14,4), %edi
	movl	$2, %esi
	callq	_release_region
	movq	_DRIVER_NAME@GOTPCREL(%rip), %r12
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r14
	jge	LBB0_15
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##       Child Loop BB0_8 Depth 3
	movq	(%rbx), %rax
	movl	(%rax,%r14,4), %edi
	movl	(%r12), %edx
	movl	$2, %esi
	callq	_request_region
	testl	%eax, %eax
	je	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_13
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ecx, %ecx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=2
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	incq	%rbx
	movq	_unlock_codes@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	movq	%rbx, %rcx
	cltq
	cmpq	%rax, %rbx
	movq	%r12, %r15
	movq	_config_ports@GOTPCREL(%rip), %rbx
	jge	LBB0_13
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_8 Depth 3
	movq	(%rbx), %rax
	movl	(%rax,%r14,4), %eax
	movl	%eax, (%r15)
	movq	(%r13), %rax
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	(%rax,%rcx,4), %eax
	movl	%eax, 4(%r15)
	movq	%r15, %rdi
	callq	_wbsd_unlock_config
	movq	_WBSD_CONF_ID_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rax
	movl	(%rax,%r14,4), %esi
	callq	_outb
	movq	(%rbx), %rax
	movl	(%rax,%r14,4), %edi
	incl	%edi
	callq	_inb
	movl	%eax, %r12d
	shll	$8, %r12d
	movq	_WBSD_CONF_ID_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rax
	movl	(%rax,%r14,4), %esi
	callq	_outb
	movq	(%rbx), %rax
	movl	(%rax,%r14,4), %edi
	incl	%edi
	callq	_inb
	movl	%eax, %r13d
	orl	%r12d, %r13d
	movq	%r15, %r12
	movq	%r15, %rdi
	callq	_wbsd_lock_config
	movq	_valid_ids@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	(%r15), %rdi
	cmpl	(%rdi,%rbx,4), %r13d
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=3
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_8
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=2
	cmpl	$65535, %r13d                   ## imm = 0xFFFF
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	_config_ports@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %edx
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	callq	_DBG
	jmp	LBB0_12
LBB0_9:
	movl	%r13d, 8(%r12)
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_15:
	movq	$0, (%r15)
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_config_ports,8,3               ## @config_ports
	.comm	_DRIVER_NAME,4,2                ## @DRIVER_NAME
	.comm	_unlock_codes,8,3               ## @unlock_codes
	.comm	_WBSD_CONF_ID_HI,4,2            ## @WBSD_CONF_ID_HI
	.comm	_WBSD_CONF_ID_LO,4,2            ## @WBSD_CONF_ID_LO
	.comm	_valid_ids,8,3                  ## @valid_ids
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown hardware (id %x) found at %x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_wbsd_scan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wbsd_scan
_wbsd_scan:                             ; @wbsd_scan
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x0
Lloh0:
	adrp	x22, _config_ports@GOTPAGE
Lloh1:
	ldr	x22, [x22, _config_ports@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_15
; %bb.1:
	mov	x23, #0
Lloh2:
	adrp	x27, _DRIVER_NAME@GOTPAGE
Lloh3:
	ldr	x27, [x27, _DRIVER_NAME@GOTPAGEOFF]
Lloh4:
	adrp	x25, _unlock_codes@GOTPAGE
Lloh5:
	ldr	x25, [x25, _unlock_codes@GOTPAGEOFF]
Lloh6:
	adrp	x28, _WBSD_CONF_ID_LO@GOTPAGE
Lloh7:
	ldr	x28, [x28, _WBSD_CONF_ID_LO@GOTPAGEOFF]
Lloh8:
	adrp	x20, _valid_ids@GOTPAGE
Lloh9:
	ldr	x20, [x20, _valid_ids@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22]
	ldr	w0, [x8, x23, lsl #2]
	mov	w1, #2
	bl	_release_region
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	x23, w0, sxtw
	b.ge	LBB0_15
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;       Child Loop BB0_10 Depth 3
	ldr	x8, [x22]
	ldr	w0, [x8, x23, lsl #2]
	ldr	w2, [x27]
	mov	w1, #2
	bl	_request_region
	cbz	w0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x25]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x26, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	x26, x26, #1
	ldr	x0, [x25]
	bl	_ARRAY_SIZE
	cmp	x26, w0, sxtw
	b.ge	LBB0_2
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_10 Depth 3
	ldr	x8, [x22]
	lsl	x24, x23, #2
	ldr	w8, [x8, x24]
	str	w8, [x19]
	ldr	x8, [x25]
	ldr	w8, [x8, x26, lsl #2]
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_wbsd_unlock_config
Lloh10:
	adrp	x8, _WBSD_CONF_ID_HI@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WBSD_CONF_ID_HI@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	x8, [x22]
	ldr	w1, [x8, x24]
	bl	_outb
	ldr	x8, [x22]
	ldr	w8, [x8, x24]
	add	w0, w8, #1
	bl	_inb
	mov	x21, x0
	ldr	w0, [x28]
	ldr	x8, [x22]
	ldr	w1, [x8, x24]
	bl	_outb
	ldr	x8, [x22]
	ldr	w8, [x8, x24]
	add	w0, w8, #1
	bl	_inb
	orr	w21, w0, w21, lsl #8
	mov	x0, x19
	bl	_wbsd_lock_config
	ldr	x0, [x20]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	mov	x24, #0
LBB0_10:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_8 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x0, [x20]
	ldr	w8, [x0, x24, lsl #2]
	cmp	w21, w8
	b.eq	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=3
	add	x24, x24, #1
	bl	_ARRAY_SIZE
	cmp	x24, w0, sxtw
	b.lt	LBB0_10
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=2
	mov	w8, #65535
	cmp	w21, w8
	b.eq	LBB0_7
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=2
	ldr	x8, [x22]
	ldr	w2, [x8, x23, lsl #2]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_DBG
	b	LBB0_7
LBB0_14:
	mov	w0, #0
	str	w21, [x19, #8]
	b	LBB0_16
LBB0_15:
	str	xzr, [x19]
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_config_ports,8,3               ; @config_ports
	.comm	_DRIVER_NAME,4,2                ; @DRIVER_NAME
	.comm	_unlock_codes,8,3               ; @unlock_codes
	.comm	_WBSD_CONF_ID_HI,4,2            ; @WBSD_CONF_ID_HI
	.comm	_WBSD_CONF_ID_LO,4,2            ; @WBSD_CONF_ID_LO
	.comm	_valid_ids,8,3                  ; @valid_ids
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown hardware (id %x) found at %x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_wbsd_scan
.subsections_via_symbols
