	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function m88rs2000_frontend_attach
_m88rs2000_frontend_attach:             ## @m88rs2000_frontend_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	movq	8(%r12), %rbx
	leaq	4(%r12), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	(%rbx), %rcx
	movl	$81, (%rcx)
	movq	%r12, %rdi
	movq	%rcx, %rsi
	movl	$1, %edx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_dvb_usb_generic_rw
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_err
LBB0_2:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_m88rs2000_attach@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_s421_m88rs2000_config@GOTPCREL(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_dvb_attach
	movq	(%r14), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	_ts2020_attach@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_dw2104_ts2020_config@GOTPCREL(%rip), %rdx
	xorl	%r15d, %r15d
	movq	%rax, %rsi
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_dvb_attach
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	callq	_info
	jmp	LBB0_8
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	callq	_info
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_7:
	subl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"command 0x51 transfer failed."

	.comm	_m88rs2000_attach,4,2           ## @m88rs2000_attach
	.comm	_s421_m88rs2000_config,4,2      ## @s421_m88rs2000_config
	.comm	_EIO,4,2                        ## @EIO
	.comm	_ts2020_attach,4,2              ## @ts2020_attach
	.comm	_dw2104_ts2020_config,4,2       ## @dw2104_ts2020_config
L_.str.1:                               ## @.str.1
	.asciz	"Attached RS2000/TS2020!"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to attach RS2000/TS2020!"

	.no_dead_strip	_m88rs2000_frontend_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function m88rs2000_frontend_attach
_m88rs2000_frontend_attach:             ; @m88rs2000_frontend_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
	ldr	x19, [x0, #8]
	ldr	x22, [x19, #8]
	add	x21, x19, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	x1, [x22]
	mov	w8, #81
	str	w8, [x1]
	mov	x0, x19
	mov	w2, #1
	mov	x3, x1
	mov	w4, #1
	mov	w5, #0
	bl	_dvb_usb_generic_rw
	tbz	x0, #63, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
LBB0_2:
	mov	x0, x21
	bl	_mutex_unlock
Lloh2:
	adrp	x8, _m88rs2000_attach@GOTPAGE
Lloh3:
	ldr	x8, [x8, _m88rs2000_attach@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, _s421_m88rs2000_config@GOTPAGE
Lloh6:
	ldr	x1, [x1, _s421_m88rs2000_config@GOTPAGEOFF]
	mov	x2, x19
	bl	_dvb_attach
	ldr	x8, [x20]
	str	x0, [x8]
	cbz	x0, LBB0_6
; %bb.3:
	mov	x1, x0
Lloh7:
	adrp	x8, _ts2020_attach@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ts2020_attach@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	str	x19, [sp]
Lloh10:
	adrp	x2, _dw2104_ts2020_config@GOTPAGE
Lloh11:
	ldr	x2, [x2, _dw2104_ts2020_config@GOTPAGEOFF]
	bl	_dvb_attach
	cbz	x0, LBB0_5
; %bb.4:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_info
	mov	w0, #0
	b	LBB0_7
LBB0_5:
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_info
LBB0_6:
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"command 0x51 transfer failed."

	.comm	_m88rs2000_attach,4,2           ; @m88rs2000_attach
	.comm	_s421_m88rs2000_config,4,2      ; @s421_m88rs2000_config
	.comm	_EIO,4,2                        ; @EIO
	.comm	_ts2020_attach,4,2              ; @ts2020_attach
	.comm	_dw2104_ts2020_config,4,2       ; @dw2104_ts2020_config
l_.str.1:                               ; @.str.1
	.asciz	"Attached RS2000/TS2020!"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to attach RS2000/TS2020!"

	.no_dead_strip	_m88rs2000_frontend_attach
.subsections_via_symbols
