	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mcs_speed_change
_mcs_speed_change:                      ## @mcs_speed_change
	.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
	movq	_mcs_speed_set@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rdi), %ecx
	shrq	$6, %rcx
	andl	$60, %ecx
	movl	(%rax,%rcx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	$-1, %ebx
	movq	_MCS_RESV_REG@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %r12
	movq	_MCS_IRINTX@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movl	(%r13), %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_mcs_get_reg
	cmpl	$99, %ebx
	ja	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r14), %eax
	andl	-44(%rbp), %eax
	jne	LBB0_1
LBB0_3:
	cmpl	$100, %ebx
	jb	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_IRDA_ERROR
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_24
LBB0_5:
	movq	_MCS_MODE_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_mcs_get_reg
	movl	(%r15), %eax
	cmpl	$115200, %eax                   ## imm = 0x1C200
	jg	LBB0_7
## %bb.6:
	movq	_MCS_FIR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, -44(%rbp)
	xorl	%edx, %edx
	cmpl	$115200, 4(%r15)                ## imm = 0x1C200
	movl	$0, %ebx
	jg	LBB0_10
	jmp	LBB0_13
LBB0_7:
	movq	_MCS_FIR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	$1152000, %eax                  ## imm = 0x119400
	ja	LBB0_11
## %bb.8:
	notl	%ecx
	andl	%ecx, -44(%rbp)
	movl	4(%r15), %eax
	xorl	%ebx, %ebx
	cmpl	$576000, %eax                   ## imm = 0x8CA00
	je	LBB0_13
## %bb.9:
	movl	$5, %edx
	cmpl	$1152000, %eax                  ## imm = 0x119400
	je	LBB0_13
	jmp	LBB0_10
LBB0_11:
	orl	%ecx, -44(%rbp)
	movl	$5, %edx
	cmpl	$4000000, 4(%r15)               ## imm = 0x3D0900
	jne	LBB0_10
## %bb.12:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_10:
	movq	_MCS_MINRXPW_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_mcs_set_reg
	movb	$1, %bl
LBB0_13:
	movq	_MCS_SPEED_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-44(%rbp), %edx
	orl	-48(%rbp), %edx                 ## 4-byte Folded Reload
	movl	%edx, -44(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_mcs_set_reg
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_24
## %bb.14:
	testb	%bl, %bl
	je	LBB0_22
## %bb.15:
	movl	8(%r15), %esi
	cmpl	$130, %esi
	je	LBB0_20
## %bb.16:
	cmpl	$129, %esi
	je	LBB0_19
## %bb.17:
	cmpl	$128, %esi
	jne	LBB0_21
## %bb.18:
	movq	%r15, %rdi
	callq	_mcs_setup_transceiver_vishay
	movl	%eax, %r14d
	jmp	LBB0_22
LBB0_20:
	movq	%r15, %rdi
	callq	_mcs_setup_transceiver_agilent
	movl	%eax, %r14d
	jmp	LBB0_22
LBB0_19:
	movq	%r15, %rdi
	callq	_mcs_setup_transceiver_sharp
	movl	%eax, %r14d
	jmp	LBB0_22
LBB0_21:
	leaq	L_.str.1(%rip), %rdi
	callq	_IRDA_WARNING
	movl	$1, %r14d
LBB0_22:
	movl	%r14d, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_24
## %bb.23:
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_mcs_get_reg
	movq	_MCS_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-44(%rbp), %edx
	movl	%edx, -44(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_mcs_set_reg
	movl	%eax, %r14d
	movl	(%r15), %eax
	movl	%eax, 4(%r15)
LBB0_24:
	movl	$0, (%r15)
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mcs_speed_set,8,3              ## @mcs_speed_set
	.comm	_MCS_RESV_REG,4,2               ## @MCS_RESV_REG
	.comm	_MCS_IRINTX,4,2                 ## @MCS_IRINTX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to change speed\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_MCS_MODE_REG,4,2               ## @MCS_MODE_REG
	.comm	_MCS_FIR,4,2                    ## @MCS_FIR
	.comm	_MCS_MINRXPW_REG,4,2            ## @MCS_MINRXPW_REG
	.comm	_MCS_SPEED_MASK,4,2             ## @MCS_SPEED_MASK
L_.str.1:                               ## @.str.1
	.asciz	"Unknown transceiver type: %d\n"

	.comm	_MCS_RESET,4,2                  ## @MCS_RESET
	.no_dead_strip	_mcs_speed_change
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mcs_speed_change
_mcs_speed_change:                      ; @mcs_speed_change
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
Lloh0:
	adrp	x8, _mcs_speed_set@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mcs_speed_set@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w9, [x0]
	ubfx	x9, x9, #8, #4
	ldr	w20, [x8, x9, lsl #2]
	mov	w21, #-1
Lloh3:
	adrp	x22, _MCS_RESV_REG@GOTPAGE
Lloh4:
	ldr	x22, [x22, _MCS_RESV_REG@GOTPAGEOFF]
Lloh5:
	adrp	x23, _MCS_IRINTX@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MCS_IRINTX@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	w21, w21, #1
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_mcs_get_reg
	cmp	w21, #99
	b.hi	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x23]
	and	w8, w9, w8
	cbnz	w8, LBB0_1
LBB0_3:
	cmp	w21, #100
	b.lo	LBB0_5
; %bb.4:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IRDA_ERROR
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_25
LBB0_5:
	mov	w23, #49664
	movk	w23, #1, lsl #16
Lloh12:
	adrp	x21, _MCS_MODE_REG@GOTPAGE
Lloh13:
	ldr	x21, [x21, _MCS_MODE_REG@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_mcs_get_reg
	ldr	w9, [x19]
	orr	w8, w23, #0x1
	cmp	w9, w8
	b.ge	LBB0_7
; %bb.6:
	mov	w2, #0
	mov	w22, #0
Lloh14:
	adrp	x8, _MCS_FIR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MCS_FIR@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	str	w8, [sp, #12]
	ldr	w8, [x19, #4]
	cmp	w8, w23
	b.gt	LBB0_13
	b	LBB0_14
LBB0_7:
Lloh17:
	adrp	x8, _MCS_FIR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MCS_FIR@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	mov	w10, #37888
	movk	w10, #17, lsl #16
	cmp	w9, w10
	b.hi	LBB0_10
; %bb.8:
	mov	w22, #0
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	str	w8, [sp, #12]
	ldr	w8, [x19, #4]
	sub	w9, w8, #140, lsl #12           ; =573440
	cmp	w9, #2560
	b.eq	LBB0_14
; %bb.9:
	mov	w9, #37888
	movk	w9, #17, lsl #16
	cmp	w8, w9
	b.eq	LBB0_14
	b	LBB0_12
LBB0_10:
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
	str	w8, [sp, #12]
	ldr	w8, [x19, #4]
	sub	w8, w8, #976, lsl #12           ; =3997696
	cmp	w8, #2304
	b.ne	LBB0_12
; %bb.11:
	mov	w22, #0
	b	LBB0_14
LBB0_12:
	mov	w2, #5
LBB0_13:
Lloh20:
	adrp	x8, _MCS_MINRXPW_REG@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MCS_MINRXPW_REG@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mcs_set_reg
	mov	w22, #1
LBB0_14:
Lloh23:
	adrp	x8, _MCS_SPEED_MASK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MCS_SPEED_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	orr	w2, w8, w20
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mcs_set_reg
	mov	x20, x0
	bl	_unlikely
	cbnz	x0, LBB0_25
; %bb.15:
	cbz	w22, LBB0_23
; %bb.16:
	ldr	w1, [x19, #8]
	cmp	w1, #130
	b.eq	LBB0_20
; %bb.17:
	cmp	w1, #129
	b.eq	LBB0_21
; %bb.18:
	cmp	w1, #128
	b.ne	LBB0_22
; %bb.19:
	mov	x0, x19
	bl	_mcs_setup_transceiver_vishay
	mov	x20, x0
	b	LBB0_23
LBB0_20:
	mov	x0, x19
	bl	_mcs_setup_transceiver_agilent
	mov	x20, x0
	b	LBB0_23
LBB0_21:
	mov	x0, x19
	bl	_mcs_setup_transceiver_sharp
	mov	x20, x0
	b	LBB0_23
LBB0_22:
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IRDA_WARNING
	mov	w20, #1
LBB0_23:
	mov	x0, x20
	bl	_unlikely
	cbnz	x0, LBB0_25
; %bb.24:
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_mcs_get_reg
Lloh28:
	adrp	x8, _MCS_RESET@GOTPAGE
Lloh29:
	ldr	x8, [x8, _MCS_RESET@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mcs_set_reg
	mov	x20, x0
	ldr	w8, [x19]
	str	w8, [x19, #4]
LBB0_25:
	str	wzr, [x19]
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_mcs_speed_set,8,3              ; @mcs_speed_set
	.comm	_MCS_RESV_REG,4,2               ; @MCS_RESV_REG
	.comm	_MCS_IRINTX,4,2                 ; @MCS_IRINTX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to change speed\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_MCS_MODE_REG,4,2               ; @MCS_MODE_REG
	.comm	_MCS_FIR,4,2                    ; @MCS_FIR
	.comm	_MCS_MINRXPW_REG,4,2            ; @MCS_MINRXPW_REG
	.comm	_MCS_SPEED_MASK,4,2             ; @MCS_SPEED_MASK
l_.str.1:                               ; @.str.1
	.asciz	"Unknown transceiver type: %d\n"

	.comm	_MCS_RESET,4,2                  ; @MCS_RESET
	.no_dead_strip	_mcs_speed_change
.subsections_via_symbols
