	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvt_ir_raw_set_wakeup_filter
_nvt_ir_raw_set_wakeup_filter:          ## @nvt_ir_raw_set_wakeup_filter
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_WAKEUP_MAX_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	leaq	(,%rbx,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	cmpl	$0, 4(%r12)
	je	LBB0_1
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	movl	$16, %esi
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	(%r12), %esi
	movl	(%r14), %ecx
	movq	%r15, %rdx
	callq	_ir_raw_encode_scancode
	movq	_ENOBUFS@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	subl	(%rdx), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_6
## %bb.5:
	movl	(%r14), %esi
	movl	%esi, %edx
	jmp	LBB0_9
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_24
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_24
LBB0_6:
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movl	(%r14), %esi
	movl	%eax, %edx
LBB0_9:
	movl	$0, %ebx
	testl	%edx, %edx
	jle	LBB0_22
## %bb.10:
	movl	$0, %ebx
	testl	%esi, %esi
	jle	LBB0_22
## %bb.11:
	cmpl	%ecx, %eax
	setne	-49(%rbp)                       ## 1-byte Folded Spill
	leal	-1(%rdx), %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%edx, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movq	%r12, %r14
	shlq	$4, %r14
	movl	8(%r15,%r14), %edi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_DIV_ROUND_UP
	movq	_SAMPLE_PERIOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_WAKEUP_MAX_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	cmpl	%eax, %ecx
	ja	LBB0_20
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	%r8d, %ebx
	jge	LBB0_20
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movslq	%r8d, %rsi
	xorl	%edx, %edx
	divl	%ecx
	cmpq	-72(%rbp), %r12                 ## 8-byte Folded Reload
	sete	%r10b
	andb	-49(%rbp), %r10b                ## 1-byte Folded Reload
	movq	_BUF_LEN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addq	%r15, %r14
	movq	_BUF_PULSE_BIT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	movslq	%ebx, %rbx
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%ecx, %eax
	setb	%dl
	testb	%dl, %r10b
	jne	LBB0_20
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	cmpl	%ecx, %eax
	movl	%ecx, %edi
	cmovbl	%eax, %edi
	movl	%edi, (%r13,%rbx,4)
	subl	%edi, %eax
	cmpq	$0, (%r14)
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=2
	orl	%r9d, %edi
	movl	%edi, (%r13,%rbx,4)
LBB0_18:                                ##   in Loop: Header=BB0_15 Depth=2
	incq	%rbx
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=2
	cmpq	%rsi, %rbx
	jl	LBB0_15
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%r12
	cmpq	-80(%rbp), %r12                 ## 8-byte Folded Reload
	jae	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	%r8d, %ebx
	jl	LBB0_12
LBB0_22:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_nvt_write_wakeup_codes
	xorl	%ebx, %ebx
LBB0_23:
	movq	%r15, %rdi
	callq	_kfree
LBB0_24:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_26
## %bb.25:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%eax, %ebx
	jmp	LBB0_23
LBB0_26:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WAKEUP_MAX_SIZE,4,2            ## @WAKEUP_MAX_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
	.comm	_SAMPLE_PERIOD,4,2              ## @SAMPLE_PERIOD
	.comm	_BUF_LEN_MASK,4,2               ## @BUF_LEN_MASK
	.comm	_BUF_PULSE_BIT,4,2              ## @BUF_PULSE_BIT
	.no_dead_strip	_nvt_ir_raw_set_wakeup_filter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvt_ir_raw_set_wakeup_filter
_nvt_ir_raw_set_wakeup_filter:          ; @nvt_ir_raw_set_wakeup_filter
	.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
	sub	sp, sp, #16
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x24, _WAKEUP_MAX_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _WAKEUP_MAX_SIZE@GOTPAGEOFF]
	ldr	w0, [x24]
	lsl	x8, x0, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	w8, [x1, #4]
	cbz	w8, LBB0_4
; %bb.1:
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w1, #16
	bl	_kmalloc_array
	cbz	x0, LBB0_5
; %bb.2:
	mov	x21, x0
	ldr	w0, [x19]
	ldr	w1, [x22]
	ldr	w3, [x24]
	mov	x2, x21
	bl	_ir_raw_encode_scancode
	mov	x23, x0
Lloh10:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_6
; %bb.3:
	stur	x19, [x29, #-96]                ; 8-byte Folded Spill
	ldr	w10, [x24]
	mov	x9, x10
	b	LBB0_8
LBB0_4:
	mov	w23, #0
	b	LBB0_12
LBB0_5:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_12
LBB0_6:
	tbnz	w23, #31, LBB0_11
; %bb.7:
	stur	x19, [x29, #-96]                ; 8-byte Folded Spill
	ldr	w10, [x24]
	mov	x9, x23
LBB0_8:
	subs	w25, w9, #1
	ccmp	w10, #1, #8, ge
	b.ge	LBB0_14
; %bb.9:
	mov	w22, #0
LBB0_10:
	ldur	x0, [x29, #-96]                 ; 8-byte Folded Reload
	mov	x1, x20
	mov	x2, x22
	bl	_nvt_write_wakeup_codes
	mov	w23, #0
LBB0_11:
	mov	x0, x21
	bl	_kfree
LBB0_12:
	ldur	x8, [x29, #-88]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.13:
	mov	x0, x23
	sub	sp, x29, #80
	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_14:
	mov	x26, #0
	mov	w22, #0
	neg	w8, w8
	cmp	w23, w8
Lloh19:
	adrp	x23, _SAMPLE_PERIOD@GOTPAGE
Lloh20:
	ldr	x23, [x23, _SAMPLE_PERIOD@GOTPAGEOFF]
	cset	w27, ne
	mov	w28, w9
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_19 Depth 2
	add	x19, x21, x26, lsl #4
	ldr	w0, [x19, #8]
	mov	w1, #1000
	bl	_DIV_ROUND_UP
	ldr	w12, [x23]
	ldr	w9, [x24]
	sxtw	x8, w9
	cmp	w12, w0
	ccmp	w22, w9, #0, ls
	b.lt	LBB0_18
LBB0_16:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x26, x26, #1
	cmp	x26, x28
	b.hs	LBB0_10
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	cmp	w22, w8
	b.lt	LBB0_15
	b	LBB0_10
LBB0_18:                                ;   in Loop: Header=BB0_15 Depth=1
	cmp	x26, x25
	cset	w9, eq
	and	w9, w27, w9
Lloh21:
	adrp	x10, _BUF_LEN_MASK@GOTPAGE
Lloh22:
	ldr	x10, [x10, _BUF_LEN_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
Lloh24:
	adrp	x11, _BUF_PULSE_BIT@GOTPAGE
Lloh25:
	ldr	x11, [x11, _BUF_PULSE_BIT@GOTPAGEOFF]
Lloh26:
	ldr	w11, [x11]
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	sxtw	x22, w22
	udiv	w12, w0, w12
LBB0_19:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w12, w10
	cset	w13, lo
	and	w13, w9, w13
	tbnz	w13, #0, LBB0_16
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=2
	csel	w13, w12, w10, lo
	str	w13, [x20, x22, lsl #2]
	sub	w12, w12, w13
	ldr	x14, [x19]
	cbz	x14, LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=2
	orr	w13, w11, w13
	str	w13, [x20, x22, lsl #2]
LBB0_22:                                ;   in Loop: Header=BB0_19 Depth=2
	add	x22, x22, #1
	cbz	w12, LBB0_16
; %bb.23:                               ;   in Loop: Header=BB0_19 Depth=2
	cmp	x22, x8
	b.lt	LBB0_19
	b	LBB0_16
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_WAKEUP_MAX_SIZE,4,2            ; @WAKEUP_MAX_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
	.comm	_SAMPLE_PERIOD,4,2              ; @SAMPLE_PERIOD
	.comm	_BUF_LEN_MASK,4,2               ; @BUF_LEN_MASK
	.comm	_BUF_PULSE_BIT,4,2              ; @BUF_PULSE_BIT
	.no_dead_strip	_nvt_ir_raw_set_wakeup_filter
.subsections_via_symbols
