	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv090x_i2c_gate_ctrl
_stv090x_i2c_gate_ctrl:                 ## @stv090x_i2c_gate_ctrl
	.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, %r14
	testl	%esi, %esi
	je	LBB0_7
## %bb.1:
	movq	16(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	8(%r14), %rdi
	movl	$1, %esi
	callq	*%rax
	jmp	LBB0_4
LBB0_7:
	movq	_I2CRPT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_STV090x_READ_DEMOD
	movl	%eax, %ebx
	movq	_FE_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rdx
	movl	$1, %esi
	callq	_dprintk
	movq	_I2CT_ON_FIELD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_STV090x_SETFIELD_Px
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_STV090x_WRITE_DEMOD
	testq	%rax, %rax
	js	LBB0_5
## %bb.8:
	movq	16(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	addq	$8, %r14
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	*%rax
	jmp	LBB0_13
LBB0_3:
	movq	(%r14), %rdi
	callq	_mutex_lock
LBB0_4:
	movq	_I2CRPT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_STV090x_READ_DEMOD
	movl	%eax, %ebx
	movq	_FE_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rdx
	movl	$1, %esi
	callq	_dprintk
	movq	_I2CT_ON_FIELD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movl	$1, %edx
	callq	_STV090x_SETFIELD_Px
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_STV090x_WRITE_DEMOD
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jns	LBB0_13
LBB0_5:
	movq	_FE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rdx
	movl	$1, %esi
	callq	_dprintk
	movq	16(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:
	addq	$8, %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	*%rax
	jmp	LBB0_12
LBB0_11:
	movq	(%r14), %rdi
	callq	_mutex_unlock
LBB0_12:
	movl	$-1, %ebx
	jmp	LBB0_13
LBB0_10:
	movq	(%r14), %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2CRPT,4,2                     ## @I2CRPT
	.comm	_FE_DEBUG,4,2                   ## @FE_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Enable Gate"

	.comm	_I2CT_ON_FIELD,4,2              ## @I2CT_ON_FIELD
L_.str.1:                               ## @.str.1
	.asciz	"Disable Gate"

	.comm	_FE_ERROR,4,2                   ## @FE_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"I/O error"

	.no_dead_strip	_stv090x_i2c_gate_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv090x_i2c_gate_ctrl
_stv090x_i2c_gate_ctrl:                 ; @stv090x_i2c_gate_ctrl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	w1, LBB0_3
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.2:
	add	x0, x19, #8
	mov	w1, #1
	blr	x8
	b	LBB0_7
LBB0_3:
Lloh0:
	adrp	x21, _I2CRPT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _I2CRPT@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_STV090x_READ_DEMOD
	mov	x20, x0
Lloh2:
	adrp	x8, _FE_DEBUG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FE_DEBUG@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #1
	bl	_dprintk
Lloh7:
	adrp	x8, _I2CT_ON_FIELD@GOTPAGE
Lloh8:
	ldr	x8, [x8, _I2CT_ON_FIELD@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_STV090x_SETFIELD_Px
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_STV090x_WRITE_DEMOD
	tbnz	x0, #63, LBB0_9
; %bb.4:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_14
; %bb.5:
	add	x0, x19, #8
	mov	w1, #0
	blr	x8
	b	LBB0_8
LBB0_6:
	ldr	x0, [x19]
	bl	_mutex_lock
LBB0_7:
Lloh10:
	adrp	x21, _I2CRPT@GOTPAGE
Lloh11:
	ldr	x21, [x21, _I2CRPT@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_STV090x_READ_DEMOD
	mov	x20, x0
Lloh12:
	adrp	x8, _FE_DEBUG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FE_DEBUG@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #1
	bl	_dprintk
Lloh17:
	adrp	x8, _I2CT_ON_FIELD@GOTPAGE
Lloh18:
	ldr	x8, [x8, _I2CT_ON_FIELD@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_STV090x_SETFIELD_Px
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_STV090x_WRITE_DEMOD
	tbnz	x0, #63, LBB0_9
LBB0_8:
	mov	w0, #0
	b	LBB0_13
LBB0_9:
Lloh20:
	adrp	x8, _FE_ERROR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FE_ERROR@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
Lloh23:
	adrp	x2, l_.str.2@PAGE
Lloh24:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w1, #1
	bl	_dprintk
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.10:
	add	x0, x19, #8
	mov	w1, #0
	blr	x8
	b	LBB0_12
LBB0_11:
	ldr	x0, [x19]
	bl	_mutex_unlock
LBB0_12:
	mov	w0, #-1
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_14:
	ldr	x0, [x19]
	bl	_mutex_unlock
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_I2CRPT,4,2                     ; @I2CRPT
	.comm	_FE_DEBUG,4,2                   ; @FE_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Enable Gate"

	.comm	_I2CT_ON_FIELD,4,2              ; @I2CT_ON_FIELD
l_.str.1:                               ; @.str.1
	.asciz	"Disable Gate"

	.comm	_FE_ERROR,4,2                   ; @FE_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"I/O error"

	.no_dead_strip	_stv090x_i2c_gate_ctrl
.subsections_via_symbols
