	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function picolcd_set_par
_picolcd_set_par:                       ## @picolcd_set_par
	.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
	movq	16(%rdi), %rax
	movl	(%rdi), %esi
	xorl	%r14d, %r14d
	cmpl	(%rax), %esi
	je	LBB0_17
## %bb.1:
	movq	%rdi, %r15
	cmpl	$1, %esi
	je	LBB0_5
## %bb.2:
	cmpl	$8, %esi
	jne	LBB0_3
LBB0_5:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %r12
	movq	_PICOLCDFB_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %rbx
	cmpl	$1, (%r15)
	movl	(%r13), %edx
	jne	LBB0_12
## %bb.8:
	testl	%edx, %edx
	jle	LBB0_11
## %bb.9:
	leaq	28(%r12), %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	xorl	%edx, %edx
	cmpl	$0, -28(%rax)
	setne	%dl
	xorl	%esi, %esi
	cmpl	$0, -24(%rax)
	setne	%sil
	xorl	%edi, %edi
	cmpl	$0, -20(%rax)
	leal	(%rsi,%rdx,2), %edx
	setne	%dil
	addl	%edi, %edi
	leal	(%rdi,%rdx,4), %edx
	xorl	%esi, %esi
	cmpl	$0, -16(%rax)
	setne	%sil
	orl	%edx, %esi
	xorl	%edx, %edx
	cmpl	$0, -12(%rax)
	setne	%dl
	addl	%edx, %edx
	leal	(%rdx,%rsi,4), %edx
	xorl	%esi, %esi
	cmpl	$0, -8(%rax)
	setne	%sil
	orl	%edx, %esi
	xorl	%edx, %edx
	cmpl	$0, -4(%rax)
	setne	%dl
	addl	%edx, %edx
	xorl	%edi, %edi
	cmpl	$0, (%rax)
	leal	(%rdx,%rsi,4), %edx
	setne	%dil
	orl	%edx, %edi
	movl	%edi, (%rbx,%rcx,4)
	incq	%rcx
	movslq	(%r13), %rdx
	addq	$32, %rax
	cmpq	%rdx, %rcx
	jl	LBB0_10
LBB0_11:
	movq	%r12, %rdi
	movq	%rbx, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	_FB_VISUAL_MONO01@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	_PICOLCDFB_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	7(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$3, %eax
	jmp	LBB0_16
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_17
LBB0_12:
	movq	%rbx, %rdi
	movq	%r12, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	cmpl	$0, (%r13)
	jle	LBB0_15
## %bb.13:
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rdx
	shrq	%rdx
	andl	$2147483644, %edx               ## imm = 0x7FFFFFFC
	movl	(%rbx,%rdx), %edx
	movl	%ecx, %eax
	notb	%al
	andb	$7, %al
	movzbl	%al, %eax
	btl	%eax, %edx
	movl	$255, %eax
	cmovael	%esi, %eax
	movl	%eax, (%r12,%rcx,4)
	incq	%rcx
	movslq	(%r13), %rax
	shlq	$3, %rax
	cmpq	%rax, %rcx
	jl	LBB0_14
LBB0_15:
	movq	_FB_VISUAL_DIRECTCOLOR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	_PICOLCDFB_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_16:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	%eax, 4(%r15)
	movq	%rbx, %rdi
	callq	_kfree
	movl	(%r15), %eax
	movl	%eax, (%r12)
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PICOLCDFB_SIZE,4,2             ## @PICOLCDFB_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_FB_VISUAL_MONO01,4,2           ## @FB_VISUAL_MONO01
	.comm	_PICOLCDFB_WIDTH,4,2            ## @PICOLCDFB_WIDTH
	.comm	_FB_VISUAL_DIRECTCOLOR,4,2      ## @FB_VISUAL_DIRECTCOLOR
	.no_dead_strip	_picolcd_set_par
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function picolcd_set_par
_picolcd_set_par:                       ; @picolcd_set_par
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x22, [x0, #16]
	ldr	w1, [x0]
	ldr	w8, [x22]
	cmp	w1, w8
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_17
LBB0_2:
	cmp	w1, #1
	ccmp	w1, #8, #4, ne
	b.ne	LBB0_9
; %bb.3:
	mov	x19, x0
	ldr	x21, [x22, #8]
Lloh0:
	adrp	x23, _PICOLCDFB_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PICOLCDFB_SIZE@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_kmalloc_array
	cbz	x0, LBB0_10
; %bb.4:
	mov	x20, x0
	ldr	w8, [x19]
	ldr	w2, [x23]
	cmp	w8, #1
	b.ne	LBB0_12
; %bb.5:
	cmp	w2, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x8, #0
	add	x9, x21, #16
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w10, w11, [x9, #-16]
	cmp	w10, #0
	cset	w10, ne
	cmp	w11, #0
	cset	w11, ne
	bfi	w11, w10, #1, #1
	ldp	w10, w12, [x9, #-8]
	cmp	w10, #0
	cset	w10, ne
	lsl	w10, w10, #1
	bfi	w10, w11, #2, #2
	cmp	w12, #0
	cset	w11, ne
	orr	w10, w10, w11
	ldp	w11, w12, [x9]
	cmp	w11, #0
	cset	w11, ne
	lsl	w11, w11, #1
	bfi	w11, w10, #2, #30
	cmp	w12, #0
	cset	w10, ne
	orr	w10, w11, w10
	ldp	w11, w12, [x9, #8]
	cmp	w11, #0
	cset	w11, ne
	lsl	w11, w11, #1
	bfi	w11, w10, #2, #30
	cmp	w12, #0
	cset	w10, ne
	orr	w10, w11, w10
	str	w10, [x20, x8, lsl #2]
	add	x8, x8, #1
	ldrsw	x2, [x23]
	add	x9, x9, #32
	cmp	x8, x2
	b.lt	LBB0_7
LBB0_8:
	mov	x0, x21
	mov	x1, x20
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
Lloh5:
	adrp	x8, _FB_VISUAL_MONO01@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FB_VISUAL_MONO01@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _PICOLCDFB_WIDTH@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PICOLCDFB_WIDTH@GOTPAGEOFF]
	str	w8, [x19, #8]
Lloh10:
	ldr	w8, [x9]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
	b	LBB0_16
LBB0_9:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_17
LBB0_12:
	mov	x0, x20
	mov	x1, x21
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.13:
	mov	x8, #0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ubfx	x9, x8, #3, #29
	ldr	w9, [x20, x9, lsl #2]
	mvn	w10, w8
	and	w10, w10, #0x7
	lsr	w9, w9, w10
	sbfx	w9, w9, #0, #1
	and	w9, w9, #0xff
	str	w9, [x21, x8, lsl #2]
	add	x8, x8, #1
	ldrsw	x9, [x23]
	cmp	x8, x9, lsl #3
	b.lt	LBB0_14
LBB0_15:
Lloh15:
	adrp	x8, _FB_VISUAL_DIRECTCOLOR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FB_VISUAL_DIRECTCOLOR@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x19, #8]
Lloh18:
	adrp	x8, _PICOLCDFB_WIDTH@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PICOLCDFB_WIDTH@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
LBB0_16:
	str	w8, [x19, #4]
	mov	x0, x20
	bl	_kfree
	mov	w0, #0
	ldr	w8, [x19]
	str	w8, [x22]
LBB0_17:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PICOLCDFB_SIZE,4,2             ; @PICOLCDFB_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_FB_VISUAL_MONO01,4,2           ; @FB_VISUAL_MONO01
	.comm	_PICOLCDFB_WIDTH,4,2            ; @PICOLCDFB_WIDTH
	.comm	_FB_VISUAL_DIRECTCOLOR,4,2      ; @FB_VISUAL_DIRECTCOLOR
	.no_dead_strip	_picolcd_set_par
.subsections_via_symbols
