	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gic_config
_gic_config:                            ## @gic_config
	.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	_GIC_FIRST_SPI@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_1
## %bb.12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%ecx, %r13d
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_mtx_lock_spin
	movl	%r15d, %edi
	callq	_GICD_ICFGR
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_gic_d_read_4
	leal	15(%r15), %edx
	testl	%r15d, %r15d
	cmovnsl	%r15d, %edx
	andl	$2147483632, %edx               ## imm = 0x7FFFFFF0
	movl	%r15d, %ecx
	subl	%edx, %ecx
	addl	%ecx, %ecx
	movl	%eax, %ebx
	sarl	%cl, %ebx
	andl	$3, %ebx
	movq	_INTR_POLARITY_LOW@GOTPCREL(%rip), %rdx
	cmpl	%r13d, (%rdx)
	jne	LBB0_3
## %bb.2:
	movq	_GICD_ICFGR_POL_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %ebx
	movq	_GICD_ICFGR_POL_LOW@GOTPCREL(%rip), %rdx
	jmp	LBB0_5
LBB0_3:
	movq	_INTR_POLARITY_HIGH@GOTPCREL(%rip), %rdx
	cmpl	%r13d, (%rdx)
	jne	LBB0_6
## %bb.4:
	movq	_GICD_ICFGR_POL_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %ebx
	movq	_GICD_ICFGR_POL_HIGH@GOTPCREL(%rip), %rdx
LBB0_5:
	orl	(%rdx), %ebx
LBB0_6:
	movq	_INTR_TRIGGER_LEVEL@GOTPCREL(%rip), %rdx
	cmpl	%r12d, (%rdx)
	jne	LBB0_8
## %bb.7:
	movq	_GICD_ICFGR_TRIG_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %ebx
	movq	_GICD_ICFGR_TRIG_LVL@GOTPCREL(%rip), %rdx
	jmp	LBB0_10
LBB0_8:
	movq	_INTR_TRIGGER_EDGE@GOTPCREL(%rip), %rdx
	cmpl	%r12d, (%rdx)
	jne	LBB0_11
## %bb.9:
	movq	_GICD_ICFGR_TRIG_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %ebx
	movq	_GICD_ICFGR_TRIG_EDGE@GOTPCREL(%rip), %rdx
LBB0_10:
	orl	(%rdx), %ebx
LBB0_11:
	movl	$3, %edx
	shll	%cl, %edx
	notl	%edx
	andl	%edx, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	orl	%eax, %ebx
	movl	%r15d, %edi
	callq	_GICD_ICFGR
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_gic_d_write_4
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtx_unlock_spin                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GIC_FIRST_SPI,4,2              ## @GIC_FIRST_SPI
	.comm	_INTR_POLARITY_LOW,4,2          ## @INTR_POLARITY_LOW
	.comm	_GICD_ICFGR_POL_MASK,4,2        ## @GICD_ICFGR_POL_MASK
	.comm	_GICD_ICFGR_POL_LOW,4,2         ## @GICD_ICFGR_POL_LOW
	.comm	_INTR_POLARITY_HIGH,4,2         ## @INTR_POLARITY_HIGH
	.comm	_GICD_ICFGR_POL_HIGH,4,2        ## @GICD_ICFGR_POL_HIGH
	.comm	_INTR_TRIGGER_LEVEL,4,2         ## @INTR_TRIGGER_LEVEL
	.comm	_GICD_ICFGR_TRIG_MASK,4,2       ## @GICD_ICFGR_TRIG_MASK
	.comm	_GICD_ICFGR_TRIG_LVL,4,2        ## @GICD_ICFGR_TRIG_LVL
	.comm	_INTR_TRIGGER_EDGE,4,2          ## @INTR_TRIGGER_EDGE
	.comm	_GICD_ICFGR_TRIG_EDGE,4,2       ## @GICD_ICFGR_TRIG_EDGE
	.no_dead_strip	_gic_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gic_config
_gic_config:                            ; @gic_config
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _GIC_FIRST_SPI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GIC_FIRST_SPI@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x22, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	bl	_mtx_lock_spin
	mov	x0, x20
	bl	_GICD_ICFGR
	mov	x1, x0
	mov	x0, x19
	bl	_gic_d_read_4
	negs	w8, w20
	and	w8, w8, #0xf
	and	w9, w20, #0xf
	csneg	w8, w9, w8, mi
	lsl	w8, w8, #1
	asr	w9, w0, w8
	and	w9, w9, #0x3
Lloh3:
	adrp	x10, _INTR_POLARITY_LOW@GOTPAGE
Lloh4:
	ldr	x10, [x10, _INTR_POLARITY_LOW@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w10, w22
	b.ne	LBB0_4
; %bb.3:
Lloh6:
	adrp	x10, _GICD_ICFGR_POL_MASK@GOTPAGE
Lloh7:
	ldr	x10, [x10, _GICD_ICFGR_POL_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	bic	w9, w9, w10
Lloh9:
	adrp	x10, _GICD_ICFGR_POL_LOW@GOTPAGE
Lloh10:
	ldr	x10, [x10, _GICD_ICFGR_POL_LOW@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh11:
	adrp	x10, _INTR_POLARITY_HIGH@GOTPAGE
Lloh12:
	ldr	x10, [x10, _INTR_POLARITY_HIGH@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	cmp	w10, w22
	b.ne	LBB0_7
; %bb.5:
Lloh14:
	adrp	x10, _GICD_ICFGR_POL_MASK@GOTPAGE
Lloh15:
	ldr	x10, [x10, _GICD_ICFGR_POL_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	bic	w9, w9, w10
Lloh17:
	adrp	x10, _GICD_ICFGR_POL_HIGH@GOTPAGE
Lloh18:
	ldr	x10, [x10, _GICD_ICFGR_POL_HIGH@GOTPAGEOFF]
LBB0_6:
	ldr	w10, [x10]
	orr	w9, w9, w10
LBB0_7:
Lloh19:
	adrp	x10, _INTR_TRIGGER_LEVEL@GOTPAGE
Lloh20:
	ldr	x10, [x10, _INTR_TRIGGER_LEVEL@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	cmp	w10, w21
	b.ne	LBB0_9
; %bb.8:
Lloh22:
	adrp	x10, _GICD_ICFGR_TRIG_MASK@GOTPAGE
Lloh23:
	ldr	x10, [x10, _GICD_ICFGR_TRIG_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	bic	w9, w9, w10
Lloh25:
	adrp	x10, _GICD_ICFGR_TRIG_LVL@GOTPAGE
Lloh26:
	ldr	x10, [x10, _GICD_ICFGR_TRIG_LVL@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh27:
	adrp	x10, _INTR_TRIGGER_EDGE@GOTPAGE
Lloh28:
	ldr	x10, [x10, _INTR_TRIGGER_EDGE@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	cmp	w10, w21
	b.ne	LBB0_12
; %bb.10:
Lloh30:
	adrp	x10, _GICD_ICFGR_TRIG_MASK@GOTPAGE
Lloh31:
	ldr	x10, [x10, _GICD_ICFGR_TRIG_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x10]
	bic	w9, w9, w10
Lloh33:
	adrp	x10, _GICD_ICFGR_TRIG_EDGE@GOTPAGE
Lloh34:
	ldr	x10, [x10, _GICD_ICFGR_TRIG_EDGE@GOTPAGEOFF]
LBB0_11:
	ldr	w10, [x10]
	orr	w9, w9, w10
LBB0_12:
	mov	w10, #3
	lsl	w10, w10, w8
	bic	w10, w0, w10
	lsl	w8, w9, w8
	orr	w21, w8, w10
	mov	x0, x20
	bl	_GICD_ICFGR
	mov	x1, x0
	mov	x0, x19
	mov	x2, x21
	bl	_gic_d_write_4
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mtx_unlock_spin
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_GIC_FIRST_SPI,4,2              ; @GIC_FIRST_SPI
	.comm	_INTR_POLARITY_LOW,4,2          ; @INTR_POLARITY_LOW
	.comm	_GICD_ICFGR_POL_MASK,4,2        ; @GICD_ICFGR_POL_MASK
	.comm	_GICD_ICFGR_POL_LOW,4,2         ; @GICD_ICFGR_POL_LOW
	.comm	_INTR_POLARITY_HIGH,4,2         ; @INTR_POLARITY_HIGH
	.comm	_GICD_ICFGR_POL_HIGH,4,2        ; @GICD_ICFGR_POL_HIGH
	.comm	_INTR_TRIGGER_LEVEL,4,2         ; @INTR_TRIGGER_LEVEL
	.comm	_GICD_ICFGR_TRIG_MASK,4,2       ; @GICD_ICFGR_TRIG_MASK
	.comm	_GICD_ICFGR_TRIG_LVL,4,2        ; @GICD_ICFGR_TRIG_LVL
	.comm	_INTR_TRIGGER_EDGE,4,2          ; @INTR_TRIGGER_EDGE
	.comm	_GICD_ICFGR_TRIG_EDGE,4,2       ; @GICD_ICFGR_TRIG_EDGE
	.no_dead_strip	_gic_config
.subsections_via_symbols
