	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ir_decode_pulsedistance        ## -- Begin function ir_decode_pulsedistance
	.p2align	4, 0x90
_ir_decode_pulsedistance:               ## @ir_decode_pulsedistance
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	jle	LBB0_12
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	shll	$5, %r14d
	cmpl	$2, %r14d
	movl	$1, %r12d
	cmovgel	%r14d, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%r13d
	cmpl	%r13d, %r12d
	je	LBB0_12
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_getbit
	testl	%eax, %eax
	jne	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$28, %ebx
	movl	$0, %ebx
	jle	LBB0_3
## %bb.6:
	movl	%r14d, %eax
	subl	%r13d, %eax
	jle	LBB0_12
## %bb.7:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	%r13d, %ebx
	movl	%r14d, -56(%rbp)                ## 4-byte Spill
	subl	%r14d, %ebx
	incl	%ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%r14,%r13), %r12d
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_getbit
	testl	%eax, %eax
	jne	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	leal	1(%r14), %eax
	addl	%ebx, %r14d
	movl	%eax, %r14d
	jne	LBB0_8
## %bb.10:
	addl	%eax, %r13d
	movl	%r13d, %r12d
	movl	$-1, %ebx
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_16
LBB0_12:
	movl	$-1, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	%r14d, %eax
	movl	$-1, %ebx
LBB0_16:
	cmpl	$7, %eax
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	jb	LBB0_13
## %bb.17:
	xorl	%ebx, %ebx
	cmpl	%r14d, %r12d
	jge	LBB0_13
## %bb.18:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	$1, -48(%rbp)                   ## 4-byte Folded Spill
	xorl	%ebx, %ebx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$1, %r13d
	jmp	LBB0_22
LBB0_19:                                ##   in Loop: Header=BB0_22 Depth=1
	incl	-44(%rbp)                       ## 4-byte Folded Spill
LBB0_20:                                ##   in Loop: Header=BB0_22 Depth=1
	movl	%eax, %r13d
LBB0_21:                                ##   in Loop: Header=BB0_22 Depth=1
	incl	%r12d
	cmpl	%r12d, %r14d
	je	LBB0_13
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_getbit
	testl	%r13d, %r13d
	je	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	testl	%eax, %eax
	jne	LBB0_21
## %bb.24:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_22 Depth=1
	testl	%eax, %eax
	je	LBB0_19
## %bb.26:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	-52(%rbp), %ecx                 ## 4-byte Folded Reload
	movl	$0, %ecx
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	cmovgl	%edx, %ecx
	orl	%ecx, %ebx
	addl	%edx, %edx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ir_decode_pulsedistance        ; -- Begin function ir_decode_pulsedistance
	.p2align	2
_ir_decode_pulsedistance:               ; @ir_decode_pulsedistance
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cmp	w1, #1
	b.lt	LBB0_21
; %bb.1:
	mov	x22, x3
	mov	x23, x2
	mov	x19, x0
	mov	w25, #0
	mov	w21, #0
	lsl	w24, w1, #5
	cmp	w24, #1
	csinc	w20, w24, wzr, gt
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w25, w25, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w21, w21, #1
	cmp	w20, w21
	b.eq	LBB0_21
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_getbit
	cbnz	w0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w25, #28
	b.gt	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w25, #0
	b	LBB0_3
LBB0_7:
	subs	w25, w24, w21
	b.le	LBB0_21
; %bb.8:
	mov	w26, #0
	sub	w8, w21, w24
	add	w27, w8, #1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	w20, w21, w26
	mov	x0, x19
	mov	x1, x20
	bl	_getbit
	cbnz	w0, LBB0_20
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w8, w26, #1
	cmn	w27, w26
	mov	x26, x8
	b.ne	LBB0_9
; %bb.11:
	add	w20, w21, w8
	cmp	w25, #7
	b.lo	LBB0_21
LBB0_12:
	cmp	w20, w24
	b.ge	LBB0_23
; %bb.13:
	mov	w21, #0
	mov	w25, #0
	add	w8, w22, w23
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w22, w8, #1
	mov	w23, #1
	mov	w26, #1
	b	LBB0_17
LBB0_14:                                ;   in Loop: Header=BB0_17 Depth=1
	cmp	w25, w22
	csel	w8, w23, wzr, gt
	orr	w8, w21, w8
	lsl	w9, w23, #1
	cmp	w0, #0
	csel	w23, w23, w9, eq
	cinc	w25, w25, eq
	csel	w21, w21, w8, eq
LBB0_15:                                ;   in Loop: Header=BB0_17 Depth=1
	mov	x26, x0
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	w20, w20, #1
	cmp	w24, w20
	b.eq	LBB0_22
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_getbit
	cbz	w26, LBB0_14
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	cbnz	w0, LBB0_16
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	w25, #1
	b	LBB0_15
LBB0_20:
	mov	x25, x26
	cmp	w25, #7
	b.hs	LBB0_12
LBB0_21:
	mov	w21, #-1
LBB0_22:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_23:
	mov	w21, #0
	b	LBB0_22
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
