	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipu_attach
_ipu_attach:                            ## @ipu_attach
	.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	_have_ipu@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jne	LBB0_1
## %bb.2:
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %r15
	movl	%r14d, 40(%rax)
	leaq	16(%rax), %rdx
	movq	$0, 16(%rax)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%r15, %rdx
	addq	$32, %rdx
	movq	$0, 32(%r15)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %ecx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	$1, %edi
	callq	_imx_ccm_ipu_enable
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_src_reset_ipu
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_6:
	movl	(%r13), %esi
	movq	8(%r15), %rcx
	movq	16(%r15), %rdx
	movl	%r14d, %edi
	callq	_bus_release_resource
	leaq	L_.str.1(%rip), %rsi
LBB0_4:
	movl	%r14d, %edi
	callq	_device_printf
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	callq	_IPU_LOCK_INIT
	movq	_hdmi_event@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ipu_hdmi_event@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	callq	_EVENTHANDLER_REGISTER
	movl	%eax, (%r15)
	movl	$1, (%r12)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_have_ipu,4,2                   ## @have_ipu
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot allocate memory window\n"

	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
L_.str.1:                               ## @.str.1
	.asciz	"cannot allocate interrupt\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to reset IPU\n"

	.comm	_hdmi_event,4,2                 ## @hdmi_event
	.comm	_ipu_hdmi_event,4,2             ## @ipu_hdmi_event
	.no_dead_strip	_ipu_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipu_attach
_ipu_attach:                            ; @ipu_attach
	.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
Lloh0:
	adrp	x22, _have_ipu@GOTPAGE
Lloh1:
	ldr	x22, [x22, _have_ipu@GOTPAGEOFF]
	ldr	w8, [x22]
	cbnz	w8, LBB0_8
; %bb.1:
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #40]
	mov	x2, x0
	str	xzr, [x2, #16]!
Lloh2:
	adrp	x23, _SYS_RES_MEMORY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh4:
	adrp	x24, _RF_ACTIVE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x24]
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #8]
	cbz	x0, LBB0_5
; %bb.2:
	mov	x21, x20
	str	xzr, [x21, #32]!
Lloh6:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w3, [x24]
	mov	x0, x19
	mov	x2, x21
	bl	_bus_alloc_resource_any
	stur	x0, [x21, #-8]
	cbz	x0, LBB0_6
; %bb.3:
	mov	w21, #1
	mov	w0, #1
	bl	_imx_ccm_ipu_enable
	bl	_src_reset_ipu
	cbz	x0, LBB0_10
; %bb.4:
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	ldr	w1, [x23]
	ldp	x3, x2, [x20, #8]
	mov	x0, x19
	bl	_bus_release_resource
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x0, x19
	bl	_device_printf
LBB0_8:
Lloh15:
	adrp	x8, _ENXIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
LBB0_9:
	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
	ret
LBB0_10:
	mov	x0, x20
	bl	_IPU_LOCK_INIT
Lloh18:
	adrp	x8, _hdmi_event@GOTPAGE
Lloh19:
	ldr	x8, [x8, _hdmi_event@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x8, _ipu_hdmi_event@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ipu_hdmi_event@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x2, x20
	mov	w3, #0
	bl	_EVENTHANDLER_REGISTER
	mov	x8, x0
	mov	w0, #0
	str	w8, [x20]
	str	w21, [x22]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_have_ipu,4,2                   ; @have_ipu
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot allocate memory window\n"

	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
l_.str.1:                               ; @.str.1
	.asciz	"cannot allocate interrupt\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to reset IPU\n"

	.comm	_hdmi_event,4,2                 ; @hdmi_event
	.comm	_ipu_hdmi_event,4,2             ; @ipu_hdmi_event
	.no_dead_strip	_ipu_attach
.subsections_via_symbols
