	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ubtbcmfw_attach
_ubtbcmfw_attach:                       ## @ubtbcmfw_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
	movl	%edi, %r15d
	callq	_device_get_ivars
	movq	%rax, %r12
	movl	%r15d, %edi
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	4(%r12), %eax
	movl	%eax, 12(%rbx)
	movl	%r15d, %edi
	callq	_device_set_usb_desc
	leaq	4(%rbx), %r13
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movq	_MTX_RECURSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_mtx_init
	movq	_UBTBCMFW_IFACE_IDX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movl	4(%r12), %edi
	movl	8(%rbx), %edx
	movq	_ubtbcmfw_config@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_UBTBCMFW_N_TRANSFER@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	subq	$8, %rsp
	leaq	-48(%rbp), %rsi
	movq	%rbx, %r9
	pushq	%r13
	callq	_usbd_transfer_setup
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rbx
	jmp	LBB0_4
LBB0_2:
	movl	4(%r12), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_device_get_unit
	movl	(%r12), %r10d
	movq	_UID_ROOT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r11d
	movq	_GID_OPERATOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	subq	$8, %rsp
	movq	_ubtbcmfw_fifo_methods@GOTPCREL(%rip), %rcx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rbx, %rsi
	movq	%r13, %rdx
	movq	%rbx, %r8
	movl	%eax, %r9d
	pushq	$420                            ## imm = 0x1A4
	pushq	%r12
	pushq	%r11
	pushq	%r10
	pushq	$-1
	callq	_usb_fifo_attach
	addq	$48, %rsp
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	leaq	L_.str.2(%rip), %rbx
LBB0_4:
	movl	%eax, %edi
	callq	_usbd_errstr
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_device_printf
	movl	%r15d, %edi
	callq	_ubtbcmfw_detach
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ubtbcmfw lock"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.comm	_MTX_RECURSE,4,2                ## @MTX_RECURSE
	.comm	_UBTBCMFW_IFACE_IDX,4,2         ## @UBTBCMFW_IFACE_IDX
	.comm	_ubtbcmfw_config,4,2            ## @ubtbcmfw_config
	.comm	_UBTBCMFW_N_TRANSFER,4,2        ## @UBTBCMFW_N_TRANSFER
L_.str.1:                               ## @.str.1
	.asciz	"allocating USB transfers failed. %s\n"

	.comm	_ubtbcmfw_fifo_methods,4,2      ## @ubtbcmfw_fifo_methods
	.comm	_UID_ROOT,4,2                   ## @UID_ROOT
	.comm	_GID_OPERATOR,4,2               ## @GID_OPERATOR
L_.str.2:                               ## @.str.2
	.asciz	"could not attach fifo. %s\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ubtbcmfw_attach
_ubtbcmfw_attach:                       ; @ubtbcmfw_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	x19, x0
	bl	_device_get_ivars
	mov	x22, x0
	mov	x0, x19
	bl	_device_get_softc
	mov	x20, x0
	ldr	w8, [x22, #4]
	str	w8, [x0, #12]
	mov	x0, x19
	bl	_device_set_usb_desc
Lloh0:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
	add	x21, x20, #4
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _MTX_RECURSE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MTX_RECURSE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w3, w9, w8
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, #0
	bl	_mtx_init
Lloh8:
	adrp	x8, _UBTBCMFW_IFACE_IDX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _UBTBCMFW_IFACE_IDX@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	ldr	w0, [x22, #4]
	ldr	w2, [x20, #8]
Lloh11:
	adrp	x8, _ubtbcmfw_config@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ubtbcmfw_config@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
Lloh14:
	adrp	x8, _UBTBCMFW_N_TRANSFER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _UBTBCMFW_N_TRANSFER@GOTPAGEOFF]
Lloh16:
	ldr	w4, [x8]
	add	x1, sp, #12
	mov	x5, x20
	mov	x6, x21
	bl	_usbd_transfer_setup
	cbz	w0, LBB0_2
; %bb.1:
Lloh17:
	adrp	x20, l_.str.1@PAGE
Lloh18:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_2:
	ldr	w23, [x22, #4]
	mov	x0, x19
	bl	_device_get_unit
	mov	x5, x0
	ldr	w7, [x22]
Lloh19:
	adrp	x8, _UID_ROOT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _UID_ROOT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _GID_OPERATOR@GOTPAGE
Lloh23:
	ldr	x9, [x9, _GID_OPERATOR@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	mov	w10, #420
	stp	w9, w10, [sp, #4]
	str	w8, [sp]
Lloh25:
	adrp	x3, _ubtbcmfw_fifo_methods@GOTPAGE
Lloh26:
	ldr	x3, [x3, _ubtbcmfw_fifo_methods@GOTPAGEOFF]
	mov	x0, x23
	mov	x1, x20
	mov	x2, x21
	mov	x4, x20
	mov	x6, #-1
	bl	_usb_fifo_attach
	cbz	w0, LBB0_5
; %bb.3:
Lloh27:
	adrp	x20, l_.str.2@PAGE
Lloh28:
	add	x20, x20, l_.str.2@PAGEOFF
LBB0_4:
	bl	_usbd_errstr
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_device_printf
	mov	x0, x19
	bl	_ubtbcmfw_detach
Lloh29:
	adrp	x8, _ENXIO@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
LBB0_5:
	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	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ubtbcmfw lock"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.comm	_MTX_RECURSE,4,2                ; @MTX_RECURSE
	.comm	_UBTBCMFW_IFACE_IDX,4,2         ; @UBTBCMFW_IFACE_IDX
	.comm	_ubtbcmfw_config,4,2            ; @ubtbcmfw_config
	.comm	_UBTBCMFW_N_TRANSFER,4,2        ; @UBTBCMFW_N_TRANSFER
l_.str.1:                               ; @.str.1
	.asciz	"allocating USB transfers failed. %s\n"

	.comm	_ubtbcmfw_fifo_methods,4,2      ; @ubtbcmfw_fifo_methods
	.comm	_UID_ROOT,4,2                   ; @UID_ROOT
	.comm	_GID_OPERATOR,4,2               ; @GID_OPERATOR
l_.str.2:                               ; @.str.2
	.asciz	"could not attach fifo. %s\n"

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