	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ir_spi_tx
_ir_spi_tx:                             ## @ir_spi_tx
	.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	(%rdi), %r13
	testl	%edx, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_23
## %bb.1:
	movq	%rsi, %r15
	movl	%edx, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%r8d, %r14d
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r12
	cmpq	-72(%rbp), %r12                 ## 8-byte Folded Reload
	je	LBB0_24
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
                                        ##     Child Loop BB0_13 Depth 2
                                        ##     Child Loop BB0_18 Depth 2
                                        ##     Child Loop BB0_21 Depth 2
	movl	(%r13), %edi
	imull	(%r15,%r12,4), %edi
	movl	$1000000, %esi                  ## imm = 0xF4240
	callq	_DIV_ROUND_CLOSEST
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r14), %r8d
	movq	_IR_SPI_MAX_BUFSIZE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jae	LBB0_28
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, %ecx
	andl	$1, %ecx
	movl	24(%r13,%rcx,4), %edx
	movq	16(%r13), %rsi
	movl	%r14d, %edi
	cmpl	$8, %eax
	jb	LBB0_17
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	-1(%rax), %ecx
	movl	%r14d, %edi
	addl	%r14d, %ecx
	jb	LBB0_17
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %edi
	andl	$-8, %edi
	movd	%edx, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leal	-8(%rdi), %ecx
	movl	%ecx, %r10d
	shrl	$3, %r10d
	incl	%r10d
	movl	%r10d, %r9d
	andl	$3, %r9d
	xorl	%ebx, %ebx
	cmpl	$24, %ecx
	jb	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	andl	$-4, %r10d
	xorl	%ebx, %ebx
	movl	%r14d, %ecx
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ecx, %r11d
	movdqu	%xmm0, (%rsi,%r11,4)
	movdqu	%xmm0, 16(%rsi,%r11,4)
	leal	8(%rcx), %r11d
	movdqu	%xmm0, (%rsi,%r11,4)
	movdqu	%xmm0, 16(%rsi,%r11,4)
	leal	16(%rcx), %r11d
	movdqu	%xmm0, (%rsi,%r11,4)
	movdqu	%xmm0, 16(%rsi,%r11,4)
	leal	24(%rcx), %r11d
	movdqu	%xmm0, (%rsi,%r11,4)
	movdqu	%xmm0, 16(%rsi,%r11,4)
	addl	$32, %ebx
	addl	$32, %ecx
	addl	$-4, %r10d
	jne	LBB0_10
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	testl	%r9d, %r9d
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	addl	%r14d, %ebx
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ebx, %ecx
	movdqu	%xmm0, (%rsi,%rcx,4)
	movdqu	%xmm0, 16(%rsi,%rcx,4)
	addl	$8, %ebx
	decl	%r9d
	jne	LBB0_13
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%edi, %eax
	je	LBB0_2
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=1
	addl	%r14d, %edi
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=1
	addl	%r14d, %eax
	subl	%edi, %eax
	leal	-1(%rax), %ecx
	andl	$7, %eax
	je	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%edi, %ebx
	incl	%edi
	movl	%edx, (%rsi,%rbx,4)
	decl	%eax
	jne	LBB0_18
LBB0_19:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$7, %ecx
	jb	LBB0_2
## %bb.20:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%r8d, %eax
	negl	%eax
	addl	$7, %edi
	.p2align	4, 0x90
LBB0_21:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	-7(%rdi), %ecx
	leal	-6(%rdi), %ebx
	movl	%edx, (%rsi,%rcx,4)
	leal	-5(%rdi), %ecx
	movl	%edx, (%rsi,%rbx,4)
	leal	-4(%rdi), %ebx
	movl	%edx, (%rsi,%rcx,4)
	leal	-3(%rdi), %ecx
	movl	%edx, (%rsi,%rbx,4)
	leal	-2(%rdi), %ebx
	movl	%edx, (%rsi,%rcx,4)
	leal	-1(%rdi), %ecx
	movl	%edx, (%rsi,%rbx,4)
	movl	%edx, (%rsi,%rcx,4)
	movl	%edi, %ecx
	movl	%edx, (%rsi,%rcx,4)
	leal	(%rax,%rdi), %ecx
	addl	$8, %ecx
                                        ## kill: def $edi killed $edi killed $rdi
	addl	$8, %edi
                                        ## kill: def $edi killed $edi def $rdi
	cmpl	$7, %ecx
	jne	LBB0_21
	jmp	LBB0_2
LBB0_23:
	xorl	%r14d, %r14d
LBB0_24:
	leaq	-64(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movl	(%r13), %eax
	shll	$4, %eax
	movl	%eax, -64(%rbp)
	shll	$2, %r14d
	movl	%r14d, -60(%rbp)
	movq	16(%r13), %rax
	movq	%rax, -56(%rbp)
	movl	4(%r13), %edi
	callq	_regulator_enable
	testl	%eax, %eax
	jne	LBB0_29
## %bb.25:
	movq	8(%r13), %rdi
	leaq	-64(%rbp), %rsi
	movl	$1, %edx
	callq	_spi_sync_transfer
	testl	%eax, %eax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_27
## %bb.26:
	movl	%eax, %r15d
	movq	8(%r13), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movl	%r15d, %ebx
LBB0_27:
	movl	4(%r13), %edi
	callq	_regulator_disable
	movl	%ebx, %eax
	jmp	LBB0_29
LBB0_28:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_29:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IR_SPI_MAX_BUFSIZE,4,2         ## @IR_SPI_MAX_BUFSIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to deliver the signal\n"

	.no_dead_strip	_ir_spi_tx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ir_spi_tx
_ir_spi_tx:                             ; @ir_spi_tx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x2
	ldr	x21, [x0]
	cbz	w2, LBB0_13
; %bb.1:
	mov	x20, x1
	mov	x22, #0
	mov	w23, #0
Lloh0:
	adrp	x24, _IR_SPI_MAX_BUFSIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _IR_SPI_MAX_BUFSIZE@GOTPAGEOFF]
	mov	w25, #28
	mov	w26, #24
	mov	w27, w19
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x8
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #1
	cmp	x22, x27
	b.eq	LBB0_14
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
                                        ;     Child Loop BB0_9 Depth 2
	ldr	w8, [x20, x22, lsl #2]
	ldr	w9, [x21]
	mul	w0, w9, w8
	mov	w1, #16960
	movk	w1, #15, lsl #16
	bl	_DIV_ROUND_CLOSEST
	ldr	w9, [x24]
	add	w8, w0, w23
	cmp	w8, w9
	b.hs	LBB0_18
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	tst	x22, #0x1
	csel	x9, x26, x25, eq
	cbz	w0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x21, x9]
	ldr	x10, [x21, #16]
	cmp	w0, #16
	b.lo	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w11, w0, #1
	cmn	w23, w11
	b.lo	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x11, x23
LBB0_9:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	w9, [x10, w11, uxtw #2]
	add	w12, w11, #1
	mov	x11, x12
	cmp	w8, w12
	b.ne	LBB0_9
	b	LBB0_2
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	and	w12, w0, #0xfffffff0
	add	w11, w23, w12
	dup.4s	v0, w9
	mov	x13, x12
LBB0_11:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x14, x10, w23, uxtw #2
	stp	q0, q0, [x14]
	stp	q0, q0, [x14, #32]
	add	w23, w23, #16
	subs	w13, w13, #16
	b.ne	LBB0_11
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	w0, w12
	b.ne	LBB0_9
	b	LBB0_2
LBB0_13:
	mov	w23, #0
LBB0_14:
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	ldr	w8, [x21]
	lsl	w8, w8, #4
	lsl	w9, w23, #2
	stp	w8, w9, [sp]
	ldr	x8, [x21, #16]
	str	x8, [sp, #8]
	ldr	w0, [x21, #4]
	bl	_regulator_enable
	cbnz	w0, LBB0_19
; %bb.15:
	ldr	x0, [x21, #8]
	mov	x1, sp
	mov	w2, #1
	bl	_spi_sync_transfer
	cbz	w0, LBB0_17
; %bb.16:
	mov	x20, x0
	ldr	x0, [x21, #8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x19, x20
LBB0_17:
	ldr	w0, [x21, #4]
	bl	_regulator_disable
	mov	x0, x19
	b	LBB0_19
LBB0_18:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_19:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_IR_SPI_MAX_BUFSIZE,4,2         ; @IR_SPI_MAX_BUFSIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to deliver the signal\n"

	.no_dead_strip	_ir_spi_tx
.subsections_via_symbols
