	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function technisat_usb2_frontend_attach
_technisat_usb2_frontend_attach:        ## @technisat_usb2_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rdx
	movq	16(%rdx), %r14
	movq	_stv090x_attach@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$12, %rdx
	movq	_STV090x_DEMODULATOR_0@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_technisat_usb2_stv090x_config@GOTPCREL(%rip), %r15
	movq	%r15, %rsi
	callq	_dvb_attach
	movq	(%rbx), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	_stv6110x_attach@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	8(%rbx), %rcx
	addq	$12, %rcx
	movq	_technisat_usb2_stv6110x_config@GOTPCREL(%rip), %rdx
	movq	%rax, %rsi
	callq	_dvb_attach
	testq	%rax, %rax
	je	LBB0_9
## %bb.2:
	movl	40(%rax), %ecx
	movl	%ecx, 56(%r15)
	movl	36(%rax), %ecx
	movl	%ecx, 52(%r15)
	movl	32(%rax), %ecx
	movl	%ecx, 48(%r15)
	movups	16(%rax), %xmm0
	movups	%xmm0, 32(%r15)
	movups	(%rax), %xmm0
	movups	%xmm0, 16(%r15)
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	callq	*%rax
LBB0_4:
	movq	8(%rbx), %rdi
	addq	$8, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	js	LBB0_8
## %bb.5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_SET_IFCLK_TO_EXTERNAL_TSCLK_VENDOR_REQUEST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rsi
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rsi), %ecx
	subq	$8, %rsp
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	$500                            ## imm = 0x1F4
	pushq	$0
	pushq	$0
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %r14d
	movq	8(%rbx), %rdi
	addq	$8, %rdi
	callq	_mutex_unlock
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	callq	_err
LBB0_7:
	movq	_technisat_usb2_set_voltage@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%rbx), %rcx
	movq	(%rcx), %rcx
	movl	%eax, 4(%rcx)
	movl	(%rcx), %edi
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_strscpy
	jmp	LBB0_10
LBB0_9:
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	callq	_dvb_frontend_detach
	movq	(%rbx), %rax
	movq	$0, (%rax)
LBB0_10:
	movq	8(%rbx), %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_technisat_usb2_set_led_timer
	movq	(%rbx), %rcx
	movq	_ENODEV@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	xorl	%eax, %eax
	subl	(%rdx), %eax
	cmpq	$0, (%rcx)
	cmovnel	%esi, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_stv090x_attach,4,2             ## @stv090x_attach
	.comm	_technisat_usb2_stv090x_config,64,3 ## @technisat_usb2_stv090x_config
	.comm	_STV090x_DEMODULATOR_0,8,3      ## @STV090x_DEMODULATOR_0
	.comm	_stv6110x_attach,4,2            ## @stv6110x_attach
	.comm	_technisat_usb2_stv6110x_config,4,2 ## @technisat_usb2_stv6110x_config
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_SET_IFCLK_TO_EXTERNAL_TSCLK_VENDOR_REQUEST,4,2 ## @SET_IFCLK_TO_EXTERNAL_TSCLK_VENDOR_REQUEST
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not set IF_CLK to external"

	.comm	_technisat_usb2_set_voltage,4,2 ## @technisat_usb2_set_voltage
	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_technisat_usb2_frontend_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function technisat_usb2_frontend_attach
_technisat_usb2_frontend_attach:        ; @technisat_usb2_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	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _stv090x_attach@GOTPAGE
Lloh1:
	ldr	x9, [x9, _stv090x_attach@GOTPAGEOFF]
	ldr	x20, [x8, #16]
Lloh2:
	ldr	w0, [x9]
	add	x2, x8, #12
Lloh3:
	adrp	x8, _STV090x_DEMODULATOR_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STV090x_DEMODULATOR_0@GOTPAGEOFF]
Lloh5:
	ldr	x3, [x8]
Lloh6:
	adrp	x21, _technisat_usb2_stv090x_config@GOTPAGE
Lloh7:
	ldr	x21, [x21, _technisat_usb2_stv090x_config@GOTPAGEOFF]
	mov	x1, x21
	bl	_dvb_attach
	ldr	x8, [x19]
	str	x0, [x8]
	cbz	x0, LBB0_9
; %bb.1:
	mov	x1, x0
Lloh8:
	adrp	x8, _stv6110x_attach@GOTPAGE
Lloh9:
	ldr	x8, [x8, _stv6110x_attach@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	add	x3, x8, #12
Lloh11:
	adrp	x2, _technisat_usb2_stv6110x_config@GOTPAGE
Lloh12:
	ldr	x2, [x2, _technisat_usb2_stv6110x_config@GOTPAGEOFF]
	bl	_dvb_attach
	cbz	x0, LBB0_8
; %bb.2:
	ldr	w8, [x0, #40]
	str	w8, [x21, #56]
	ldr	d0, [x0, #32]
	str	d0, [x21, #48]
	ldr	q0, [x0, #16]
	str	q0, [x21, #32]
	ldr	q0, [x0]
	str	q0, [x21, #16]
	ldr	x8, [x19]
	ldr	x0, [x8]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_4
; %bb.3:
	blr	x8
LBB0_4:
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	bl	_mutex_lock_interruptible
	tbnz	x0, #63, LBB0_11
; %bb.5:
	mov	x0, x20
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh13:
	adrp	x8, _SET_IFCLK_TO_EXTERNAL_TSCLK_VENDOR_REQUEST@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SET_IFCLK_TO_EXTERNAL_TSCLK_VENDOR_REQUEST@GOTPAGEOFF]
Lloh15:
	adrp	x9, _USB_TYPE_VENDOR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
Lloh18:
	ldr	w8, [x9]
Lloh19:
	adrp	x9, _USB_DIR_OUT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _USB_DIR_OUT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	w8, #500
	str	w8, [sp]
	mov	x0, x20
	mov	w4, #0
	mov	w5, #0
	mov	x6, #0
	mov	w7, #0
	bl	_usb_control_msg
	mov	x20, x0
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	bl	_mutex_unlock
	cbz	w20, LBB0_7
; %bb.6:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
LBB0_7:
Lloh24:
	adrp	x8, _technisat_usb2_set_voltage@GOTPAGE
Lloh25:
	ldr	x8, [x8, _technisat_usb2_set_voltage@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ldp	x9, x10, [x19]
	ldr	x9, [x9]
	str	w8, [x9, #4]
	ldr	w0, [x9]
	ldr	x8, [x10]
	ldr	w1, [x8]
	mov	w2, #4
	bl	_strscpy
	b	LBB0_9
LBB0_8:
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_dvb_frontend_detach
	ldr	x8, [x19]
	str	xzr, [x8]
LBB0_9:
	ldr	x0, [x19, #8]
	mov	w1, #1
	mov	w2, #1
	bl	_technisat_usb2_set_led_timer
	ldr	x8, [x19]
	ldr	x8, [x8]
Lloh27:
	adrp	x9, _ENODEV@GOTPAGE
Lloh28:
	ldr	x9, [x9, _ENODEV@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	cmp	x8, #0
	csneg	w0, wzr, w9, ne
LBB0_10:
	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
LBB0_11:
Lloh30:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh17
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_stv090x_attach,4,2             ; @stv090x_attach
	.comm	_technisat_usb2_stv090x_config,64,3 ; @technisat_usb2_stv090x_config
	.comm	_STV090x_DEMODULATOR_0,8,3      ; @STV090x_DEMODULATOR_0
	.comm	_stv6110x_attach,4,2            ; @stv6110x_attach
	.comm	_technisat_usb2_stv6110x_config,4,2 ; @technisat_usb2_stv6110x_config
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_SET_IFCLK_TO_EXTERNAL_TSCLK_VENDOR_REQUEST,4,2 ; @SET_IFCLK_TO_EXTERNAL_TSCLK_VENDOR_REQUEST
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not set IF_CLK to external"

	.comm	_technisat_usb2_set_voltage,4,2 ; @technisat_usb2_set_voltage
	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_technisat_usb2_frontend_attach
.subsections_via_symbols
