	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function external_encoder_control_v3
_external_encoder_control_v3:           ## @external_encoder_control_v3
	.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	%r12
	pushq	%rbx
	subq	$112, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	_BP_RESULT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	-88(%rbp), %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movl	40(%r12), %ebx
	movl	%ebx, %edi
	callq	_dal_graphics_object_id_get_encoder_id
	addl	$-131, %eax
	cmpl	$1, %eax
	ja	LBB0_5
## %bb.1:
	shll	$4, %ebx
	addl	$-16, %ebx
	movl	%ebx, -88(%rbp)
	movl	(%r12), %eax
	cmpl	$128, %eax
	je	LBB0_7
## %bb.2:
	cmpl	$129, %eax
	je	LBB0_6
## %bb.3:
	cmpl	$130, %eax
	jne	LBB0_11
## %bb.4:
	movslq	4(%r12), %rax
	imulq	$1717986919, %rax, %rdi         ## imm = 0x66666667
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$34, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_cpu_to_le16
	movq	%rax, -56(%rbp)
	movq	(%r15), %rax
	movl	16(%r12), %edi
	xorl	%esi, %esi
	callq	*(%rax)
	movq	%rax, -64(%rbp)
	jmp	LBB0_10
LBB0_5:
	xorl	%eax, %eax
	callq	_BREAK_TO_DEBUGGER
	movq	_BP_RESULT_BADINPUT@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_6:
	movl	36(%r12), %edi
	callq	_cpu_to_le16
	movq	%rax, -40(%rbp)
	jmp	LBB0_11
LBB0_7:
	movslq	4(%r12), %rax
	imulq	$1717986919, %rax, %rdi         ## imm = 0x66666667
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$34, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_cpu_to_le16
	movq	%rax, -56(%rbp)
	movq	(%r15), %rax
	movl	16(%r12), %edi
	xorl	%esi, %esi
	callq	*(%rax)
	movq	%rax, -64(%rbp)
	movq	_LINK_RATE_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	32(%r12), %eax
	jne	LBB0_9
## %bb.8:
	orb	$1, -88(%rbp)
LBB0_9:
	movq	24(%r12), %rax
	movq	%rax, -48(%rbp)
LBB0_10:
	movq	8(%r12), %rax
	movq	%rax, -72(%rbp)
LBB0_11:
	movslq	(%r12), %rax
	movq	%rax, -80(%rbp)
	movq	_ExternalEncoderControl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-40(%rbp), %rax
	movq	%rax, 48(%rsp)
	movups	-88(%rbp), %xmm0
	movups	-72(%rbp), %xmm1
	movups	-56(%rbp), %xmm2
	movups	%xmm2, 32(%rsp)
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_EXEC_BIOS_CMD_TABLE
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movq	_BP_RESULT_OK@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %r14d
LBB0_14:
	movl	%r14d, %eax
	addq	$112, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BP_RESULT_FAILURE,4,2          ## @BP_RESULT_FAILURE
	.comm	_BP_RESULT_BADINPUT,4,2         ## @BP_RESULT_BADINPUT
	.comm	_LINK_RATE_HIGH,4,2             ## @LINK_RATE_HIGH
	.comm	_ExternalEncoderControl,4,2     ## @ExternalEncoderControl
	.comm	_BP_RESULT_OK,4,2               ## @BP_RESULT_OK
	.no_dead_strip	_external_encoder_control_v3
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function external_encoder_control_v3
_external_encoder_control_v3:           ; @external_encoder_control_v3
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _BP_RESULT_FAILURE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BP_RESULT_FAILURE@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	add	x0, sp, #56
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	ldr	w21, [x19, #40]
	mov	x0, x21
	bl	_dal_graphics_object_id_get_encoder_id
	sub	w8, w0, #131
	cmp	w8, #1
	b.hi	LBB0_5
; %bb.1:
	lsl	w8, w21, #4
	sub	w8, w8, #16
	str	w8, [sp, #56]
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #129
	b.eq	LBB0_6
; %bb.3:
	cmp	w8, #130
	b.ne	LBB0_10
; %bb.4:
	ldrsw	x8, [x19, #4]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w0, w8, w9, asr #2
	bl	_cpu_to_le16
	str	x0, [sp, #88]
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w0, [x19, #16]
	mov	w1, #0
	blr	x8
	ldr	x8, [x19, #8]
	stp	x8, x0, [sp, #72]
	b	LBB0_10
LBB0_5:
	bl	_BREAK_TO_DEBUGGER
Lloh3:
	adrp	x8, _BP_RESULT_BADINPUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BP_RESULT_BADINPUT@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_11
LBB0_6:
	ldr	w0, [x19, #36]
	bl	_cpu_to_le16
	str	x0, [sp, #104]
	b	LBB0_10
LBB0_7:
	ldrsw	x8, [x19, #4]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w0, w8, w9, asr #2
	bl	_cpu_to_le16
	str	x0, [sp, #88]
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w0, [x19, #16]
	mov	w1, #0
	blr	x8
	str	x0, [sp, #80]
Lloh6:
	adrp	x8, _LINK_RATE_HIGH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LINK_RATE_HIGH@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x19, #32]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.8:
	ldr	w8, [sp, #56]
	orr	w8, w8, #0x1
	str	w8, [sp, #56]
LBB0_9:
	ldr	x8, [x19, #24]
	ldr	x9, [x19, #8]
	str	x8, [sp, #96]
	str	x9, [sp, #72]
LBB0_10:
	ldrsw	x8, [x19]
	str	x8, [sp, #64]
Lloh9:
	adrp	x8, _ExternalEncoderControl@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ExternalEncoderControl@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldur	q0, [sp, #56]
	ldur	q1, [sp, #72]
	stp	q0, q1, [sp]
	ldur	q0, [sp, #88]
	str	q0, [sp, #32]
	ldr	x8, [sp, #104]
	str	x8, [sp, #48]
	mov	x1, sp
	bl	_EXEC_BIOS_CMD_TABLE
Lloh12:
	adrp	x8, _BP_RESULT_OK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BP_RESULT_OK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w0, w22, w8, eq
LBB0_11:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_BP_RESULT_FAILURE,4,2          ; @BP_RESULT_FAILURE
	.comm	_BP_RESULT_BADINPUT,4,2         ; @BP_RESULT_BADINPUT
	.comm	_LINK_RATE_HIGH,4,2             ; @LINK_RATE_HIGH
	.comm	_ExternalEncoderControl,4,2     ; @ExternalEncoderControl
	.comm	_BP_RESULT_OK,4,2               ; @BP_RESULT_OK
	.no_dead_strip	_external_encoder_control_v3
.subsections_via_symbols
