	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt312_send_master_cmd
_mt312_send_master_cmd:                 ## @mt312_send_master_cmd
	.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
	movl	(%rsi), %eax
	addl	$-9, %eax
	cmpl	$-9, %eax
	ja	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_2:
	movq	%rsi, %rbx
	movq	(%rdi), %r14
	movq	_DISEQC_MODE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_mt312_readreg
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	movq	_DISEQC_INSTR@GOTPCREL(%rip), %rax
	movl	$128, %esi
	orl	(%rax), %esi
	movq	8(%rbx), %rdx
	movl	(%rbx), %ecx
	movq	%r14, %rdi
	callq	_mt312_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.4:
	movl	(%r15), %esi
	movl	-28(%rbp), %eax
	andl	$64, %eax
	movl	(%rbx), %ecx
	leal	-8(,%rcx,8), %edx
	orl	%eax, %edx
	orl	$4, %edx
	movq	%r14, %rdi
	callq	_mt312_writereg
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:
	movl	$100, %edi
	callq	_msleep
	movq	8(%rbx), %rax
	testb	$2, (%rax)
	je	LBB0_7
## %bb.6:
	movl	(%r15), %esi
	movl	-28(%rbp), %edx
	andl	$64, %edx
	movq	%r14, %rdi
	callq	_mt312_writereg
	testl	%eax, %eax
	js	LBB0_8
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DISEQC_MODE,4,2                ## @DISEQC_MODE
	.comm	_DISEQC_INSTR,4,2               ## @DISEQC_INSTR
	.no_dead_strip	_mt312_send_master_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt312_send_master_cmd
_mt312_send_master_cmd:                 ; @mt312_send_master_cmd
	.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
	ldr	w8, [x1]
	sub	w8, w8, #9
	cmn	w8, #9
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_2:
	mov	x20, x1
	ldr	x19, [x0]
Lloh3:
	adrp	x21, _DISEQC_MODE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _DISEQC_MODE@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_mt312_readreg
	tbnz	w0, #31, LBB0_8
; %bb.3:
Lloh5:
	adrp	x8, _DISEQC_INSTR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DISEQC_INSTR@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w1, w8, #0x80
	ldr	x2, [x20, #8]
	ldr	w3, [x20]
	mov	x0, x19
	bl	_mt312_write
	tbnz	w0, #31, LBB0_8
; %bb.4:
	ldr	w1, [x21]
	ldr	w8, [sp, #12]
	and	w8, w8, #0x40
	ldr	w9, [x20]
	lsl	w9, w9, #3
	sub	w9, w9, #8
	orr	w8, w8, w9
	orr	w2, w8, #0x4
	mov	x0, x19
	bl	_mt312_writereg
	tbnz	w0, #31, LBB0_8
; %bb.5:
	mov	w0, #100
	bl	_msleep
	ldr	x8, [x20, #8]
	ldrb	w8, [x8]
	tbz	w8, #1, LBB0_7
; %bb.6:
	ldr	w1, [x21]
	ldr	w8, [sp, #12]
	and	w2, w8, #0x40
	mov	x0, x19
	bl	_mt312_writereg
	tbnz	w0, #31, LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DISEQC_MODE,4,2                ; @DISEQC_MODE
	.comm	_DISEQC_INSTR,4,2               ; @DISEQC_INSTR
	.no_dead_strip	_mt312_send_master_cmd
.subsections_via_symbols
