	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function redrat3_get_ir_data
_redrat3_get_ir_data:                   ## @redrat3_get_ir_data
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	16(%rdi), %r14
	cmpl	$4, %esi
	jb	LBB0_3
## %bb.1:
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_redrat3_read_packet_start
	jmp	LBB0_5
LBB0_3:
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	movq	%rbx, %rdi
	callq	_redrat3_read_packet_continue
LBB0_5:
	movq	(%rbx), %r15
	movl	12(%rbx), %edi
	callq	_be16_to_cpu
	movslq	%eax, %rcx
	addq	$4, %rcx
	xorl	%eax, %eax
	cmpq	%rcx, %r15
	jb	LBB0_11
## %bb.6:
	movl	8(%rbx), %edi
	callq	_be16_to_cpu
	movq	_RR3_MOD_SIGNAL_IN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_redrat3_process_ir_data
	jmp	LBB0_9
LBB0_12:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENODATA@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_dbg
LBB0_9:
	xorl	%eax, %eax
LBB0_10:
	movq	$0, (%rbx)
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error: no packet data read\n"

	.comm	_ENODATA,4,2                    ## @ENODATA
	.comm	_RR3_MOD_SIGNAL_IN,4,2          ## @RR3_MOD_SIGNAL_IN
L_.str.1:                               ## @.str.1
	.asciz	"discarding non-signal data packet (type 0x%02x)\n"

	.no_dead_strip	_redrat3_get_ir_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function redrat3_get_ir_data
_redrat3_get_ir_data:                   ; @redrat3_get_ir_data
	.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	x19, x0
	ldr	x20, [x0, #16]
	ldr	x8, [x0]
	cmp	w1, #4
	b.lo	LBB0_3
; %bb.1:
	cbnz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_redrat3_read_packet_start
	b	LBB0_5
LBB0_3:
	cbz	x8, LBB0_9
; %bb.4:
	mov	x0, x19
	bl	_redrat3_read_packet_continue
LBB0_5:
	ldr	x21, [x19]
	ldr	w0, [x19, #12]
	bl	_be16_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	add	x8, x8, #4
	cmp	x21, x8
	b.hs	LBB0_7
; %bb.6:
	mov	w0, #0
	b	LBB0_13
LBB0_7:
	ldr	w0, [x19, #8]
	bl	_be16_to_cpu
Lloh0:
	adrp	x8, _RR3_MOD_SIGNAL_IN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RR3_MOD_SIGNAL_IN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_redrat3_process_ir_data
	b	LBB0_11
LBB0_9:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh5:
	adrp	x8, _ENODATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODATA@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_10:
	mov	x2, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
LBB0_11:
	mov	w0, #0
LBB0_12:
	str	xzr, [x19]
LBB0_13:
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error: no packet data read\n"

	.comm	_ENODATA,4,2                    ; @ENODATA
	.comm	_RR3_MOD_SIGNAL_IN,4,2          ; @RR3_MOD_SIGNAL_IN
l_.str.1:                               ; @.str.1
	.asciz	"discarding non-signal data packet (type 0x%02x)\n"

	.no_dead_strip	_redrat3_get_ir_data
.subsections_via_symbols
