	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function redrat3_init_rc_dev
_redrat3_init_rc_dev:                   ## @redrat3_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	16(%rdi), %r14
	movl	(%rax), %edi
	callq	_le16_to_cpu
	movq	%rax, %r12
	movq	_RC_DRIVER_IR_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rc_allocate_device
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %rbx
	movl	12(%r15), %edi
	movq	_USB_RR3IIUSB_PRODUCT_ID@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movq	(%r15), %rdi
	movl	8(%r15), %esi
	movl	$4, %edx
	callq	_usb_make_path
	movl	12(%r15), %eax
	movl	%eax, 96(%rbx)
	movl	8(%r15), %eax
	movl	%eax, 92(%rbx)
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	addq	$88, %rsi
	callq	_usb_to_input_id
	movq	%r14, 80(%rbx)
	movq	%r15, 72(%rbx)
	movq	_RC_PROTO_BIT_ALL_IR_DECODER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%rbx)
	movq	_RR3_RX_MIN_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MS_TO_NS
	movq	%rax, 56(%rbx)
	movq	_RR3_RX_MAX_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MS_TO_NS
	movq	%rax, 48(%rbx)
	movq	%r15, %rdi
	callq	_redrat3_get_timeout
	movl	%eax, %edi
	callq	_US_TO_NS
	movq	%rax, 40(%rbx)
	movq	_redrat3_set_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_redrat3_transmit_ir@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_redrat3_set_tx_carrier@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_redrat3_wideband_receiver@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_DRIVER_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movl	$2, %edi
	callq	_US_TO_NS
	movq	%rax, 8(%rbx)
	movq	_RC_MAP_HAUPPAUGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_rc_register_device
	testl	%eax, %eax
	jns	LBB0_4
## %bb.2:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_rc_free_device
LBB0_3:
	xorl	%ebx, %ebx
LBB0_4:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RC_DRIVER_IR_RAW,4,2           ## @RC_DRIVER_IR_RAW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RedRat3%s Infrared Remote Transceiver"

	.comm	_USB_RR3IIUSB_PRODUCT_ID,8,3    ## @USB_RR3IIUSB_PRODUCT_ID
L_.str.1:                               ## @.str.1
	.asciz	"-II"

L_.str.2:                               ## @.str.2
	.space	1

	.comm	_RC_PROTO_BIT_ALL_IR_DECODER,4,2 ## @RC_PROTO_BIT_ALL_IR_DECODER
	.comm	_RR3_RX_MIN_TIMEOUT,4,2         ## @RR3_RX_MIN_TIMEOUT
	.comm	_RR3_RX_MAX_TIMEOUT,4,2         ## @RR3_RX_MAX_TIMEOUT
	.comm	_redrat3_set_timeout,4,2        ## @redrat3_set_timeout
	.comm	_redrat3_transmit_ir,4,2        ## @redrat3_transmit_ir
	.comm	_redrat3_set_tx_carrier,4,2     ## @redrat3_set_tx_carrier
	.comm	_redrat3_wideband_receiver,4,2  ## @redrat3_wideband_receiver
	.comm	_DRIVER_NAME,4,2                ## @DRIVER_NAME
	.comm	_RC_MAP_HAUPPAUGE,4,2           ## @RC_MAP_HAUPPAUGE
L_.str.3:                               ## @.str.3
	.asciz	"remote dev registration failed\n"

	.no_dead_strip	_redrat3_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 redrat3_init_rc_dev
_redrat3_init_rc_dev:                   ; @redrat3_init_rc_dev
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x0
	ldr	x19, [x0, #16]
	ldr	x8, [x0]
	ldr	w0, [x8]
	bl	_le16_to_cpu
	mov	x22, x0
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	x20, x0
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w0, [x21, #12]
Lloh3:
	adrp	x8, _USB_RR3IIUSB_PRODUCT_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _USB_RR3IIUSB_PRODUCT_ID@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x9, l_.str.2@PAGE
Lloh7:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh8:
	adrp	x10, l_.str.1@PAGE
Lloh9:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	x22, x8
	csel	x3, x10, x9, eq
Lloh10:
	adrp	x2, l_.str@PAGE
Lloh11:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	ldr	x0, [x21]
	ldr	w1, [x21, #8]
	mov	w2, #4
	bl	_usb_make_path
	ldr	d0, [x21, #8]
	stur	d0, [x20, #92]
	ldr	x0, [x21]
	add	x1, x20, #88
	bl	_usb_to_input_id
Lloh12:
	adrp	x8, _RC_PROTO_BIT_ALL_IR_DECODER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RC_PROTO_BIT_ALL_IR_DECODER@GOTPAGEOFF]
	stp	x21, x19, [x20, #72]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x20, #64]
Lloh15:
	adrp	x8, _RR3_RX_MIN_TIMEOUT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RR3_RX_MIN_TIMEOUT@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_MS_TO_NS
	str	x0, [x20, #56]
Lloh18:
	adrp	x8, _RR3_RX_MAX_TIMEOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RR3_RX_MAX_TIMEOUT@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_MS_TO_NS
	str	x0, [x20, #48]
	mov	x0, x21
	bl	_redrat3_get_timeout
	bl	_US_TO_NS
	str	x0, [x20, #40]
Lloh21:
	adrp	x8, _redrat3_set_timeout@GOTPAGE
Lloh22:
	ldr	x8, [x8, _redrat3_set_timeout@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x20, #32]
Lloh24:
	adrp	x8, _redrat3_transmit_ir@GOTPAGE
Lloh25:
	ldr	x8, [x8, _redrat3_transmit_ir@GOTPAGEOFF]
Lloh26:
	adrp	x9, _redrat3_set_tx_carrier@GOTPAGE
Lloh27:
	ldr	x9, [x9, _redrat3_set_tx_carrier@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
Lloh29:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #24]
Lloh30:
	adrp	x8, _redrat3_wideband_receiver@GOTPAGE
Lloh31:
	ldr	x8, [x8, _redrat3_wideband_receiver@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _DRIVER_NAME@GOTPAGE
Lloh34:
	ldr	x9, [x9, _DRIVER_NAME@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #16]
	mov	w0, #2
	bl	_US_TO_NS
	str	x0, [x20, #8]
Lloh36:
	adrp	x8, _RC_MAP_HAUPPAUGE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _RC_MAP_HAUPPAUGE@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	str	w8, [x20]
	mov	x0, x20
	bl	_rc_register_device
	tbz	w0, #31, LBB0_3
; %bb.2:
Lloh39:
	adrp	x1, l_.str.3@PAGE
Lloh40:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	x0, x20
	bl	_rc_free_device
	mov	x20, #0
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh28
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_RC_DRIVER_IR_RAW,4,2           ; @RC_DRIVER_IR_RAW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RedRat3%s Infrared Remote Transceiver"

	.comm	_USB_RR3IIUSB_PRODUCT_ID,8,3    ; @USB_RR3IIUSB_PRODUCT_ID
l_.str.1:                               ; @.str.1
	.asciz	"-II"

l_.str.2:                               ; @.str.2
	.space	1

	.comm	_RC_PROTO_BIT_ALL_IR_DECODER,4,2 ; @RC_PROTO_BIT_ALL_IR_DECODER
	.comm	_RR3_RX_MIN_TIMEOUT,4,2         ; @RR3_RX_MIN_TIMEOUT
	.comm	_RR3_RX_MAX_TIMEOUT,4,2         ; @RR3_RX_MAX_TIMEOUT
	.comm	_redrat3_set_timeout,4,2        ; @redrat3_set_timeout
	.comm	_redrat3_transmit_ir,4,2        ; @redrat3_transmit_ir
	.comm	_redrat3_set_tx_carrier,4,2     ; @redrat3_set_tx_carrier
	.comm	_redrat3_wideband_receiver,4,2  ; @redrat3_wideband_receiver
	.comm	_DRIVER_NAME,4,2                ; @DRIVER_NAME
	.comm	_RC_MAP_HAUPPAUGE,4,2           ; @RC_MAP_HAUPPAUGE
l_.str.3:                               ; @.str.3
	.asciz	"remote dev registration failed\n"

	.no_dead_strip	_redrat3_init_rc_dev
.subsections_via_symbols
