	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tonga_ih_irq_init
_tonga_ih_irq_init:                     ## @tonga_ih_irq_init
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_tonga_ih_disable_interrupts
	movq	_mmINTERRUPT_CNTL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %esi
	sarl	$8, %esi
	callq	_WREG32
	movq	_mmINTERRUPT_CNTL@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_RREG32
	movq	_INTERRUPT_CNTL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_IH_DUMMY_RD_OVERRIDE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	xorl	%ecx, %ecx
	callq	_REG_SET_FIELD
	movl	(%rbx), %esi
	movq	_IH_REQ_NONSNOOP_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	xorl	%ecx, %ecx
	callq	_REG_SET_FIELD
	movl	(%r15), %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	_mmIH_RB_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r14), %esi
	sarl	$8, %esi
	callq	_WREG32
	movl	12(%r14), %eax
	leal	3(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$2, %edi
	callq	_order_base_2
	movl	%eax, %ebx
	movq	_IH_RB_CNTL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_WPTR_OVERFLOW_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%edi, %edi
	movl	$1, %ecx
	callq	_REG_SET_FIELD
	movl	(%r15), %esi
	movq	_RB_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	%ebx, %ecx
	callq	_REG_SET_FIELD
	movl	(%r15), %esi
	movq	_WPTR_WRITEBACK_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$1, %ecx
	callq	_REG_SET_FIELD
	movl	(%r15), %esi
	movq	_MC_VMID@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	xorl	%ecx, %ecx
	callq	_REG_SET_FIELD
	cmpq	$0, 40(%r14)
	je	LBB0_2
## %bb.1:
	movl	(%r15), %esi
	movq	_RPTR_REARM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$1, %ecx
	callq	_REG_SET_FIELD
LBB0_2:
	movq	_mmIH_RB_CNTL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	_mmIH_RB_WPTR_ADDR_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	32(%r14), %edi
	callq	_lower_32_bits
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	_mmIH_RB_WPTR_ADDR_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	32(%r14), %edi
	callq	_upper_32_bits
	movzbl	%al, %esi
	movl	%ebx, %edi
	callq	_WREG32
	movq	_mmIH_RB_RPTR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	_mmIH_RB_WPTR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	_mmIH_DOORBELL_RPTR@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_RREG32
	cmpq	$0, 24(%r14)
	movq	_IH_DOORBELL_RPTR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	je	LBB0_4
## %bb.3:
	movq	_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	16(%r14), %ecx
	movl	%eax, %edi
	callq	_REG_SET_FIELD
	movl	(%rbx), %esi
	movq	_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$1, %ecx
	jmp	LBB0_5
LBB0_4:
	movq	_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	xorl	%ecx, %ecx
LBB0_5:
	callq	_REG_SET_FIELD
	movl	(%r15), %edi
	movl	%eax, %esi
	callq	_WREG32
	movl	4(%r14), %edi
	callq	_pci_set_master
	movq	%r14, %rdi
	callq	_tonga_ih_enable_interrupts
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mmINTERRUPT_CNTL2,4,2          ## @mmINTERRUPT_CNTL2
	.comm	_mmINTERRUPT_CNTL,4,2           ## @mmINTERRUPT_CNTL
	.comm	_INTERRUPT_CNTL,4,2             ## @INTERRUPT_CNTL
	.comm	_IH_DUMMY_RD_OVERRIDE,4,2       ## @IH_DUMMY_RD_OVERRIDE
	.comm	_IH_REQ_NONSNOOP_EN,4,2         ## @IH_REQ_NONSNOOP_EN
	.comm	_mmIH_RB_BASE,4,2               ## @mmIH_RB_BASE
	.comm	_IH_RB_CNTL,4,2                 ## @IH_RB_CNTL
	.comm	_WPTR_OVERFLOW_CLEAR,4,2        ## @WPTR_OVERFLOW_CLEAR
	.comm	_RB_SIZE,4,2                    ## @RB_SIZE
	.comm	_WPTR_WRITEBACK_ENABLE,4,2      ## @WPTR_WRITEBACK_ENABLE
	.comm	_MC_VMID,4,2                    ## @MC_VMID
	.comm	_RPTR_REARM,4,2                 ## @RPTR_REARM
	.comm	_mmIH_RB_CNTL,4,2               ## @mmIH_RB_CNTL
	.comm	_mmIH_RB_WPTR_ADDR_LO,4,2       ## @mmIH_RB_WPTR_ADDR_LO
	.comm	_mmIH_RB_WPTR_ADDR_HI,4,2       ## @mmIH_RB_WPTR_ADDR_HI
	.comm	_mmIH_RB_RPTR,4,2               ## @mmIH_RB_RPTR
	.comm	_mmIH_RB_WPTR,4,2               ## @mmIH_RB_WPTR
	.comm	_mmIH_DOORBELL_RPTR,4,2         ## @mmIH_DOORBELL_RPTR
	.comm	_IH_DOORBELL_RPTR,4,2           ## @IH_DOORBELL_RPTR
	.comm	_OFFSET,4,2                     ## @OFFSET
	.comm	_ENABLE,4,2                     ## @ENABLE
	.no_dead_strip	_tonga_ih_irq_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tonga_ih_irq_init
_tonga_ih_irq_init:                     ; @tonga_ih_irq_init
	.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
	mov	x19, x0
	bl	_tonga_ih_disable_interrupts
Lloh0:
	adrp	x8, _mmINTERRUPT_CNTL2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mmINTERRUPT_CNTL2@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w8, [x19]
	asr	w1, w8, #8
	bl	_WREG32
Lloh3:
	adrp	x20, _mmINTERRUPT_CNTL@GOTPAGE
Lloh4:
	ldr	x20, [x20, _mmINTERRUPT_CNTL@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_RREG32
Lloh5:
	adrp	x21, _INTERRUPT_CNTL@GOTPAGE
Lloh6:
	ldr	x21, [x21, _INTERRUPT_CNTL@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh7:
	adrp	x8, _IH_DUMMY_RD_OVERRIDE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IH_DUMMY_RD_OVERRIDE@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_REG_SET_FIELD
	ldr	w1, [x21]
Lloh10:
	adrp	x8, _IH_REQ_NONSNOOP_EN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IH_REQ_NONSNOOP_EN@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_REG_SET_FIELD
	mov	x1, x0
	ldr	w0, [x20]
	bl	_WREG32
Lloh13:
	adrp	x8, _mmIH_RB_BASE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _mmIH_RB_BASE@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldr	w8, [x19, #8]
	asr	w1, w8, #8
	bl	_WREG32
	ldr	w8, [x19, #12]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #2
	bl	_order_base_2
	mov	x20, x0
Lloh16:
	adrp	x21, _IH_RB_CNTL@GOTPAGE
Lloh17:
	ldr	x21, [x21, _IH_RB_CNTL@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh18:
	adrp	x8, _WPTR_OVERFLOW_CLEAR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WPTR_OVERFLOW_CLEAR@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	w0, #0
	mov	w3, #1
	bl	_REG_SET_FIELD
	ldr	w1, [x21]
Lloh21:
	adrp	x8, _RB_SIZE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RB_SIZE@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x3, x20
	bl	_REG_SET_FIELD
	ldr	w1, [x21]
Lloh24:
	adrp	x8, _WPTR_WRITEBACK_ENABLE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _WPTR_WRITEBACK_ENABLE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	w3, #1
	bl	_REG_SET_FIELD
	ldr	w1, [x21]
Lloh27:
	adrp	x8, _MC_VMID@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MC_VMID@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_REG_SET_FIELD
	mov	x3, x0
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w1, [x21]
Lloh30:
	adrp	x8, _RPTR_REARM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _RPTR_REARM@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	mov	x0, x3
	mov	w3, #1
	bl	_REG_SET_FIELD
	mov	x3, x0
LBB0_2:
Lloh33:
	adrp	x8, _mmIH_RB_CNTL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _mmIH_RB_CNTL@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	mov	x1, x3
	bl	_WREG32
Lloh36:
	adrp	x8, _mmIH_RB_WPTR_ADDR_LO@GOTPAGE
Lloh37:
	ldr	x8, [x8, _mmIH_RB_WPTR_ADDR_LO@GOTPAGEOFF]
Lloh38:
	ldr	w20, [x8]
	ldr	w0, [x19, #32]
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
Lloh39:
	adrp	x8, _mmIH_RB_WPTR_ADDR_HI@GOTPAGE
Lloh40:
	ldr	x8, [x8, _mmIH_RB_WPTR_ADDR_HI@GOTPAGEOFF]
Lloh41:
	ldr	w20, [x8]
	ldr	w0, [x19, #32]
	bl	_upper_32_bits
	and	w1, w0, #0xff
	mov	x0, x20
	bl	_WREG32
Lloh42:
	adrp	x8, _mmIH_RB_RPTR@GOTPAGE
Lloh43:
	ldr	x8, [x8, _mmIH_RB_RPTR@GOTPAGEOFF]
Lloh44:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG32
Lloh45:
	adrp	x8, _mmIH_RB_WPTR@GOTPAGE
Lloh46:
	ldr	x8, [x8, _mmIH_RB_WPTR@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG32
Lloh48:
	adrp	x20, _mmIH_DOORBELL_RPTR@GOTPAGE
Lloh49:
	ldr	x20, [x20, _mmIH_DOORBELL_RPTR@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_RREG32
	ldr	x8, [x19, #24]
Lloh50:
	adrp	x21, _IH_DOORBELL_RPTR@GOTPAGE
Lloh51:
	ldr	x21, [x21, _IH_DOORBELL_RPTR@GOTPAGEOFF]
	ldr	w1, [x21]
	cbz	x8, LBB0_4
; %bb.3:
Lloh52:
	adrp	x8, _OFFSET@GOTPAGE
Lloh53:
	ldr	x8, [x8, _OFFSET@GOTPAGEOFF]
Lloh54:
	ldr	w2, [x8]
	ldr	w3, [x19, #16]
	bl	_REG_SET_FIELD
	ldr	w1, [x21]
Lloh55:
	adrp	x8, _ENABLE@GOTPAGE
Lloh56:
	ldr	x8, [x8, _ENABLE@GOTPAGEOFF]
Lloh57:
	ldr	w2, [x8]
	mov	w3, #1
	b	LBB0_5
LBB0_4:
Lloh58:
	adrp	x8, _ENABLE@GOTPAGE
Lloh59:
	ldr	x8, [x8, _ENABLE@GOTPAGEOFF]
Lloh60:
	ldr	w2, [x8]
	mov	w3, #0
LBB0_5:
	bl	_REG_SET_FIELD
	mov	x1, x0
	ldr	w0, [x20]
	bl	_WREG32
	ldr	w0, [x19, #4]
	bl	_pci_set_master
	mov	x0, x19
	bl	_tonga_ih_enable_interrupts
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.cfi_endproc
                                        ; -- End function
	.comm	_mmINTERRUPT_CNTL2,4,2          ; @mmINTERRUPT_CNTL2
	.comm	_mmINTERRUPT_CNTL,4,2           ; @mmINTERRUPT_CNTL
	.comm	_INTERRUPT_CNTL,4,2             ; @INTERRUPT_CNTL
	.comm	_IH_DUMMY_RD_OVERRIDE,4,2       ; @IH_DUMMY_RD_OVERRIDE
	.comm	_IH_REQ_NONSNOOP_EN,4,2         ; @IH_REQ_NONSNOOP_EN
	.comm	_mmIH_RB_BASE,4,2               ; @mmIH_RB_BASE
	.comm	_IH_RB_CNTL,4,2                 ; @IH_RB_CNTL
	.comm	_WPTR_OVERFLOW_CLEAR,4,2        ; @WPTR_OVERFLOW_CLEAR
	.comm	_RB_SIZE,4,2                    ; @RB_SIZE
	.comm	_WPTR_WRITEBACK_ENABLE,4,2      ; @WPTR_WRITEBACK_ENABLE
	.comm	_MC_VMID,4,2                    ; @MC_VMID
	.comm	_RPTR_REARM,4,2                 ; @RPTR_REARM
	.comm	_mmIH_RB_CNTL,4,2               ; @mmIH_RB_CNTL
	.comm	_mmIH_RB_WPTR_ADDR_LO,4,2       ; @mmIH_RB_WPTR_ADDR_LO
	.comm	_mmIH_RB_WPTR_ADDR_HI,4,2       ; @mmIH_RB_WPTR_ADDR_HI
	.comm	_mmIH_RB_RPTR,4,2               ; @mmIH_RB_RPTR
	.comm	_mmIH_RB_WPTR,4,2               ; @mmIH_RB_WPTR
	.comm	_mmIH_DOORBELL_RPTR,4,2         ; @mmIH_DOORBELL_RPTR
	.comm	_IH_DOORBELL_RPTR,4,2           ; @IH_DOORBELL_RPTR
	.comm	_OFFSET,4,2                     ; @OFFSET
	.comm	_ENABLE,4,2                     ; @ENABLE
	.no_dead_strip	_tonga_ih_irq_init
.subsections_via_symbols
