	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mceusb_init_rc_dev
_mceusb_init_rc_dev:                    ## @mceusb_init_rc_dev
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	24(%rdi), %r12
	movq	40(%rdi), %r14
	movq	_RC_DRIVER_IR_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rc_allocate_device
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	36(%r15), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_mceusb_model@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r15), %rcx
	movq	24(%r15), %rdx
	leaq	(%rcx,%rcx,2), %rcx
	movq	(%rax,%rcx,8), %rax
	testq	%rax, %rax
	leaq	L_.str.2(%rip), %r13
	cmovneq	%rax, %r13
	movl	(%rdx), %edi
	callq	_le16_to_cpu
	movq	%r14, %r12
	movl	%eax, %r14d
	movq	24(%r15), %rax
	movl	4(%rax), %edi
	callq	_le16_to_cpu
	leaq	L_.str.1(%rip), %rdx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$4, %esi
	movq	%r13, %rcx
	movl	%r14d, %r8d
	movq	%r12, %r14
	movq	_mceusb_model@GOTPCREL(%rip), %r12
	movl	%eax, %r9d
	callq	_snprintf
	movq	24(%r15), %rdi
	movl	32(%r15), %esi
	movl	$4, %edx
	callq	_usb_make_path
	movl	36(%r15), %eax
	movl	%eax, 80(%rbx)
	movl	32(%r15), %eax
	movl	%eax, 76(%rbx)
	movq	24(%r15), %rdi
	movq	%rbx, %rsi
	addq	$72, %rsi
	callq	_usb_to_input_id
	movq	%r14, 64(%rbx)
	movq	%r15, 56(%rbx)
	movq	_RC_PROTO_BIT_ALL_IR_DECODER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	_MCE_TIME_UNIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_US_TO_NS
	movl	%eax, 44(%rbx)
	movl	$100, %edi
	callq	_MS_TO_NS
	movl	%eax, (%rbx)
	movq	(%r12), %rcx
	movq	(%r15), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	cmpl	$0, 16(%rcx,%rdx,8)
	jne	LBB0_4
## %bb.3:
	movq	_mceusb_set_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	_IR_DEFAULT_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %eax
LBB0_4:
	movl	%eax, 4(%rbx)
	cmpl	$0, 16(%r15)
	je	LBB0_5
## %bb.6:
	cmpq	$0, 8(%r15)
	jle	LBB0_8
LBB0_7:
	movq	_mceusb_set_rx_wideband@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_mceusb_set_rx_carrier_report@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
LBB0_8:
	movq	_DRIVER_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_le16_to_cpu
	cmpl	$128, %eax
	jne	LBB0_9
## %bb.10:
	movq	_RC_MAP_PINNACLE_PCTV_HD@GOTPCREL(%rip), %rcx
	cmpl	$129, %eax
	je	LBB0_12
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_15
LBB0_9:
	movq	_RC_MAP_RC6_MCE@GOTPCREL(%rip), %rcx
	cmpl	$129, %eax
	jne	LBB0_13
LBB0_12:
	movq	_RC_MAP_HAUPPAUGE@GOTPCREL(%rip), %rcx
LBB0_13:
	movq	(%rcx), %rax
	movq	%rax, 8(%rbx)
	movq	(%r12), %rcx
	movq	(%r15), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	movq	8(%rcx,%rdx,8), %rcx
	testq	%rcx, %rcx
	cmoveq	%rax, %rcx
	movq	%rcx, 8(%rbx)
	movq	%rbx, %rdi
	callq	_rc_register_device
	testl	%eax, %eax
	jns	LBB0_16
## %bb.14:
	leaq	L_.str.3(%rip), %rsi
LBB0_15:
	movq	%r14, %rdi
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_rc_free_device
	xorl	%ebx, %ebx
LBB0_16:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_mceusb_set_tx_mask@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movq	_mceusb_set_tx_carrier@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_mceusb_tx_ir@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	cmpq	$0, 8(%r15)
	jg	LBB0_7
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_RC_DRIVER_IR_RAW,4,2           ## @RC_DRIVER_IR_RAW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"remote dev allocation failed"

L_.str.1:                               ## @.str.1
	.asciz	"%s (%04x:%04x)"

	.comm	_mceusb_model,8,3               ## @mceusb_model
L_.str.2:                               ## @.str.2
	.asciz	"Media Center Ed. eHome Infrared Remote Transceiver"

	.comm	_RC_PROTO_BIT_ALL_IR_DECODER,4,2 ## @RC_PROTO_BIT_ALL_IR_DECODER
	.comm	_MCE_TIME_UNIT,4,2              ## @MCE_TIME_UNIT
	.comm	_mceusb_set_timeout,4,2         ## @mceusb_set_timeout
	.comm	_IR_DEFAULT_TIMEOUT,4,2         ## @IR_DEFAULT_TIMEOUT
	.comm	_mceusb_set_tx_mask,4,2         ## @mceusb_set_tx_mask
	.comm	_mceusb_set_tx_carrier,4,2      ## @mceusb_set_tx_carrier
	.comm	_mceusb_tx_ir,4,2               ## @mceusb_tx_ir
	.comm	_mceusb_set_rx_wideband,4,2     ## @mceusb_set_rx_wideband
	.comm	_mceusb_set_rx_carrier_report,4,2 ## @mceusb_set_rx_carrier_report
	.comm	_DRIVER_NAME,4,2                ## @DRIVER_NAME
	.comm	_RC_MAP_HAUPPAUGE,8,3           ## @RC_MAP_HAUPPAUGE
	.comm	_RC_MAP_PINNACLE_PCTV_HD,8,3    ## @RC_MAP_PINNACLE_PCTV_HD
	.comm	_RC_MAP_RC6_MCE,8,3             ## @RC_MAP_RC6_MCE
L_.str.3:                               ## @.str.3
	.asciz	"remote dev registration failed"

	.no_dead_strip	_mceusb_init_rc_dev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mceusb_init_rc_dev
_mceusb_init_rc_dev:                    ; @mceusb_init_rc_dev
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x0
	ldr	x26, [x0, #24]
	ldr	x20, [x0, #40]
Lloh0:
	adrp	x8, _RC_DRIVER_IR_RAW@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RC_DRIVER_IR_RAW@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_rc_allocate_device
	mov	x19, x0
	cbz	x0, LBB0_9
; %bb.1:
	ldr	w22, [x21, #36]
Lloh3:
	adrp	x25, _mceusb_model@GOTPAGE
Lloh4:
	ldr	x25, [x25, _mceusb_model@GOTPAGEOFF]
	ldr	x8, [x25]
	ldr	x9, [x21]
	mov	w27, #24
	mul	x9, x9, x27
	ldr	x8, [x8, x9]
Lloh5:
	adrp	x9, l_.str.2@PAGE
Lloh6:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x8, #0
	csel	x23, x9, x8, eq
	ldr	x8, [x21, #24]
	ldr	w0, [x8]
	bl	_le16_to_cpu
	mov	x24, x0
	ldr	x8, [x21, #24]
	ldr	w0, [x8, #4]
	bl	_le16_to_cpu
	mov	x5, x0
Lloh7:
	adrp	x2, l_.str.1@PAGE
Lloh8:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	w1, #4
	mov	x3, x23
	mov	x4, x24
	bl	_snprintf
	ldr	x0, [x21, #24]
	ldr	w1, [x21, #32]
	mov	w2, #4
	bl	_usb_make_path
	ldr	d0, [x21, #32]
	stur	d0, [x19, #76]
	ldr	x0, [x21, #24]
	add	x1, x19, #72
	bl	_usb_to_input_id
Lloh9:
	adrp	x8, _RC_PROTO_BIT_ALL_IR_DECODER@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RC_PROTO_BIT_ALL_IR_DECODER@GOTPAGEOFF]
	stp	x21, x20, [x19, #56]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #48]
Lloh12:
	adrp	x8, _MCE_TIME_UNIT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MCE_TIME_UNIT@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_US_TO_NS
	str	w0, [x19, #44]
	mov	w0, #100
	bl	_MS_TO_NS
	str	w0, [x19]
	ldr	x8, [x25]
	ldr	x9, [x21]
	madd	x8, x9, x27, x8
	ldr	w8, [x8, #16]
	cbnz	w8, LBB0_3
; %bb.2:
Lloh15:
	adrp	x8, _mceusb_set_timeout@GOTPAGE
Lloh16:
	ldr	x8, [x8, _mceusb_set_timeout@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x19, #40]
Lloh18:
	adrp	x8, _IR_DEFAULT_TIMEOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IR_DEFAULT_TIMEOUT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #2
	lsl	w0, w8, #1
LBB0_3:
	str	w0, [x19, #4]
	ldr	w8, [x21, #16]
	cbnz	w8, LBB0_5
; %bb.4:
Lloh21:
	adrp	x8, _mceusb_set_tx_mask@GOTPAGE
Lloh22:
	ldr	x8, [x8, _mceusb_set_tx_mask@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x19, #36]
Lloh24:
	adrp	x8, _mceusb_set_tx_carrier@GOTPAGE
Lloh25:
	ldr	x8, [x8, _mceusb_set_tx_carrier@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _mceusb_tx_ir@GOTPAGE
Lloh28:
	ldr	x9, [x9, _mceusb_tx_ir@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #28]
LBB0_5:
	ldr	x8, [x21, #8]
	cmp	x8, #1
	b.lt	LBB0_7
; %bb.6:
Lloh30:
	adrp	x8, _mceusb_set_rx_wideband@GOTPAGE
Lloh31:
	ldr	x8, [x8, _mceusb_set_rx_wideband@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _mceusb_set_rx_carrier_report@GOTPAGE
Lloh34:
	ldr	x9, [x9, _mceusb_set_rx_carrier_report@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #20]
LBB0_7:
Lloh36:
	adrp	x8, _DRIVER_NAME@GOTPAGE
Lloh37:
	ldr	x8, [x8, _DRIVER_NAME@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	ldr	w0, [x26]
	bl	_le16_to_cpu
Lloh39:
	adrp	x8, _RC_MAP_HAUPPAUGE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _RC_MAP_HAUPPAUGE@GOTPAGEOFF]
Lloh41:
	adrp	x9, _RC_MAP_PINNACLE_PCTV_HD@GOTPAGE
Lloh42:
	ldr	x9, [x9, _RC_MAP_PINNACLE_PCTV_HD@GOTPAGEOFF]
Lloh43:
	adrp	x10, _RC_MAP_RC6_MCE@GOTPAGE
Lloh44:
	ldr	x10, [x10, _RC_MAP_RC6_MCE@GOTPAGEOFF]
	cmp	w0, #128
	csel	x9, x9, x10, eq
	cmp	w0, #129
	csel	x8, x8, x9, eq
	ldr	x8, [x8]
	str	x8, [x19, #8]
	ldr	x9, [x25]
	ldr	x10, [x21]
	mov	w11, #24
	madd	x9, x10, x11, x9
	ldr	x9, [x9, #8]
	cmp	x9, #0
	csel	x8, x8, x9, eq
	str	x8, [x19, #8]
	mov	x0, x19
	bl	_rc_register_device
	tbz	w0, #31, LBB0_11
; %bb.8:
Lloh45:
	adrp	x1, l_.str.3@PAGE
Lloh46:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh47:
	adrp	x1, l_.str@PAGE
Lloh48:
	add	x1, x1, l_.str@PAGEOFF
LBB0_10:
	mov	x0, x20
	bl	_dev_err
	mov	x0, x19
	bl	_rc_free_device
	mov	x19, #0
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_RC_DRIVER_IR_RAW,4,2           ; @RC_DRIVER_IR_RAW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"remote dev allocation failed"

l_.str.1:                               ; @.str.1
	.asciz	"%s (%04x:%04x)"

	.comm	_mceusb_model,8,3               ; @mceusb_model
l_.str.2:                               ; @.str.2
	.asciz	"Media Center Ed. eHome Infrared Remote Transceiver"

	.comm	_RC_PROTO_BIT_ALL_IR_DECODER,4,2 ; @RC_PROTO_BIT_ALL_IR_DECODER
	.comm	_MCE_TIME_UNIT,4,2              ; @MCE_TIME_UNIT
	.comm	_mceusb_set_timeout,4,2         ; @mceusb_set_timeout
	.comm	_IR_DEFAULT_TIMEOUT,4,2         ; @IR_DEFAULT_TIMEOUT
	.comm	_mceusb_set_tx_mask,4,2         ; @mceusb_set_tx_mask
	.comm	_mceusb_set_tx_carrier,4,2      ; @mceusb_set_tx_carrier
	.comm	_mceusb_tx_ir,4,2               ; @mceusb_tx_ir
	.comm	_mceusb_set_rx_wideband,4,2     ; @mceusb_set_rx_wideband
	.comm	_mceusb_set_rx_carrier_report,4,2 ; @mceusb_set_rx_carrier_report
	.comm	_DRIVER_NAME,4,2                ; @DRIVER_NAME
	.comm	_RC_MAP_HAUPPAUGE,8,3           ; @RC_MAP_HAUPPAUGE
	.comm	_RC_MAP_PINNACLE_PCTV_HD,8,3    ; @RC_MAP_PINNACLE_PCTV_HD
	.comm	_RC_MAP_RC6_MCE,8,3             ; @RC_MAP_RC6_MCE
l_.str.3:                               ; @.str.3
	.asciz	"remote dev registration failed"

	.no_dead_strip	_mceusb_init_rc_dev
.subsections_via_symbols
