	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function picolcd_fb_update
_picolcd_fb_update:                     ## @picolcd_fb_update
	.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
	movq	8(%rdi), %r14
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	leaq	4(%r14), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	cmpl	$0, 28(%r14)
	jne	LBB0_3
## %bb.1:
	movq	8(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	xorl	%esi, %esi
	callq	_picolcd_fb_reset
LBB0_3:
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r15d, %r15d
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	$0, (%r14)
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	24(%r14), %esi
	movl	16(%r14), %edi
	movl	20(%r14), %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%r13d, %r8d
	callq	_picolcd_fb_update_tile
	testl	%eax, %eax
	je	LBB0_12
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=2
	addl	$2, %r15d
	movq	_HID_OUTPUT_FIFO_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	%ecx, %r15d
	jl	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r14), %rbx
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_mutex_unlock
	testq	%rbx, %rbx
	je	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	(%rbx), %edi
	callq	_hid_hw_wait
	movq	%r15, %rdi
	callq	_mutex_lock
	xorl	%r15d, %r15d
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=2
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r14), %rbx
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=2
	movl	16(%r14), %esi
	movq	%rbx, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	callq	_picolcd_fb_send_tile
	testq	%rax, %rax
	jne	LBB0_17
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=2
	incl	%r13d
	cmpl	$8, %r13d
	jne	LBB0_5
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	$4, %eax
	jne	LBB0_4
## %bb.14:
	movl	$0, (%r14)
	testl	%r15d, %r15d
	je	LBB0_17
## %bb.15:
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r14), %rbx
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	testq	%rbx, %rbx
	je	LBB0_18
## %bb.16:
	movl	(%rbx), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hid_hw_wait                    ## TAILCALL
LBB0_17:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HID_OUTPUT_FIFO_SIZE,4,2       ## @HID_OUTPUT_FIFO_SIZE
	.no_dead_strip	_picolcd_fb_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function picolcd_fb_update
_picolcd_fb_update:                     ; @picolcd_fb_update
	.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
	mov	x19, x0
	ldr	x24, [x0, #8]
	bl	_mutex_lock
	add	x20, x24, #4
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x24, #28]
	cbnz	w8, LBB0_3
; %bb.1:
	ldr	x0, [x24, #8]
	cbz	x0, LBB0_3
; %bb.2:
	mov	w1, #0
	bl	_picolcd_fb_reset
LBB0_3:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	w21, #0
	mov	w26, #0
Lloh0:
	adrp	x25, _HID_OUTPUT_FIFO_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _HID_OUTPUT_FIFO_SIZE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	mov	w22, #0
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x24]
	cbnz	w8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	ldp	w2, w1, [x24, #20]
	ldr	w0, [x24, #16]
	mov	x3, x21
	mov	x4, x22
	bl	_picolcd_fb_update_tile
	cbz	w0, LBB0_12
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	w26, w26, #2
	ldr	w8, [x25]
	cmp	w8, #0
	cinc	w8, w8, lt
	cmp	w26, w8, asr #1
	b.lt	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x23, [x24, #8]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_mutex_unlock
	cbz	x23, LBB0_18
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	w0, [x23]
	bl	_hid_hw_wait
	mov	x0, x19
	bl	_mutex_lock
	mov	w26, #0
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x23, [x24, #8]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	cbz	x23, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=2
	ldr	w1, [x24, #16]
	mov	x0, x23
	mov	x2, x21
	mov	x3, x22
	bl	_picolcd_fb_send_tile
	cbnz	x0, LBB0_17
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=2
	add	w22, w22, #1
	cmp	w22, #8
	b.ne	LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	add	w21, w21, #1
	cmp	w21, #4
	b.ne	LBB0_4
; %bb.14:
	str	wzr, [x24]
	cbz	w26, LBB0_17
; %bb.15:
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x21, [x24, #8]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_mutex_unlock
	cbz	x21, LBB0_18
; %bb.16:
	ldr	w0, [x21]
	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
	b	_hid_hw_wait
LBB0_17:
	mov	x0, x19
	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
	b	_mutex_unlock
LBB0_18:
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_HID_OUTPUT_FIFO_SIZE,4,2       ; @HID_OUTPUT_FIFO_SIZE
	.no_dead_strip	_picolcd_fb_update
.subsections_via_symbols
