	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function host1x_attach
_host1x_attach:                         ## @host1x_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	%rdi, %r14
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	_DRM_MEM_DRIVER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$4, %edi
	callq	_malloc
	leaq	8(%rbx), %r12
	movq	%rax, 8(%rbx)
	movq	%r14, 24(%rbx)
	movq	%r12, 8(%rax)
	movq	%r14, (%rax)
	leaq	16(%rbx), %rdi
	callq	_TAILQ_INIT
	movq	%rbx, %rdi
	callq	_LOCK_INIT
	movl	$0, -44(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_bus_alloc_resource_any
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	movq	%r14, %rdi
	callq	_bus_generic_attach
	movl	%eax, %r15d
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	movq	_DRM_MEM_DRIVER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_free
LBB0_3:
	movq	(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_5
## %bb.4:
	movl	(%r13), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_5:
	movq	%rbx, %rdi
	callq	_LOCK_DESTROY
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MEM_DRIVER,4,2             ## @DRM_MEM_DRIVER
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.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 map registers.\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_host1x_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function host1x_attach
_host1x_attach:                         ; @host1x_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	bl	_device_get_softc
	mov	x19, x0
Lloh0:
	adrp	x22, _DRM_MEM_DRIVER@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DRM_MEM_DRIVER@GOTPAGEOFF]
Lloh2:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #4
	bl	_malloc
	mov	x24, x19
	str	x0, [x24, #8]!
	str	x20, [x19, #24]
	stp	x20, x24, [x0]
	add	x0, x19, #16
	bl	_TAILQ_INIT
	mov	x0, x19
	bl	_LOCK_INIT
	str	wzr, [sp, #12]
Lloh8:
	adrp	x23, _SYS_RES_MEMORY@GOTPAGE
Lloh9:
	ldr	x23, [x23, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh10:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19]
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_bus_generic_attach
	mov	x21, x0
	b	LBB0_7
LBB0_2:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
Lloh15:
	adrp	x8, _ENXIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh17:
	ldr	w21, [x8]
	ldr	x0, [x24]
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w1, [x22]
	bl	_free
LBB0_4:
	ldr	x3, [x19]
	cbz	x3, LBB0_6
; %bb.5:
	ldr	w1, [x23]
	mov	x0, x20
	mov	w2, #0
	bl	_bus_release_resource
LBB0_6:
	mov	x0, x19
	bl	_LOCK_DESTROY
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MEM_DRIVER,4,2             ; @DRM_MEM_DRIVER
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.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 map registers.\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_host1x_attach
.subsections_via_symbols
