	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rpi_touchscreen_enable
_rpi_touchscreen_enable:                ## @rpi_touchscreen_enable
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_panel_to_ts
	movq	%rax, %r15
	movq	_REG_POWERON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_rpi_touchscreen_i2c_write
	movl	$99, %ebx
	movq	_REG_PORTB@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_rpi_touchscreen_i2c_read
	subl	$1, %ebx
	setb	%cl
	testb	$1, %al
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testb	%cl, %cl
	je	LBB0_1
LBB0_3:
	movq	_DSI_LANEENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DSI_LANEENABLE_CLOCK@GOTPCREL(%rip), %rax
	movq	_DSI_LANEENABLE_D0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_rpi_touchscreen_write
	movq	_PPI_D0S_CLRSIPOCOUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$5, %edx
	callq	_rpi_touchscreen_write
	movq	_PPI_D1S_CLRSIPOCOUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$5, %edx
	callq	_rpi_touchscreen_write
	movq	_PPI_D0S_ATMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_rpi_touchscreen_write
	movq	_PPI_D1S_ATMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_rpi_touchscreen_write
	movq	_PPI_LPTXTIMECNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$3, %edx
	callq	_rpi_touchscreen_write
	movq	_SPICMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_rpi_touchscreen_write
	movq	_LCDCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1048912, %edx                  ## imm = 0x100150
	callq	_rpi_touchscreen_write
	movq	_SYSCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1039, %edx                     ## imm = 0x40F
	callq	_rpi_touchscreen_write
	movl	$100, %edi
	callq	_msleep
	movq	_PPI_STARTPPI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_rpi_touchscreen_write
	movq	_DSI_STARTDSI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_rpi_touchscreen_write
	movl	$100, %edi
	callq	_msleep
	movq	_REG_PWM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$255, %edx
	callq	_rpi_touchscreen_i2c_write
	movq	_REG_PORTA@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	$2, %edi
	callq	_BIT
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_rpi_touchscreen_i2c_write
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_POWERON,4,2                ## @REG_POWERON
	.comm	_REG_PORTB,4,2                  ## @REG_PORTB
	.comm	_DSI_LANEENABLE,4,2             ## @DSI_LANEENABLE
	.comm	_DSI_LANEENABLE_CLOCK,4,2       ## @DSI_LANEENABLE_CLOCK
	.comm	_DSI_LANEENABLE_D0,4,2          ## @DSI_LANEENABLE_D0
	.comm	_PPI_D0S_CLRSIPOCOUNT,4,2       ## @PPI_D0S_CLRSIPOCOUNT
	.comm	_PPI_D1S_CLRSIPOCOUNT,4,2       ## @PPI_D1S_CLRSIPOCOUNT
	.comm	_PPI_D0S_ATMR,4,2               ## @PPI_D0S_ATMR
	.comm	_PPI_D1S_ATMR,4,2               ## @PPI_D1S_ATMR
	.comm	_PPI_LPTXTIMECNT,4,2            ## @PPI_LPTXTIMECNT
	.comm	_SPICMR,4,2                     ## @SPICMR
	.comm	_LCDCTRL,4,2                    ## @LCDCTRL
	.comm	_SYSCTRL,4,2                    ## @SYSCTRL
	.comm	_PPI_STARTPPI,4,2               ## @PPI_STARTPPI
	.comm	_DSI_STARTDSI,4,2               ## @DSI_STARTDSI
	.comm	_REG_PWM,4,2                    ## @REG_PWM
	.comm	_REG_PORTA,4,2                  ## @REG_PORTA
	.no_dead_strip	_rpi_touchscreen_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rpi_touchscreen_enable
_rpi_touchscreen_enable:                ; @rpi_touchscreen_enable
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	_panel_to_ts
	mov	x19, x0
Lloh0:
	adrp	x8, _REG_POWERON@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_POWERON@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_rpi_touchscreen_i2c_write
	mov	w8, #99
Lloh3:
	adrp	x20, _REG_PORTB@GOTPAGE
Lloh4:
	ldr	x20, [x20, _REG_PORTB@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x21, x8
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rpi_touchscreen_i2c_read
	tbnz	w0, #0, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	w8, w21, #1
	cbnz	w21, LBB0_1
LBB0_3:
Lloh5:
	adrp	x8, _DSI_LANEENABLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DSI_LANEENABLE@GOTPAGEOFF]
Lloh7:
	adrp	x9, _DSI_LANEENABLE_CLOCK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _DSI_LANEENABLE_CLOCK@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	ldr	w8, [x9]
Lloh11:
	adrp	x9, _DSI_LANEENABLE_D0@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DSI_LANEENABLE_D0@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_rpi_touchscreen_write
Lloh14:
	adrp	x8, _PPI_D0S_CLRSIPOCOUNT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PPI_D0S_CLRSIPOCOUNT@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #5
	bl	_rpi_touchscreen_write
Lloh17:
	adrp	x8, _PPI_D1S_CLRSIPOCOUNT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PPI_D1S_CLRSIPOCOUNT@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #5
	bl	_rpi_touchscreen_write
Lloh20:
	adrp	x8, _PPI_D0S_ATMR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PPI_D0S_ATMR@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_rpi_touchscreen_write
Lloh23:
	adrp	x8, _PPI_D1S_ATMR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PPI_D1S_ATMR@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_rpi_touchscreen_write
Lloh26:
	adrp	x8, _PPI_LPTXTIMECNT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PPI_LPTXTIMECNT@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #3
	bl	_rpi_touchscreen_write
Lloh29:
	adrp	x8, _SPICMR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SPICMR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_rpi_touchscreen_write
Lloh32:
	adrp	x8, _LCDCTRL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _LCDCTRL@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #336
	movk	w2, #16, lsl #16
	bl	_rpi_touchscreen_write
Lloh35:
	adrp	x8, _SYSCTRL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SYSCTRL@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1039
	bl	_rpi_touchscreen_write
	mov	w0, #100
	bl	_msleep
Lloh38:
	adrp	x8, _PPI_STARTPPI@GOTPAGE
Lloh39:
	ldr	x8, [x8, _PPI_STARTPPI@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_rpi_touchscreen_write
Lloh41:
	adrp	x8, _DSI_STARTDSI@GOTPAGE
Lloh42:
	ldr	x8, [x8, _DSI_STARTDSI@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_rpi_touchscreen_write
	mov	w0, #100
	bl	_msleep
Lloh44:
	adrp	x8, _REG_PWM@GOTPAGE
Lloh45:
	ldr	x8, [x8, _REG_PWM@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #255
	bl	_rpi_touchscreen_i2c_write
Lloh47:
	adrp	x8, _REG_PORTA@GOTPAGE
Lloh48:
	ldr	x8, [x8, _REG_PORTA@GOTPAGEOFF]
Lloh49:
	ldr	w20, [x8]
	mov	w0, #2
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_rpi_touchscreen_i2c_write
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_POWERON,4,2                ; @REG_POWERON
	.comm	_REG_PORTB,4,2                  ; @REG_PORTB
	.comm	_DSI_LANEENABLE,4,2             ; @DSI_LANEENABLE
	.comm	_DSI_LANEENABLE_CLOCK,4,2       ; @DSI_LANEENABLE_CLOCK
	.comm	_DSI_LANEENABLE_D0,4,2          ; @DSI_LANEENABLE_D0
	.comm	_PPI_D0S_CLRSIPOCOUNT,4,2       ; @PPI_D0S_CLRSIPOCOUNT
	.comm	_PPI_D1S_CLRSIPOCOUNT,4,2       ; @PPI_D1S_CLRSIPOCOUNT
	.comm	_PPI_D0S_ATMR,4,2               ; @PPI_D0S_ATMR
	.comm	_PPI_D1S_ATMR,4,2               ; @PPI_D1S_ATMR
	.comm	_PPI_LPTXTIMECNT,4,2            ; @PPI_LPTXTIMECNT
	.comm	_SPICMR,4,2                     ; @SPICMR
	.comm	_LCDCTRL,4,2                    ; @LCDCTRL
	.comm	_SYSCTRL,4,2                    ; @SYSCTRL
	.comm	_PPI_STARTPPI,4,2               ; @PPI_STARTPPI
	.comm	_DSI_STARTDSI,4,2               ; @DSI_STARTDSI
	.comm	_REG_PWM,4,2                    ; @REG_PWM
	.comm	_REG_PORTA,4,2                  ; @REG_PORTA
	.no_dead_strip	_rpi_touchscreen_enable
.subsections_via_symbols
