	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gic_acpi_identify
_gic_acpi_identify:                     ## @gic_acpi_identify
	.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, %r14
	movq	_ACPI_SIG_MADT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_acpi_find_table
	testq	%rax, %rax
	je	LBB0_18
## %bb.1:
	movl	(%rbx), %esi
	movq	%rax, %rdi
	callq	_acpi_map_table
	testq	%rax, %rax
	je	LBB0_19
## %bb.2:
	movq	%rax, %r12
	leaq	-64(%rbp), %r15
	movq	%r15, %rdi
	movl	$24, %esi
	callq	_bzero
	movq	%r14, -48(%rbp)
	movq	$0, -64(%rbp)
	leaq	4(%r12), %rdi
	movslq	(%r12), %rsi
	addq	%r12, %rsi
	movq	_madt_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rcx
	callq	_acpi_walk_subtables
	movq	-64(%rbp), %rax
	movl	(%rax), %eax
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_17
## %bb.3:
	movq	_MAXCPU@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_12
## %bb.4:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%rcx, %rbx
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%r15
	movslq	%eax, %rcx
	cmpq	%rcx, %r15
	jge	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rcx
	movq	(%rcx,%r15,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rbx), %rdx
	cmpq	(%rcx), %rdx
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_device_printf
	movl	(%r13), %eax
	jmp	LBB0_10
LBB0_19:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_device_printf                  ## TAILCALL
LBB0_11:
	testq	%rbx, %rbx
	je	LBB0_12
## %bb.14:
	movq	_BUS_PASS_INTERRUPT@GOTPCREL(%rip), %rax
	movq	_BUS_PASS_ORDER_MIDDLE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%rax), %rsi
	leaq	L_.str.3(%rip), %rdx
	movq	%r14, %rdi
	movl	$-1, %ecx
	callq	_BUS_ADD_CHILD
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	movq	%rax, %r15
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	-64(%rbp), %rax
	movq	8(%rax), %r8
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	movl	$4096, %r9d                     ## imm = 0x1000
	callq	_BUS_SET_RESOURCE
	movl	(%r13), %edx
	movq	(%rbx), %r8
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	movl	$4096, %r9d                     ## imm = 0x1000
	callq	_BUS_SET_RESOURCE
	movq	-64(%rbp), %rax
	movslq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_acpi_set_private
	jmp	LBB0_17
LBB0_12:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_13
LBB0_15:
	leaq	L_.str.4(%rip), %rsi
LBB0_13:
	movq	%r14, %rdi
	callq	_device_printf
LBB0_17:
	movq	%r12, %rdi
	callq	_acpi_unmap_table
LBB0_18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ACPI_SIG_MADT,4,2              ## @ACPI_SIG_MADT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gic: Unable to map the MADT\n"

	.comm	_madt_handler,4,2               ## @madt_handler
	.comm	_MAXCPU,4,2                     ## @MAXCPU
L_.str.1:                               ## @.str.1
	.asciz	"gic: Not all CPU interfaces at the same address, this may fail\n"

L_.str.2:                               ## @.str.2
	.asciz	"gic: No CPU interfaces found\n"

	.comm	_BUS_PASS_INTERRUPT,8,3         ## @BUS_PASS_INTERRUPT
	.comm	_BUS_PASS_ORDER_MIDDLE,8,3      ## @BUS_PASS_ORDER_MIDDLE
L_.str.3:                               ## @.str.3
	.asciz	"gic"

L_.str.4:                               ## @.str.4
	.asciz	"add gic child failed\n"

	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.no_dead_strip	_gic_acpi_identify
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gic_acpi_identify
_gic_acpi_identify:                     ; @gic_acpi_identify
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
Lloh0:
	adrp	x19, _ACPI_SIG_MADT@GOTPAGE
Lloh1:
	ldr	x19, [x19, _ACPI_SIG_MADT@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_acpi_find_table
	cbz	x0, LBB0_19
; %bb.1:
	ldr	w1, [x19]
	bl	_acpi_map_table
	cbz	x0, LBB0_11
; %bb.2:
	mov	x19, x0
	add	x0, sp, #8
	mov	w1, #24
	bl	_bzero
	str	x20, [sp, #24]
	str	xzr, [sp, #8]
	mov	x0, x19
	ldrsw	x8, [x0], #4
	add	x1, x19, x8
Lloh2:
	adrp	x8, _madt_handler@GOTPAGE
Lloh3:
	ldr	x8, [x8, _madt_handler@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	add	x3, sp, #8
	bl	_acpi_walk_subtables
	ldr	x8, [sp, #8]
	ldr	w8, [x8]
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_18
; %bb.3:
Lloh5:
	adrp	x23, _MAXCPU@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MAXCPU@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.4:
	mov	x24, #0
	mov	x22, #0
Lloh7:
	adrp	x21, l_.str.1@PAGE
Lloh8:
	add	x21, x21, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x22, x9
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x24, x24, #1
	cmp	x24, w8, sxtw
	b.ge	LBB0_12
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [sp, #16]
	ldr	x9, [x9, x24, lsl #3]
	cbz	x9, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	cbz	x22, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x10, [x22]
	ldr	x9, [x9]
	cmp	x10, x9
	b.eq	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_device_printf
	ldr	w8, [x23]
	b	LBB0_6
LBB0_11:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	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
	add	sp, sp, #96
	b	_device_printf
LBB0_12:
	cbz	x22, LBB0_15
; %bb.13:
Lloh11:
	adrp	x8, _BUS_PASS_INTERRUPT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BUS_PASS_INTERRUPT@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _BUS_PASS_ORDER_MIDDLE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BUS_PASS_ORDER_MIDDLE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x1, x9, x8
Lloh17:
	adrp	x2, l_.str.3@PAGE
Lloh18:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	w3, #-1
	bl	_BUS_ADD_CHILD
	cbz	x0, LBB0_16
; %bb.14:
	mov	x21, x0
Lloh19:
	adrp	x23, _SYS_RES_MEMORY@GOTPAGE
Lloh20:
	ldr	x23, [x23, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w2, [x23]
	ldr	x8, [sp, #8]
	ldr	x4, [x8, #8]
	mov	x0, x20
	mov	x1, x21
	mov	w3, #0
	mov	w5, #4096
	bl	_BUS_SET_RESOURCE
	ldr	w2, [x23]
	ldr	x4, [x22]
	mov	x0, x20
	mov	x1, x21
	mov	w3, #1
	mov	w5, #4096
	bl	_BUS_SET_RESOURCE
	ldr	x8, [sp, #8]
	ldrsw	x1, [x8]
	mov	x0, x21
	bl	_acpi_set_private
	b	LBB0_18
LBB0_15:
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_17:
	mov	x0, x20
	bl	_device_printf
LBB0_18:
	mov	x0, x19
	bl	_acpi_unmap_table
LBB0_19:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ACPI_SIG_MADT,4,2              ; @ACPI_SIG_MADT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gic: Unable to map the MADT\n"

	.comm	_madt_handler,4,2               ; @madt_handler
	.comm	_MAXCPU,4,2                     ; @MAXCPU
l_.str.1:                               ; @.str.1
	.asciz	"gic: Not all CPU interfaces at the same address, this may fail\n"

l_.str.2:                               ; @.str.2
	.asciz	"gic: No CPU interfaces found\n"

	.comm	_BUS_PASS_INTERRUPT,8,3         ; @BUS_PASS_INTERRUPT
	.comm	_BUS_PASS_ORDER_MIDDLE,8,3      ; @BUS_PASS_ORDER_MIDDLE
l_.str.3:                               ; @.str.3
	.asciz	"gic"

l_.str.4:                               ; @.str.4
	.asciz	"add gic child failed\n"

	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.no_dead_strip	_gic_acpi_identify
.subsections_via_symbols
