	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function af9015_af9013_frontend_attach
_af9015_af9013_frontend_attach:         ## @af9015_af9013_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	%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, %r15
	callq	_adap_to_priv
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_adap_to_d
	movq	%rax, %r12
	movq	8(%rax), %rbx
	movl	(%r15), %edx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_dbg
	movl	(%r15), %eax
	cmpl	$1, %eax
	je	LBB0_5
## %bb.1:
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	_AF9013_TS_MODE_USB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	40(%r14), %rcx
	movl	%eax, 28(%rcx)
	movl	24(%rcx), %edi
	leaq	l_.str.1(%rip), %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	_AF9013_GPIO_HI@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	40(%r14), %rcx
	movq	16(%rcx), %rcx
	movq	%rax, (%rcx)
	movq	_AF9013_GPIO_TUNER_ON@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	40(%r14), %rcx
	movq	16(%rcx), %rcx
	movq	%rax, 24(%rcx)
LBB0_3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	48(%r14), %rax
	movslq	(%r15), %r8
	movl	(%rax,%r8,4), %ecx
	shlq	$5, %r8
	addq	40(%r14), %r8
	leaq	L_.str.3(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_dvb_module_probe
	testq	%rax, %rax
	je	LBB0_4
## %bb.8:
	movq	%rax, %rbx
	movq	40(%r14), %rax
	movslq	(%r15), %rcx
	shlq	$5, %rcx
	movq	%rbx, %rdi
	callq	*8(%rax,%rcx)
	movq	8(%r15), %rcx
	movq	%rax, (%rcx)
	movq	32(%r14), %rax
	movslq	(%r15), %rcx
	movq	%rbx, (%rax,%rcx,8)
	movq	8(%r15), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movl	12(%rax), %edx
	movq	24(%r14), %rsi
	movl	%edx, (%rsi,%rcx,4)
	movq	_af9015_af9013_set_frontend@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%rax)
	movl	8(%rax), %ecx
	movq	16(%r14), %rdx
	movslq	(%r15), %rsi
	movl	%ecx, (%rdx,%rsi,4)
	movq	_af9015_af9013_read_status@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movl	4(%rax), %ecx
	movq	8(%r14), %rdx
	movslq	(%r15), %rsi
	movl	%ecx, (%rdx,%rsi,4)
	movq	_af9015_af9013_init@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rax)
	movl	(%rax), %ecx
	movq	(%r14), %rdx
	movslq	(%r15), %rsi
	movl	%ecx, (%rdx,%rsi,4)
	movq	_af9015_af9013_sleep@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	jmp	LBB0_12
LBB0_5:
	movq	_AF9013_TS_MODE_SERIAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	40(%r14), %rcx
	movl	%eax, 60(%rcx)
	movl	$7, 32(%rcx)
	movl	56(%rcx), %edi
	leaq	l_.str.1(%rip), %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	_AF9013_GPIO_TUNER_ON@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	40(%r14), %rcx
	movq	48(%rcx), %rcx
	movq	%rax, (%rcx)
	movq	_AF9013_GPIO_LO@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	40(%r14), %rcx
	movq	48(%rcx), %rcx
	movq	%rax, 8(%rcx)
	cmpq	$0, 56(%r14)
	je	LBB0_10
## %bb.6:
	movl	$100, %edi
	callq	_msleep
	movq	%r15, %rdi
	callq	_adap_to_d
	movq	%rax, %rdi
	callq	_af9015_copy_firmware
	testl	%eax, %eax
	je	LBB0_3
## %bb.7:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
	movq	$0, 56(%r14)
	jmp	LBB0_11
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_10:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_11:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_dev_dbg
LBB0_12:
	movl	%r13d, %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	"adap id %u\n"

	.comm	_AF9013_TS_MODE_USB,4,2         ## @AF9013_TS_MODE_USB
	.section	__TEXT,__const
l_.str.1:                               ## @.str.1
	.asciz	"\000\001\t\000"

	.comm	_AF9013_GPIO_HI,8,3             ## @AF9013_GPIO_HI
	.comm	_AF9013_GPIO_TUNER_ON,8,3       ## @AF9013_GPIO_TUNER_ON
	.comm	_AF9013_TS_MODE_SERIAL,4,2      ## @AF9013_TS_MODE_SERIAL
	.comm	_AF9013_GPIO_LO,8,3             ## @AF9013_GPIO_LO
	.section	__TEXT,__cstring,cstring_literals
L_.str.2:                               ## @.str.2
	.asciz	"firmware copy to 2nd frontend failed, will disable it\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.3:                               ## @.str.3
	.asciz	"af9013"

	.comm	_af9015_af9013_set_frontend,4,2 ## @af9015_af9013_set_frontend
	.comm	_af9015_af9013_read_status,4,2  ## @af9015_af9013_read_status
	.comm	_af9015_af9013_init,4,2         ## @af9015_af9013_init
	.comm	_af9015_af9013_sleep,4,2        ## @af9015_af9013_sleep
L_.str.4:                               ## @.str.4
	.asciz	"failed %d\n"

	.no_dead_strip	_af9015_af9013_frontend_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function af9015_af9013_frontend_attach
_af9015_af9013_frontend_attach:         ; @af9015_af9013_frontend_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
	mov	x20, x0
	bl	_adap_to_priv
	mov	x19, x0
	mov	x0, x20
	bl	_adap_to_d
	mov	x22, x0
	ldr	x21, [x0, #8]
	ldr	w2, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
	ldr	w8, [x20]
	cmp	w8, #1
	b.eq	LBB0_6
; %bb.1:
	cbnz	w8, LBB0_3
; %bb.2:
Lloh2:
	adrp	x8, _AF9013_TS_MODE_USB@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AF9013_TS_MODE_USB@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	x9, [x19, #40]
	str	w8, [x9, #28]
	ldr	w0, [x9, #24]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #4
	bl	_memcpy
Lloh7:
	adrp	x8, _AF9013_GPIO_HI@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AF9013_GPIO_HI@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	x9, [x19, #40]
	ldr	x9, [x9, #16]
	str	x8, [x9]
Lloh10:
	adrp	x8, _AF9013_GPIO_TUNER_ON@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AF9013_GPIO_TUNER_ON@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	x9, [x19, #40]
	ldr	x9, [x9, #16]
	str	x8, [x9, #24]
LBB0_3:
	ldrsw	x8, [x20]
	ldp	x10, x9, [x19, #40]
	ldr	w3, [x9, x8, lsl #2]
	add	x4, x10, x8, lsl #5
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, #0
	mov	x2, x22
	bl	_dvb_module_probe
	cbz	x0, LBB0_9
; %bb.4:
	mov	x22, x0
	ldr	x8, [x19, #40]
	ldrsw	x9, [x20]
	add	x8, x8, x9, lsl #5
	ldr	x8, [x8, #8]
	blr	x8
	ldr	x8, [x20, #8]
	str	x0, [x8]
	ldr	x8, [x19, #32]
	ldrsw	x9, [x20]
	str	x22, [x8, x9, lsl #3]
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.5:
	mov	w23, #0
	ldr	w10, [x8, #12]
	ldp	x12, x11, [x19, #16]
	str	w10, [x11, x9, lsl #2]
Lloh15:
	adrp	x9, _af9015_af9013_set_frontend@GOTPAGE
Lloh16:
	ldr	x9, [x9, _af9015_af9013_set_frontend@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	str	w9, [x8, #12]
	ldr	w9, [x8, #8]
	ldrsw	x10, [x20]
	str	w9, [x12, x10, lsl #2]
Lloh18:
	adrp	x9, _af9015_af9013_read_status@GOTPAGE
Lloh19:
	ldr	x9, [x9, _af9015_af9013_read_status@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	str	w9, [x8, #8]
	ldr	w9, [x8, #4]
	ldrsw	x10, [x20]
	ldp	x12, x11, [x19]
	str	w9, [x11, x10, lsl #2]
Lloh21:
	adrp	x9, _af9015_af9013_init@GOTPAGE
Lloh22:
	ldr	x9, [x9, _af9015_af9013_init@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	str	w9, [x8, #4]
	ldr	w9, [x8]
	ldrsw	x10, [x20]
	str	w9, [x12, x10, lsl #2]
Lloh24:
	adrp	x9, _af9015_af9013_sleep@GOTPAGE
Lloh25:
	ldr	x9, [x9, _af9015_af9013_sleep@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	str	w9, [x8]
	b	LBB0_12
LBB0_6:
Lloh27:
	adrp	x8, _AF9013_TS_MODE_SERIAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AF9013_TS_MODE_SERIAL@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	x9, [x19, #40]
	str	w8, [x9, #60]
	mov	w8, #7
	str	w8, [x9, #32]
	ldr	w0, [x9, #56]
Lloh30:
	adrp	x1, l_.str.1@PAGE
Lloh31:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #4
	bl	_memcpy
Lloh32:
	adrp	x8, _AF9013_GPIO_TUNER_ON@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AF9013_GPIO_TUNER_ON@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	ldr	x9, [x19, #40]
	ldr	x9, [x9, #48]
Lloh35:
	adrp	x10, _AF9013_GPIO_LO@GOTPAGE
Lloh36:
	ldr	x10, [x10, _AF9013_GPIO_LO@GOTPAGEOFF]
	str	x8, [x9]
Lloh37:
	ldr	x8, [x10]
	ldr	x9, [x19, #40]
	ldr	x9, [x9, #48]
	str	x8, [x9, #8]
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_9
; %bb.7:
	mov	w0, #100
	bl	_msleep
	mov	x0, x20
	bl	_adap_to_d
	bl	_af9015_copy_firmware
	cbz	w0, LBB0_3
; %bb.8:
	mov	x23, x0
Lloh38:
	adrp	x1, l_.str.2@PAGE
Lloh39:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	str	xzr, [x19, #56]
	b	LBB0_10
LBB0_9:
Lloh40:
	adrp	x8, _ENODEV@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_10:
Lloh43:
	adrp	x1, l_.str.4@PAGE
Lloh44:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_dev_dbg
	b	LBB0_12
LBB0_11:
	mov	w23, #0
LBB0_12:
	mov	x0, x23
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"adap id %u\n"

	.comm	_AF9013_TS_MODE_USB,4,2         ; @AF9013_TS_MODE_USB
	.section	__TEXT,__const
l_.str.1:                               ; @.str.1
	.asciz	"\000\001\t\000"

	.comm	_AF9013_GPIO_HI,8,3             ; @AF9013_GPIO_HI
	.comm	_AF9013_GPIO_TUNER_ON,8,3       ; @AF9013_GPIO_TUNER_ON
	.comm	_AF9013_TS_MODE_SERIAL,4,2      ; @AF9013_TS_MODE_SERIAL
	.comm	_AF9013_GPIO_LO,8,3             ; @AF9013_GPIO_LO
	.section	__TEXT,__cstring,cstring_literals
l_.str.2:                               ; @.str.2
	.asciz	"firmware copy to 2nd frontend failed, will disable it\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.3:                               ; @.str.3
	.asciz	"af9013"

	.comm	_af9015_af9013_set_frontend,4,2 ; @af9015_af9013_set_frontend
	.comm	_af9015_af9013_read_status,4,2  ; @af9015_af9013_read_status
	.comm	_af9015_af9013_init,4,2         ; @af9015_af9013_init
	.comm	_af9015_af9013_sleep,4,2        ; @af9015_af9013_sleep
l_.str.4:                               ; @.str.4
	.asciz	"failed %d\n"

	.no_dead_strip	_af9015_af9013_frontend_attach
.subsections_via_symbols
