	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mgsl_enum_isa_devices
_mgsl_enum_isa_devices:                 ## @mgsl_enum_isa_devices
	.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	_MAX_ISA_DEVICES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_11
## %bb.1:
	movq	_io@GOTPCREL(%rip), %r13
	movq	_irq@GOTPCREL(%rip), %r14
	movq	_debug_level@GOTPCREL(%rip), %r15
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_mgsl_allocate_device
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rbx
	movq	(%r13), %rax
	movl	(%rax,%r12,8), %eax
	movl	%eax, (%rbx)
	movq	(%r14), %rax
	movl	(%rax,%r12,8), %edi
	movl	%edi, 4(%rbx)
	callq	_irq_canonicalize
	movl	%eax, 4(%rbx)
	movq	_dma@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r12,8), %eax
	movl	%eax, 8(%rbx)
	movq	_MGSL_BUS_TYPE_ISA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movl	$16, 12(%rbx)
	movq	$0, 16(%rbx)
	movq	%rbx, %rdi
	callq	_mgsl_add_device
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r12
	movq	_MAX_ISA_DEVICES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r12
	jge	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	(%rax,%r12,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r14), %rax
	movq	(%rax,%r12,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rax
	movq	_DEBUG_LEVEL_INFO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_dma@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r12,8), %rcx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rax
	movq	_DEBUG_LEVEL_ERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_10
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_ISA_DEVICES,4,2            ## @MAX_ISA_DEVICES
	.comm	_io,8,3                         ## @io
	.comm	_irq,8,3                        ## @irq
	.comm	_debug_level,8,3                ## @debug_level
	.comm	_DEBUG_LEVEL_INFO,8,3           ## @DEBUG_LEVEL_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ISA device specified io=%04X,irq=%d,dma=%d\n"

	.comm	_dma,8,3                        ## @dma
	.comm	_DEBUG_LEVEL_ERROR,8,3          ## @DEBUG_LEVEL_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"can't allocate device instance data.\n"

	.comm	_MGSL_BUS_TYPE_ISA,4,2          ## @MGSL_BUS_TYPE_ISA
	.no_dead_strip	_mgsl_enum_isa_devices
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mgsl_enum_isa_devices
_mgsl_enum_isa_devices:                 ; @mgsl_enum_isa_devices
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
Lloh0:
	adrp	x22, _MAX_ISA_DEVICES@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MAX_ISA_DEVICES@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x23, #0
Lloh2:
	adrp	x24, _io@GOTPAGE
Lloh3:
	ldr	x24, [x24, _io@GOTPAGEOFF]
Lloh4:
	adrp	x25, _irq@GOTPAGE
Lloh5:
	ldr	x25, [x25, _irq@GOTPAGEOFF]
Lloh6:
	adrp	x26, _debug_level@GOTPAGE
Lloh7:
	ldr	x26, [x26, _debug_level@GOTPAGEOFF]
Lloh8:
	adrp	x27, _DEBUG_LEVEL_INFO@GOTPAGE
Lloh9:
	ldr	x27, [x27, _DEBUG_LEVEL_INFO@GOTPAGEOFF]
Lloh10:
	adrp	x19, _dma@GOTPAGE
Lloh11:
	ldr	x19, [x19, _dma@GOTPAGEOFF]
Lloh12:
	adrp	x20, _MGSL_BUS_TYPE_ISA@GOTPAGE
Lloh13:
	ldr	x20, [x20, _MGSL_BUS_TYPE_ISA@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_mgsl_allocate_device
	cbz	x0, LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x0
	ldr	x8, [x24]
	lsl	x28, x23, #3
	ldr	x8, [x8, x28]
	ldr	x9, [x25]
	ldr	w0, [x9, x28]
	stp	w8, w0, [x21]
	bl	_irq_canonicalize
	ldr	x8, [x19]
	ldr	x8, [x8, x28]
	stp	w0, w8, [x21, #4]
	ldr	w8, [x20]
	str	w8, [x21, #24]
	mov	w8, #16
	str	w8, [x21, #12]
	str	xzr, [x21, #16]
	mov	x0, x21
	bl	_mgsl_add_device
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.ge	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	ldr	x8, [x8, x23, lsl #3]
	cbz	x8, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x25]
	ldr	x9, [x9, x23, lsl #3]
	cbz	x9, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x10, [x26]
	ldr	x11, [x27]
	cmp	x10, x11
	b.lt	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x10, [x19]
	ldr	x10, [x10, x23, lsl #3]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
	b	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x26]
Lloh16:
	adrp	x9, _DEBUG_LEVEL_ERROR@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DEBUG_LEVEL_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
	b	LBB0_4
LBB0_11:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_ISA_DEVICES,4,2            ; @MAX_ISA_DEVICES
	.comm	_io,8,3                         ; @io
	.comm	_irq,8,3                        ; @irq
	.comm	_debug_level,8,3                ; @debug_level
	.comm	_DEBUG_LEVEL_INFO,8,3           ; @DEBUG_LEVEL_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ISA device specified io=%04X,irq=%d,dma=%d\n"

	.comm	_dma,8,3                        ; @dma
	.comm	_DEBUG_LEVEL_ERROR,8,3          ; @DEBUG_LEVEL_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"can't allocate device instance data.\n"

	.comm	_MGSL_BUS_TYPE_ISA,4,2          ; @MGSL_BUS_TYPE_ISA
	.no_dead_strip	_mgsl_enum_isa_devices
.subsections_via_symbols
