	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function frbwrite
_frbwrite:                              ## @frbwrite
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	%edi, %ebx
	movq	$0, -40(%rbp)
	movb	_frbwrite.ptr(%rip), %al
	testl	%esi, %esi
	je	LBB0_4
## %bb.1:
	testb	$1, %al
	je	LBB0_4
## %bb.2:
	addl	_frbwrite.pulse(%rip), %ebx
	movl	%ebx, _frbwrite.pulse(%rip)
	cmpl	$250001, %ebx                   ## imm = 0x3D091
	jb	LBB0_12
## %bb.3:
	movl	_frbwrite.space(%rip), %eax
	movl	%eax, -40(%rbp)
	movl	$0, -36(%rbp)
	movq	_serial_ir@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_ir_raw_event_store_with_filter
	movl	_frbwrite.pulse(%rip), %eax
	movl	%eax, -40(%rbp)
	movl	$1, -36(%rbp)
	movl	(%r14), %edi
	movq	%rbx, %rsi
	callq	_ir_raw_event_store_with_filter
	movb	$0, _frbwrite.ptr(%rip)
	movl	$0, _frbwrite.pulse(%rip)
	jmp	LBB0_12
LBB0_4:
	testl	%r14d, %r14d
	je	LBB0_5
LBB0_11:
	movl	%ebx, -40(%rbp)
	movl	%r14d, -36(%rbp)
	movq	_serial_ir@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-40(%rbp), %rsi
	callq	_ir_raw_event_store_with_filter
LBB0_12:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	testb	$1, %al
	je	LBB0_6
## %bb.8:
	cmpl	$20000001, %ebx                 ## imm = 0x1312D01
	jb	LBB0_10
## %bb.9:
	movl	_frbwrite.space(%rip), %eax
	addl	_frbwrite.pulse(%rip), %eax
	movq	_IR_MAX_DURATION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovael	%ecx, %eax
	addl	%ebx, %eax
	cmpl	%ecx, %eax
	cmovael	%ecx, %eax
	movl	%eax, _frbwrite.space(%rip)
	movl	$0, _frbwrite.pulse(%rip)
	jmp	LBB0_12
LBB0_6:
	cmpl	$20000001, %ebx                 ## imm = 0x1312D01
	jb	LBB0_11
## %bb.7:
	movl	%ebx, _frbwrite.space(%rip)
	movb	$1, _frbwrite.ptr(%rip)
	jmp	LBB0_12
LBB0_10:
	movl	_frbwrite.space(%rip), %eax
	movl	%eax, -40(%rbp)
	movl	$0, -36(%rbp)
	movq	_serial_ir@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	-40(%rbp), %r15
	movq	%r15, %rsi
	callq	_ir_raw_event_store_with_filter
	movl	_frbwrite.pulse(%rip), %eax
	movl	%eax, -40(%rbp)
	movl	$1, -36(%rbp)
	movl	(%r12), %edi
	movq	%r15, %rsi
	callq	_ir_raw_event_store_with_filter
	movb	$0, _frbwrite.ptr(%rip)
	movl	$0, _frbwrite.pulse(%rip)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_frbwrite.ptr,1,2 ## @frbwrite.ptr
.zerofill __DATA,__bss,_frbwrite.pulse,4,2 ## @frbwrite.pulse
.zerofill __DATA,__bss,_frbwrite.space,4,2 ## @frbwrite.space
	.comm	_serial_ir,4,2                  ## @serial_ir
	.comm	_IR_MAX_DURATION,4,2            ## @IR_MAX_DURATION
	.no_dead_strip	_frbwrite
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function frbwrite
_frbwrite:                              ; @frbwrite
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	adrp	x21, _frbwrite.ptr@PAGE
	ldrb	w8, [x21, _frbwrite.ptr@PAGEOFF]
	cbz	w1, LBB0_4
; %bb.1:
	cbz	w8, LBB0_4
; %bb.2:
	adrp	x20, _frbwrite.pulse@PAGE
	ldr	w8, [x20, _frbwrite.pulse@PAGEOFF]
	mov	w9, #53393
	movk	w9, #3, lsl #16
	add	w8, w8, w19
	cmp	w8, w9
	str	w8, [x20, _frbwrite.pulse@PAGEOFF]
	b.lo	LBB0_6
; %bb.3:
Lloh0:
	adrp	x8, _frbwrite.space@PAGE
Lloh1:
	ldr	w8, [x8, _frbwrite.space@PAGEOFF]
	stp	w8, wzr, [sp, #8]
Lloh2:
	adrp	x19, _serial_ir@GOTPAGE
Lloh3:
	ldr	x19, [x19, _serial_ir@GOTPAGEOFF]
	ldr	w0, [x19]
	add	x1, sp, #8
	bl	_ir_raw_event_store_with_filter
	ldr	w8, [x20, _frbwrite.pulse@PAGEOFF]
	mov	w9, #1
	stp	w8, w9, [sp, #8]
	ldr	w0, [x19]
	add	x1, sp, #8
	bl	_ir_raw_event_store_with_filter
	strb	wzr, [x21, _frbwrite.ptr@PAGEOFF]
	str	wzr, [x20, _frbwrite.pulse@PAGEOFF]
	b	LBB0_6
LBB0_4:
	cbz	w20, LBB0_7
LBB0_5:
	stp	w19, w20, [sp, #8]
Lloh4:
	adrp	x8, _serial_ir@GOTPAGE
Lloh5:
	ldr	x8, [x8, _serial_ir@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	add	x1, sp, #8
	bl	_ir_raw_event_store_with_filter
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	tbz	w8, #0, LBB0_10
; %bb.8:
	mov	w8, #11521
	movk	w8, #305, lsl #16
	cmp	w19, w8
	b.lo	LBB0_12
; %bb.9:
	adrp	x8, _frbwrite.pulse@PAGE
	ldr	w9, [x8, _frbwrite.pulse@PAGEOFF]
	adrp	x10, _frbwrite.space@PAGE
	ldr	w11, [x10, _frbwrite.space@PAGEOFF]
Lloh7:
	adrp	x12, _IR_MAX_DURATION@GOTPAGE
Lloh8:
	ldr	x12, [x12, _IR_MAX_DURATION@GOTPAGEOFF]
Lloh9:
	ldr	w12, [x12]
	add	w9, w11, w9
	cmp	w9, w12
	csel	w9, w9, w12, lo
	add	w9, w9, w19
	cmp	w9, w12
	csel	w9, w9, w12, lo
	str	w9, [x10, _frbwrite.space@PAGEOFF]
	str	wzr, [x8, _frbwrite.pulse@PAGEOFF]
	b	LBB0_6
LBB0_10:
	mov	w8, #11521
	movk	w8, #305, lsl #16
	cmp	w19, w8
	b.lo	LBB0_5
; %bb.11:
	adrp	x8, _frbwrite.space@PAGE
	str	w19, [x8, _frbwrite.space@PAGEOFF]
	mov	w8, #1
	strb	w8, [x21, _frbwrite.ptr@PAGEOFF]
	b	LBB0_6
LBB0_12:
Lloh10:
	adrp	x8, _frbwrite.space@PAGE
Lloh11:
	ldr	w8, [x8, _frbwrite.space@PAGEOFF]
	stp	w8, wzr, [sp, #8]
Lloh12:
	adrp	x22, _serial_ir@GOTPAGE
Lloh13:
	ldr	x22, [x22, _serial_ir@GOTPAGEOFF]
	ldr	w0, [x22]
	add	x1, sp, #8
	bl	_ir_raw_event_store_with_filter
	adrp	x23, _frbwrite.pulse@PAGE
	ldr	w8, [x23, _frbwrite.pulse@PAGEOFF]
	mov	w9, #1
	stp	w8, w9, [sp, #8]
	ldr	w0, [x22]
	add	x1, sp, #8
	bl	_ir_raw_event_store_with_filter
	strb	wzr, [x21, _frbwrite.ptr@PAGEOFF]
	str	wzr, [x23, _frbwrite.pulse@PAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdr	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_frbwrite.ptr,1,2 ; @frbwrite.ptr
.zerofill __DATA,__bss,_frbwrite.pulse,4,2 ; @frbwrite.pulse
.zerofill __DATA,__bss,_frbwrite.space,4,2 ; @frbwrite.space
	.comm	_serial_ir,4,2                  ; @serial_ir
	.comm	_IR_MAX_DURATION,4,2            ; @IR_MAX_DURATION
	.no_dead_strip	_frbwrite
.subsections_via_symbols
