	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zd1301_frontend_attach
_zd1301_frontend_attach:                ## @zd1301_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_adap_to_d
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_adap_to_priv
	movq	%rax, %r13
	movq	(%rbx), %r15
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	leaq	32(%r13), %r12
	movq	%rbx, 40(%r13)
	movq	_zd1301_demod_rreg@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r13)
	movq	_zd1301_demod_wreg@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r13)
	leaq	L_.str.1(%rip), %rdi
	leaq	L_.str.2(%rip), %rbx
	movq	%rbx, %rsi
	callq	_request_module
	movq	_PLATFORM_DEVID_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rcx
	movl	$16, %r8d
	callq	_platform_device_register_data
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_15
LBB0_2:
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	(%rax), %edi
	callq	_try_module_get
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movq	%r12, %rdi
	callq	_zd1301_demod_get_i2c_adapter
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_zd1301_demod_get_dvb_frontend
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.7:
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rbx
	addq	$16, %rbx
	movl	$9, 16(%r13)
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, 24(%r13)
	leaq	-80(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	-64(%rbp), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.3(%rip), %rsi
	callq	_strscpy
	movl	$96, -80(%rbp)
	movq	%rbx, -72(%rbp)
	leaq	L_.str.1(%rip), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_request_module
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	-80(%rbp), %rsi
	callq	_i2c_new_device
	testq	%rax, %rax
	je	LBB0_8
## %bb.10:
	movq	%rax, %rbx
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.11:
	movl	(%rax), %edi
	callq	_try_module_get
	testl	%eax, %eax
	je	LBB0_12
## %bb.17:
	movq	%r12, 8(%r13)
	movq	%rbx, (%r13)
	movq	(%r14), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_8:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_13:
	movq	(%r12), %rax
	movl	(%rax), %edi
	callq	_module_put
	jmp	LBB0_14
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_14:
	negl	%ebx
	movq	%r12, %rdi
	callq	_platform_device_unregister
LBB0_15:
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_16:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movq	%rbx, %rdi
	movl	(%rax), %ebx
	callq	_i2c_unregister_device
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_zd1301_demod_rreg,4,2          ## @zd1301_demod_rreg
	.comm	_zd1301_demod_wreg,4,2          ## @zd1301_demod_wreg
L_.str.1:                               ## @.str.1
	.asciz	"%s"

L_.str.2:                               ## @.str.2
	.asciz	"zd1301_demod"

	.comm	_PLATFORM_DEVID_AUTO,4,2        ## @PLATFORM_DEVID_AUTO
	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.3:                               ## @.str.3
	.asciz	"mt2060"

	.comm	_I2C_NAME_SIZE,4,2              ## @I2C_NAME_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"failed=%d\n"

	.no_dead_strip	_zd1301_frontend_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zd1301_frontend_attach
_zd1301_frontend_attach:                ; @zd1301_frontend_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x0
	bl	_adap_to_d
	mov	x21, x0
	mov	x0, x20
	bl	_adap_to_priv
	mov	x22, x0
	ldr	x19, [x21]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	str	x21, [x22, #40]
Lloh2:
	adrp	x8, _zd1301_demod_rreg@GOTPAGE
Lloh3:
	ldr	x8, [x8, _zd1301_demod_rreg@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x22, #36]
Lloh5:
	adrp	x8, _zd1301_demod_wreg@GOTPAGE
Lloh6:
	ldr	x8, [x8, _zd1301_demod_wreg@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	mov	x21, x22
	str	w8, [x21, #32]!
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
Lloh10:
	adrp	x23, l_.str.2@PAGE
Lloh11:
	add	x23, x23, l_.str.2@PAGEOFF
	mov	x1, x23
	bl	_request_module
Lloh12:
	adrp	x8, _PLATFORM_DEVID_AUTO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PLATFORM_DEVID_AUTO@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x23
	mov	x3, x21
	mov	w4, #16
	bl	_platform_device_register_data
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x24, x0
	b	LBB0_14
LBB0_2:
	ldr	x8, [x21]
	cbz	x8, LBB0_9
; %bb.3:
	ldr	w0, [x8]
	bl	_try_module_get
	cbz	w0, LBB0_12
; %bb.4:
	mov	x0, x21
	bl	_zd1301_demod_get_i2c_adapter
	mov	x24, x0
	mov	x0, x21
	bl	_zd1301_demod_get_dvb_frontend
	cmp	x24, #0
	ccmp	x0, #0, #4, ne
	b.eq	LBB0_10
; %bb.5:
	mov	x23, x0
	mov	w8, #9
	mov	x26, x22
	str	w8, [x26, #16]!
	str	x0, [x26, #8]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	w0, [sp, #24]
Lloh15:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
Lloh18:
	adrp	x25, l_.str.3@PAGE
Lloh19:
	add	x25, x25, l_.str.3@PAGEOFF
	mov	x1, x25
	bl	_strscpy
	mov	w8, #96
	str	w8, [sp, #8]
	str	x26, [sp, #16]
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x25
	bl	_request_module
	add	x1, sp, #8
	mov	x0, x24
	bl	_i2c_new_device
	cbz	x0, LBB0_10
; %bb.6:
	mov	x25, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_10
; %bb.7:
	ldr	w0, [x8]
	bl	_try_module_get
	cbz	w0, LBB0_16
; %bb.8:
	mov	w24, #0
	stp	x25, x21, [x22]
	ldr	x8, [x20]
	str	x23, [x8]
	b	LBB0_15
LBB0_9:
Lloh22:
	adrp	x8, _ENODEV@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_14
LBB0_10:
Lloh25:
	adrp	x8, _ENODEV@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh27:
	ldr	w20, [x8]
LBB0_11:
	ldr	x8, [x21]
	ldr	w0, [x8]
	bl	_module_put
	b	LBB0_13
LBB0_12:
Lloh28:
	adrp	x8, _ENODEV@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh30:
	ldr	w20, [x8]
LBB0_13:
	neg	w24, w20
	mov	x0, x21
	bl	_platform_device_unregister
LBB0_14:
	str	x24, [sp]
Lloh31:
	adrp	x1, l_.str.4@PAGE
Lloh32:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
LBB0_15:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
Lloh33:
	adrp	x8, _ENODEV@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh35:
	ldr	w20, [x8]
	mov	x0, x25
	bl	_i2c_unregister_device
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_zd1301_demod_rreg,4,2          ; @zd1301_demod_rreg
	.comm	_zd1301_demod_wreg,4,2          ; @zd1301_demod_wreg
l_.str.1:                               ; @.str.1
	.asciz	"%s"

l_.str.2:                               ; @.str.2
	.asciz	"zd1301_demod"

	.comm	_PLATFORM_DEVID_AUTO,4,2        ; @PLATFORM_DEVID_AUTO
	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.3:                               ; @.str.3
	.asciz	"mt2060"

	.comm	_I2C_NAME_SIZE,4,2              ; @I2C_NAME_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"failed=%d\n"

	.no_dead_strip	_zd1301_frontend_attach
.subsections_via_symbols
