	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mcs_setup_transceiver
_mcs_setup_transceiver:                 ## @mcs_setup_transceiver
	.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_MODE_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	callq	_mcs_get_reg
	movl	%eax, %ebx
	xorl	%edi, %edi
	cmpl	$2, %eax
	setne	%dil
	callq	_unlikely
	leaq	L_.str(%rip), %r14
	testq	%rax, %rax
	jne	LBB0_21
## %bb.1:
	movq	_MCS_DRIVER@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %edx
	orl	(%rax), %edx
	movl	%edx, -44(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_mcs_set_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_21
## %bb.2:
	movl	$0, -44(%rbp)
	movq	_MCS_MINRXPW_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_mcs_set_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_21
## %bb.3:
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_mcs_get_reg
	movl	%eax, %ebx
	xorl	%edi, %edi
	cmpl	$2, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_21
## %bb.4:
	movq	_MCS_FIR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	-44(%rbp), %eax
	movq	_MCS_SIR16US@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	orl	%ecx, %eax
	cmpq	$0, 24(%r15)
	cmovel	%edx, %eax
	movq	_MCS_BBTG@GOTPCREL(%rip), %rcx
	movq	_MCS_ASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movq	_MCS_SPEED_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movq	_MCS_SPEED_9600@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	$9600, (%r15)                   ## imm = 0x2580
	movq	$0, 16(%r15)
	movq	_MCS_PLLPWDN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	%esi, %edx
	movq	_MCS_DTD@GOTPCREL(%rip), %rax
	movq	_MCS_SIPEN@GOTPCREL(%rip), %rcx
	orl	(%rax), %edx
	orl	(%rcx), %edx
	movl	%edx, -44(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_mcs_set_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_21
## %bb.5:
	movl	4(%r15), %esi
	cmpl	$130, %esi
	je	LBB0_10
## %bb.6:
	cmpl	$129, %esi
	je	LBB0_9
## %bb.7:
	cmpl	$128, %esi
	jne	LBB0_11
## %bb.8:
	movq	%r15, %rdi
	callq	_mcs_setup_transceiver_vishay
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_10:
	movq	%r15, %rdi
	callq	_mcs_setup_transceiver_agilent
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_9:
	movq	%r15, %rdi
	callq	_mcs_setup_transceiver_sharp
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str.2(%rip), %rdi
	callq	_IRDA_WARNING
	movl	$1, %ebx
LBB0_12:
	movl	%ebx, %edi
	callq	_unlikely
	leaq	L_.str.1(%rip), %r14
	testq	%rax, %rax
	je	LBB0_13
LBB0_21:
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	callq	_IRDA_ERROR
LBB0_22:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	cmpl	$129, 4(%r15)
	jne	LBB0_14
LBB0_19:
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_mcs_get_reg
	movl	%eax, %ebx
	xorl	%edi, %edi
	cmpl	$2, %eax
	setne	%dil
	callq	_unlikely
	leaq	L_.str.3(%rip), %r14
	testq	%rax, %rax
	jne	LBB0_21
## %bb.20:
	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, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_21
	jmp	LBB0_22
LBB0_14:
	movq	_MCS_XCVR_REG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_mcs_get_reg
	movl	%eax, %ebx
	xorl	%edi, %edi
	cmpl	$2, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_21
## %bb.15:
	cmpq	$0, 8(%r15)
	movq	_MCS_RXFAST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	je	LBB0_17
## %bb.16:
	orl	-44(%rbp), %edx
	jmp	LBB0_18
LBB0_17:
	notl	%edx
	andl	-44(%rbp), %edx
LBB0_18:
	movl	%edx, -44(%rbp)
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_mcs_set_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_21
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Basic transceiver setup error."

	.comm	_MCS_MODE_REG,4,2               ## @MCS_MODE_REG
	.comm	_MCS_DRIVER,4,2                 ## @MCS_DRIVER
	.comm	_MCS_MINRXPW_REG,4,2            ## @MCS_MINRXPW_REG
	.comm	_MCS_FIR,4,2                    ## @MCS_FIR
	.comm	_MCS_SIR16US,4,2                ## @MCS_SIR16US
	.comm	_MCS_BBTG,4,2                   ## @MCS_BBTG
	.comm	_MCS_ASK,4,2                    ## @MCS_ASK
	.comm	_MCS_SPEED_MASK,4,2             ## @MCS_SPEED_MASK
	.comm	_MCS_SPEED_9600,4,2             ## @MCS_SPEED_9600
	.comm	_MCS_PLLPWDN,4,2                ## @MCS_PLLPWDN
	.comm	_MCS_DTD,4,2                    ## @MCS_DTD
	.comm	_MCS_SIPEN,4,2                  ## @MCS_SIPEN
L_.str.1:                               ## @.str.1
	.asciz	"transceiver model specific setup error."

L_.str.2:                               ## @.str.2
	.asciz	"Unknown transceiver type: %d\n"

	.comm	_MCS_XCVR_REG,4,2               ## @MCS_XCVR_REG
	.comm	_MCS_RXFAST,4,2                 ## @MCS_RXFAST
L_.str.3:                               ## @.str.3
	.asciz	"transceiver reset."

	.comm	_MCS_RESET,4,2                  ## @MCS_RESET
L_.str.4:                               ## @.str.4
	.asciz	"%s\n"

	.no_dead_strip	_mcs_setup_transceiver
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mcs_setup_transceiver
_mcs_setup_transceiver:                 ; @mcs_setup_transceiver
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _MCS_MODE_REG@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MCS_MODE_REG@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_mcs_get_reg
	mov	x20, x0
	cmp	w0, #2
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.1:
Lloh2:
	adrp	x8, _MCS_DRIVER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MCS_DRIVER@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mcs_set_reg
	mov	x20, x0
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.2:
	str	wzr, [sp, #12]
Lloh5:
	adrp	x8, _MCS_MINRXPW_REG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MCS_MINRXPW_REG@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_mcs_set_reg
	mov	x20, x0
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.3:
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_mcs_get_reg
	mov	x20, x0
	cmp	w0, #2
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.4:
Lloh8:
	adrp	x8, _MCS_FIR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MCS_FIR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	ldr	x9, [x19, #24]
Lloh11:
	adrp	x10, _MCS_SIR16US@GOTPAGE
Lloh12:
	ldr	x10, [x10, _MCS_SIR16US@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	bic	w11, w8, w10
	orr	w8, w10, w8
	cmp	x9, #0
	csel	w8, w11, w8, eq
Lloh14:
	adrp	x9, _MCS_BBTG@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MCS_BBTG@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _MCS_ASK@GOTPAGE
Lloh18:
	ldr	x10, [x10, _MCS_ASK@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh20:
	adrp	x10, _MCS_SPEED_MASK@GOTPAGE
Lloh21:
	ldr	x10, [x10, _MCS_SPEED_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	orr	w9, w9, w10
	bic	w8, w8, w9
Lloh23:
	adrp	x9, _MCS_SPEED_9600@GOTPAGE
Lloh24:
	ldr	x9, [x9, _MCS_SPEED_9600@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w9, w8
	mov	w9, #9600
	str	w9, [x19]
	str	xzr, [x19, #16]
Lloh26:
	adrp	x9, _MCS_PLLPWDN@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MCS_PLLPWDN@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh29:
	adrp	x9, _MCS_DTD@GOTPAGE
Lloh30:
	ldr	x9, [x9, _MCS_DTD@GOTPAGEOFF]
Lloh31:
	adrp	x10, _MCS_SIPEN@GOTPAGE
Lloh32:
	ldr	x10, [x10, _MCS_SIPEN@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
Lloh34:
	ldr	w10, [x10]
	orr	w8, w9, w8
	orr	w2, w8, w10
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mcs_set_reg
	mov	x20, x0
	bl	_unlikely
	cbz	x0, LBB0_8
LBB0_5:
Lloh35:
	adrp	x1, l_.str@PAGE
Lloh36:
	add	x1, x1, l_.str@PAGEOFF
LBB0_6:
Lloh37:
	adrp	x0, l_.str.4@PAGE
Lloh38:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_IRDA_ERROR
LBB0_7:
	mov	x0, x20
	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
LBB0_8:
	ldr	w1, [x19, #4]
	cmp	w1, #130
	b.eq	LBB0_12
; %bb.9:
	cmp	w1, #129
	b.eq	LBB0_13
; %bb.10:
	cmp	w1, #128
	b.ne	LBB0_14
; %bb.11:
	mov	x0, x19
	bl	_mcs_setup_transceiver_vishay
	mov	x20, x0
	b	LBB0_15
LBB0_12:
	mov	x0, x19
	bl	_mcs_setup_transceiver_agilent
	mov	x20, x0
	b	LBB0_15
LBB0_13:
	mov	x0, x19
	bl	_mcs_setup_transceiver_sharp
	mov	x20, x0
	b	LBB0_15
LBB0_14:
Lloh39:
	adrp	x0, l_.str.2@PAGE
Lloh40:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IRDA_WARNING
	mov	w20, #1
LBB0_15:
	mov	x0, x20
	bl	_unlikely
	cbz	x0, LBB0_17
LBB0_16:
Lloh41:
	adrp	x1, l_.str.1@PAGE
Lloh42:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_17:
	ldr	w8, [x19, #4]
	cmp	w8, #129
	b.ne	LBB0_21
LBB0_18:
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_mcs_get_reg
	mov	x20, x0
	cmp	w0, #2
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_20
; %bb.19:
Lloh43:
	adrp	x8, _MCS_RESET@GOTPAGE
Lloh44:
	ldr	x8, [x8, _MCS_RESET@GOTPAGEOFF]
Lloh45:
	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
	bl	_unlikely
	cbz	x0, LBB0_7
LBB0_20:
Lloh46:
	adrp	x1, l_.str.3@PAGE
Lloh47:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_6
LBB0_21:
Lloh48:
	adrp	x22, _MCS_XCVR_REG@GOTPAGE
Lloh49:
	ldr	x22, [x22, _MCS_XCVR_REG@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_mcs_get_reg
	mov	x20, x0
	cmp	w0, #2
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_16
; %bb.22:
	ldr	x9, [x19, #8]
Lloh50:
	adrp	x8, _MCS_RXFAST@GOTPAGE
Lloh51:
	ldr	x8, [x8, _MCS_RXFAST@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	cbz	x9, LBB0_24
; %bb.23:
	ldr	w9, [sp, #12]
	orr	w2, w9, w8
	b	LBB0_25
LBB0_24:
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
LBB0_25:
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_mcs_set_reg
	mov	x20, x0
	bl	_unlikely
	cbnz	x0, LBB0_16
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh33
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Basic transceiver setup error."

	.comm	_MCS_MODE_REG,4,2               ; @MCS_MODE_REG
	.comm	_MCS_DRIVER,4,2                 ; @MCS_DRIVER
	.comm	_MCS_MINRXPW_REG,4,2            ; @MCS_MINRXPW_REG
	.comm	_MCS_FIR,4,2                    ; @MCS_FIR
	.comm	_MCS_SIR16US,4,2                ; @MCS_SIR16US
	.comm	_MCS_BBTG,4,2                   ; @MCS_BBTG
	.comm	_MCS_ASK,4,2                    ; @MCS_ASK
	.comm	_MCS_SPEED_MASK,4,2             ; @MCS_SPEED_MASK
	.comm	_MCS_SPEED_9600,4,2             ; @MCS_SPEED_9600
	.comm	_MCS_PLLPWDN,4,2                ; @MCS_PLLPWDN
	.comm	_MCS_DTD,4,2                    ; @MCS_DTD
	.comm	_MCS_SIPEN,4,2                  ; @MCS_SIPEN
l_.str.1:                               ; @.str.1
	.asciz	"transceiver model specific setup error."

l_.str.2:                               ; @.str.2
	.asciz	"Unknown transceiver type: %d\n"

	.comm	_MCS_XCVR_REG,4,2               ; @MCS_XCVR_REG
	.comm	_MCS_RXFAST,4,2                 ; @MCS_RXFAST
l_.str.3:                               ; @.str.3
	.asciz	"transceiver reset."

	.comm	_MCS_RESET,4,2                  ; @MCS_RESET
l_.str.4:                               ; @.str.4
	.asciz	"%s\n"

	.no_dead_strip	_mcs_setup_transceiver
.subsections_via_symbols
