	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ir_imon_encode
_ir_imon_encode:                        ## @ir_imon_encode
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%ecx, %ecx
	je	LBB0_1
## %bb.2:
	movl	%ecx, %r12d
	movq	%rdx, %r13
	movl	%esi, %r15d
	movq	_IMON_UNIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_init_ir_raw_event_duration
	movq	_IMON_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	js	LBB0_16
## %bb.3:
	decl	%r12d
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_IMON_UNIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, 4(%r13)
LBB0_15:                                ##   in Loop: Header=BB0_4 Depth=1
	leal	-1(%rbx), %eax
	testl	%ebx, %ebx
	movl	%eax, %ebx
	jle	LBB0_16
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_BIT
	movq	_IMON_CHKBITS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %edi
	callq	_BIT
	movl	%eax, %r14d
	leal	1(%rbx), %edi
	callq	_BIT
	orl	%r14d, %eax
	xorl	%esi, %esi
	testl	%r15d, %eax
	sete	%sil
	cmpl	(%r13), %esi
	jne	LBB0_9
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_IMON_UNIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, 4(%r13)
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%esi, %esi
	cmpl	(%r13), %esi
	je	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	testl	%r12d, %r12d
	je	LBB0_1
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	decl	%r12d
	addq	$8, %r13
	movq	_IMON_UNIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r13, %rdi
	callq	_init_ir_raw_event_duration
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %edi
	callq	_BIT
	xorl	%esi, %esi
	testl	%r15d, %eax
	sete	%sil
	cmpl	%esi, (%r13)
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	testl	%r12d, %r12d
	je	LBB0_1
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	decl	%r12d
	addq	$8, %r13
	movq	_IMON_UNIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r13, %rdi
	callq	_init_ir_raw_event_duration
	jmp	LBB0_15
LBB0_1:
	movq	_ENOBUFS@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_17
LBB0_16:
	xorl	%eax, %eax
	cmpl	$0, (%r13)
	setne	%al
	leaq	(,%rax,8), %rax
	addq	%r13, %rax
	subq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	shrq	$3, %rax
LBB0_17:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
	.comm	_IMON_UNIT,8,3                  ## @IMON_UNIT
	.comm	_IMON_BITS,4,2                  ## @IMON_BITS
	.comm	_IMON_CHKBITS,4,2               ## @IMON_CHKBITS
	.no_dead_strip	_ir_imon_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ir_imon_encode
_ir_imon_encode:                        ; @ir_imon_encode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	cbz	w3, LBB0_15
; %bb.1:
	mov	x23, x3
	mov	x19, x2
	mov	x20, x1
Lloh0:
	adrp	x24, _IMON_UNIT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _IMON_UNIT@GOTPAGEOFF]
	ldr	x2, [x24]
	mov	x0, x19
	mov	w1, #1
	bl	_init_ir_raw_event_duration
Lloh2:
	adrp	x8, _IMON_BITS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IMON_BITS@GOTPAGEOFF]
Lloh4:
	ldr	w21, [x8]
	mov	x22, x19
	tbnz	w21, #31, LBB0_16
; %bb.2:
	sub	w25, w23, #1
Lloh5:
	adrp	x26, _IMON_CHKBITS@GOTPAGE
Lloh6:
	ldr	x26, [x26, _IMON_CHKBITS@GOTPAGEOFF]
	mov	x22, x19
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x24]
	ldr	w9, [x22, #4]
	add	w8, w9, w8
	str	w8, [x22, #4]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	w8, w21, #1
	cmp	w21, #0
	mov	x21, x8
	b.le	LBB0_16
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_BIT
	ldr	w8, [x26]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_BIT
	mov	x23, x0
	add	w0, w21, #1
	bl	_BIT
	orr	w8, w0, w23
	tst	w8, w20
	cset	w1, eq
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w1, #0
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x22]
	cmp	w1, w8
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x24]
	ldr	w9, [x22, #4]
	add	w8, w9, w8
	str	w8, [x22, #4]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	w25, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	sub	w25, w25, #1
	add	x22, x22, #8
	ldr	x2, [x24]
	mov	x0, x22
	bl	_init_ir_raw_event_duration
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_BIT
	tst	w0, w20
	cset	w1, eq
	ldr	w8, [x22]
	cmp	w8, w1
	b.eq	LBB0_3
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	cbz	w25, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	sub	w25, w25, #1
	add	x22, x22, #8
	ldr	x2, [x24]
	mov	x0, x22
	bl	_init_ir_raw_event_duration
	b	LBB0_4
LBB0_15:
Lloh7:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_17
LBB0_16:
	ldr	w8, [x22]
	cmp	w8, #0
	cset	w8, ne
	add	x8, x22, w8, uxtw #3
	sub	x8, x8, x19
	lsr	x0, x8, #3
LBB0_17:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
	.comm	_IMON_UNIT,8,3                  ; @IMON_UNIT
	.comm	_IMON_BITS,4,2                  ; @IMON_BITS
	.comm	_IMON_CHKBITS,4,2               ; @IMON_CHKBITS
	.no_dead_strip	_ir_imon_encode
.subsections_via_symbols
