	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imon_init_rdev
_imon_init_rdev:                        ## @imon_init_rdev
	.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, %rbx
	movq	_RC_DRIVER_SCANCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rc_allocate_device
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	28(%rbx), %edi
	movl	(%rbx), %ecx
	movl	4(%rbx), %r8d
	leaq	L_.str.1(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movl	20(%rbx), %edi
	movl	24(%rbx), %esi
	movl	$4, %edx
	callq	_usb_make_path
	movl	24(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	$4, %edx
	callq	_strlcat
	movl	28(%rbx), %eax
	movl	%eax, 36(%r14)
	movl	24(%rbx), %eax
	movl	%eax, 32(%r14)
	movl	20(%rbx), %edi
	movq	%r14, %rsi
	addq	$28, %rsi
	callq	_usb_to_input_id
	leaq	12(%rbx), %r15
	movl	12(%rbx), %eax
	movl	%eax, 24(%r14)
	movq	%rbx, 16(%r14)
	movq	_RC_PROTO_BIT_IMON@GOTPCREL(%rip), %rax
	movq	_RC_PROTO_BIT_RC6_MCE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	orl	(%rax), %ecx
	movl	%ecx, (%r14)
	movq	_imon_ir_change_protocol@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movq	_MOD_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movl	16(%rbx), %edi
	leaq	_imon_init_rdev.fp_packet(%rip), %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	%rbx, %rdi
	callq	_send_packet
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_info
LBB0_4:
	cmpl	$65500, 4(%rbx)                 ## imm = 0xFFDC
	jne	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_imon_get_ffdc_type
	movl	8(%rbx), %eax
	movl	%eax, (%r14)
LBB0_6:
	movq	%rbx, %rdi
	callq	_imon_set_display_type
	movl	8(%rbx), %eax
	cmpl	(%r12), %eax
	jne	LBB0_7
## %bb.8:
	movq	_RC_MAP_IMON_MCE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_1:
	addq	$12, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %r15
	jmp	LBB0_11
LBB0_7:
	movq	_RC_MAP_IMON_PAD@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	%r14, %rdi
	callq	_rc_register_device
	testl	%eax, %eax
	jns	LBB0_12
## %bb.10:
	leaq	L_.str.4(%rip), %rsi
LBB0_11:
	movl	(%r15), %edi
	callq	_dev_err
	movq	%r14, %rdi
	callq	_rc_free_device
	xorl	%r14d, %r14d
LBB0_12:
	movq	%r14, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
_imon_init_rdev.fp_packet:              ## @imon_init_rdev.fp_packet
	.ascii	"@\000\000\000\000\000\000\210"

	.comm	_RC_DRIVER_SCANCODE,4,2         ## @RC_DRIVER_SCANCODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"remote control dev allocation failed\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"/input0"

	.comm	_RC_PROTO_BIT_IMON,4,2          ## @RC_PROTO_BIT_IMON
	.comm	_RC_PROTO_BIT_RC6_MCE,4,2       ## @RC_PROTO_BIT_RC6_MCE
	.comm	_imon_ir_change_protocol,4,2    ## @imon_ir_change_protocol
	.comm	_MOD_NAME,4,2                   ## @MOD_NAME
L_.str.3:                               ## @.str.3
	.asciz	"panel buttons/knobs setup failed\n"

	.comm	_RC_MAP_IMON_MCE,4,2            ## @RC_MAP_IMON_MCE
	.comm	_RC_MAP_IMON_PAD,4,2            ## @RC_MAP_IMON_PAD
L_.str.4:                               ## @.str.4
	.asciz	"remote input dev register failed\n"

	.no_dead_strip	_imon_init_rdev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imon_init_rdev
_imon_init_rdev:                        ; @imon_init_rdev
	.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	x20, x0
Lloh0:
	adrp	x8, _RC_DRIVER_SCANCODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RC_DRIVER_SCANCODE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_rc_allocate_device
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.1:
	ldr	w0, [x20, #28]
	ldp	w3, w4, [x20]
Lloh3:
	adrp	x2, l_.str.1@PAGE
Lloh4:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	ldp	w0, w1, [x20, #20]
	mov	w2, #4
	bl	_usb_make_path
	ldr	w0, [x20, #24]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w2, #4
	bl	_strlcat
	ldr	d0, [x20, #24]
	str	d0, [x19, #32]
	ldr	w0, [x20, #20]
	add	x1, x19, #28
	bl	_usb_to_input_id
	mov	x21, x20
	ldr	w8, [x21, #12]!
	str	w8, [x19, #24]
	str	x20, [x19, #16]
Lloh7:
	adrp	x8, _RC_PROTO_BIT_IMON@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RC_PROTO_BIT_IMON@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x22, _RC_PROTO_BIT_RC6_MCE@GOTPAGE
Lloh11:
	ldr	x22, [x22, _RC_PROTO_BIT_RC6_MCE@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh12:
	adrp	x8, _imon_ir_change_protocol@GOTPAGE
Lloh13:
	ldr	x8, [x8, _imon_ir_change_protocol@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _MOD_NAME@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MOD_NAME@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #8]
	ldr	w0, [x20, #16]
Lloh18:
	adrp	x1, _imon_init_rdev.fp_packet@PAGE
Lloh19:
	add	x1, x1, _imon_init_rdev.fp_packet@PAGEOFF
	mov	w2, #8
	bl	_memcpy
	mov	x0, x20
	bl	_send_packet
	cbz	w0, LBB0_3
; %bb.2:
	ldr	w0, [x21]
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
LBB0_3:
	ldr	w8, [x20, #4]
	mov	w9, #65500
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x20
	bl	_imon_get_ffdc_type
	ldr	w8, [x20, #8]
	str	w8, [x19]
LBB0_5:
	mov	x0, x20
	bl	_imon_set_display_type
	ldr	w8, [x20, #8]
	ldr	w9, [x22]
Lloh22:
	adrp	x10, _RC_MAP_IMON_MCE@GOTPAGE
Lloh23:
	ldr	x10, [x10, _RC_MAP_IMON_MCE@GOTPAGEOFF]
Lloh24:
	adrp	x11, _RC_MAP_IMON_PAD@GOTPAGE
Lloh25:
	ldr	x11, [x11, _RC_MAP_IMON_PAD@GOTPAGEOFF]
	cmp	w8, w9
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_rc_register_device
	tbz	w0, #31, LBB0_9
; %bb.6:
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_8
LBB0_7:
	add	x21, x20, #12
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
LBB0_8:
	ldr	w0, [x21]
	bl	_dev_err
	mov	x0, x19
	bl	_rc_free_device
	mov	x19, #0
LBB0_9:
	mov	x0, x19
	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 AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_imon_init_rdev.fp_packet:              ; @imon_init_rdev.fp_packet
	.ascii	"@\000\000\000\000\000\000\210"

	.comm	_RC_DRIVER_SCANCODE,4,2         ; @RC_DRIVER_SCANCODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"remote control dev allocation failed\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"/input0"

	.comm	_RC_PROTO_BIT_IMON,4,2          ; @RC_PROTO_BIT_IMON
	.comm	_RC_PROTO_BIT_RC6_MCE,4,2       ; @RC_PROTO_BIT_RC6_MCE
	.comm	_imon_ir_change_protocol,4,2    ; @imon_ir_change_protocol
	.comm	_MOD_NAME,4,2                   ; @MOD_NAME
l_.str.3:                               ; @.str.3
	.asciz	"panel buttons/knobs setup failed\n"

	.comm	_RC_MAP_IMON_MCE,4,2            ; @RC_MAP_IMON_MCE
	.comm	_RC_MAP_IMON_PAD,4,2            ; @RC_MAP_IMON_PAD
l_.str.4:                               ; @.str.4
	.asciz	"remote input dev register failed\n"

	.no_dead_strip	_imon_init_rdev
.subsections_via_symbols
