	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_irq_preinstall             ## -- Begin function psb_irq_preinstall
	.p2align	4, 0x90
_psb_irq_preinstall:                    ## @psb_irq_preinstall
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	callq	_gma_power_is_on
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_PSB_HWSTAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$-1, %edi
	callq	_PSB_WVDC32
	movq	_PSB_INT_MASK_R@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_PSB_WVDC32
	movq	_PSB_INT_ENABLE_R@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_PSB_WVDC32
	movq	_PSB_CR_EVENT_HOST_ENABLE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	xorl	%edi, %edi
	callq	_PSB_WSGX32
	movl	(%r12), %edi
	callq	_PSB_RSGX32
LBB0_2:
	movq	(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.3:
	movq	__PSB_VSYNC_PIPEA_FLAG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%rbx)
LBB0_4:
	cmpq	$0, 8(%rax)
	je	LBB0_6
## %bb.5:
	movq	__PSB_VSYNC_PIPEB_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_6:
	movq	8(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.8:
	movq	__PSB_IRQ_DISP_HOTSYNC@GOTPCREL(%rip), %rcx
	movl	(%rbx), %eax
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_9
LBB0_7:
	movl	(%rbx), %eax
LBB0_9:
	movq	__PSB_IRQ_ASLE@GOTPCREL(%rip), %rcx
	movq	__PSB_IRQ_SGX_FLAG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	orl	(%rcx), %edi
	orl	%eax, %edi
	movl	%edi, (%rbx)
	notl	%edi
	movq	_PSB_INT_MASK_R@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_PSB_WVDC32
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PSB_HWSTAM,4,2                 ## @PSB_HWSTAM
	.comm	_PSB_INT_MASK_R,4,2             ## @PSB_INT_MASK_R
	.comm	_PSB_INT_ENABLE_R,4,2           ## @PSB_INT_ENABLE_R
	.comm	_PSB_CR_EVENT_HOST_ENABLE,4,2   ## @PSB_CR_EVENT_HOST_ENABLE
	.comm	__PSB_VSYNC_PIPEA_FLAG,4,2      ## @_PSB_VSYNC_PIPEA_FLAG
	.comm	__PSB_VSYNC_PIPEB_FLAG,4,2      ## @_PSB_VSYNC_PIPEB_FLAG
	.comm	__PSB_IRQ_DISP_HOTSYNC,4,2      ## @_PSB_IRQ_DISP_HOTSYNC
	.comm	__PSB_IRQ_ASLE,4,2              ## @_PSB_IRQ_ASLE
	.comm	__PSB_IRQ_SGX_FLAG,4,2          ## @_PSB_IRQ_SGX_FLAG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_irq_preinstall             ; -- Begin function psb_irq_preinstall
	.p2align	2
_psb_irq_preinstall:                    ; @psb_irq_preinstall
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	ldr	x21, [x0, #8]
	add	x19, x21, #4
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_gma_power_is_on
Lloh0:
	adrp	x22, _PSB_INT_MASK_R@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PSB_INT_MASK_R@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _PSB_HWSTAM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PSB_HWSTAM@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #-1
	bl	_PSB_WVDC32
	ldr	w1, [x22]
	mov	w0, #0
	bl	_PSB_WVDC32
Lloh5:
	adrp	x8, _PSB_INT_ENABLE_R@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PSB_INT_ENABLE_R@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_PSB_WVDC32
Lloh8:
	adrp	x23, _PSB_CR_EVENT_HOST_ENABLE@GOTPAGE
Lloh9:
	ldr	x23, [x23, _PSB_CR_EVENT_HOST_ENABLE@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #0
	bl	_PSB_WSGX32
	ldr	w0, [x23]
	bl	_PSB_RSGX32
LBB0_2:
	ldr	x8, [x20]
	ldr	x9, [x8]
	cbz	x9, LBB0_4
; %bb.3:
Lloh10:
	adrp	x9, __PSB_VSYNC_PIPEA_FLAG@GOTPAGE
Lloh11:
	ldr	x9, [x9, __PSB_VSYNC_PIPEA_FLAG@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	ldr	w10, [x21]
	orr	w9, w10, w9
	str	w9, [x21]
LBB0_4:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh13:
	adrp	x8, __PSB_VSYNC_PIPEB_FLAG@GOTPAGE
Lloh14:
	ldr	x8, [x8, __PSB_VSYNC_PIPEB_FLAG@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
LBB0_6:
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.7:
Lloh16:
	adrp	x8, __PSB_IRQ_DISP_HOTSYNC@GOTPAGE
Lloh17:
	ldr	x8, [x8, __PSB_IRQ_DISP_HOTSYNC@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
	b	LBB0_9
LBB0_8:
	ldr	w8, [x21]
LBB0_9:
Lloh19:
	adrp	x9, __PSB_IRQ_ASLE@GOTPAGE
Lloh20:
	ldr	x9, [x9, __PSB_IRQ_ASLE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
Lloh22:
	adrp	x10, __PSB_IRQ_SGX_FLAG@GOTPAGE
Lloh23:
	ldr	x10, [x10, __PSB_IRQ_SGX_FLAG@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	orr	w9, w10, w9
	orr	w8, w9, w8
	str	w8, [x21]
	mvn	w0, w8
	ldr	w1, [x22]
	bl	_PSB_WVDC32
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_PSB_HWSTAM,4,2                 ; @PSB_HWSTAM
	.comm	_PSB_INT_MASK_R,4,2             ; @PSB_INT_MASK_R
	.comm	_PSB_INT_ENABLE_R,4,2           ; @PSB_INT_ENABLE_R
	.comm	_PSB_CR_EVENT_HOST_ENABLE,4,2   ; @PSB_CR_EVENT_HOST_ENABLE
	.comm	__PSB_VSYNC_PIPEA_FLAG,4,2      ; @_PSB_VSYNC_PIPEA_FLAG
	.comm	__PSB_VSYNC_PIPEB_FLAG,4,2      ; @_PSB_VSYNC_PIPEB_FLAG
	.comm	__PSB_IRQ_DISP_HOTSYNC,4,2      ; @_PSB_IRQ_DISP_HOTSYNC
	.comm	__PSB_IRQ_ASLE,4,2              ; @_PSB_IRQ_ASLE
	.comm	__PSB_IRQ_SGX_FLAG,4,2          ; @_PSB_IRQ_SGX_FLAG
.subsections_via_symbols
