	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tpg110_startup
_tpg110_startup:                        ## @tpg110_startup
	.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	%rdi, %r15
	movl	16(%rdi), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_gpiod_set_value_cansleep
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_DEBUG
	movq	_TPG110_TEST@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$85, %edx
	callq	_tpg110_write_reg
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_tpg110_read_reg
	cmpl	$85, %eax
	jne	LBB0_1
## %bb.3:
	movq	_TPG110_CHIPID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_tpg110_read_reg
	movl	(%r15), %edi
	movl	%eax, %edx
	sarl	$4, %edx
	andl	$15, %eax
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_DRM_DEV_INFO
	movq	_TPG110_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_tpg110_read_reg
	movl	%eax, %r14d
	movq	_TPG110_RES_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	leal	-128(%r14), %eax
	cmpl	$5, %eax
	ja	LBB0_12
## %bb.4:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_11:
	movl	(%r15), %edi
	leaq	L_.str.8(%rip), %rsi
	jmp	LBB0_6
LBB0_1:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	jmp	LBB0_2
LBB0_12:
	movl	(%r15), %edi
	leaq	L_.str.9(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	jmp	LBB0_13
LBB0_10:
	movl	(%r15), %edi
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_6
LBB0_8:
	movl	(%r15), %edi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_6
LBB0_7:
	movl	(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_6
LBB0_9:
	movl	(%r15), %edi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_6
LBB0_5:
	movl	(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
LBB0_6:
	xorl	%eax, %eax
	callq	_DRM_DEV_INFO
LBB0_13:
	cmpl	$131, %r14d
	movl	$132, %r12d
	cmovnel	%r14d, %r12d
	movq	_tpg110_modes@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_14
## %bb.15:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	cmpl	%r12d, (%rdi,%rbx)
	je	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	incq	%r13
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %rbx
	cmpq	%rax, %r13
	jl	LBB0_16
	jmp	LBB0_19
LBB0_14:
	xorl	%r13d, %r13d
	jmp	LBB0_19
LBB0_17:
	addq	%rbx, %rdi
	movq	%rdi, 8(%r15)
LBB0_19:
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %r13d
	jne	LBB0_21
## %bb.20:
	movl	(%r15), %edi
	leaq	L_.str.10(%rip), %rsi
	xorl	%r14d, %r14d
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_22
LBB0_21:
	movq	_TPG110_CTRL2@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_tpg110_read_reg
	movl	%eax, %ebx
	movl	(%r15), %edi
	movq	_TPG110_CTRL2_RES_PM_CTRL@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	andl	%ebx, %eax
	leaq	L_.str.13(%rip), %rax
	leaq	L_.str.12(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.11(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_DEV_INFO
	orl	(%r13), %ebx
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_tpg110_write_reg
LBB0_22:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
LJTI0_0:
	.long	L0_0_set_11
	.long	L0_0_set_10
	.long	L0_0_set_8
	.long	L0_0_set_7
	.long	L0_0_set_9
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"de-asserted GRESTB\n"

	.comm	_TPG110_TEST,4,2                ## @TPG110_TEST
L_.str.1:                               ## @.str.1
	.asciz	"failed communication test\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_TPG110_CHIPID,4,2              ## @TPG110_CHIPID
L_.str.2:                               ## @.str.2
	.asciz	"TPG110 chip ID: %d version: %d\n"

	.comm	_TPG110_CTRL1,4,2               ## @TPG110_CTRL1
	.comm	_TPG110_RES_MASK,4,2            ## @TPG110_RES_MASK
L_.str.3:                               ## @.str.3
	.asciz	"IN 400x240 RGB -> OUT 800x480 RGB (dual scan)\n"

L_.str.4:                               ## @.str.4
	.asciz	"IN 480x272 RGB -> OUT 800x480 RGB (dual scan)\n"

L_.str.5:                               ## @.str.5
	.asciz	"480x640 RGB\n"

L_.str.6:                               ## @.str.6
	.asciz	"480x272 RGB\n"

L_.str.7:                               ## @.str.7
	.asciz	"640x480 RGB\n"

L_.str.8:                               ## @.str.8
	.asciz	"800x480 RGB\n"

L_.str.9:                               ## @.str.9
	.asciz	"ILLEGAL RESOLUTION 0x%02x\n"

	.comm	_tpg110_modes,8,3               ## @tpg110_modes
L_.str.10:                              ## @.str.10
	.asciz	"unsupported mode (%02x) detected\n"

	.comm	_TPG110_CTRL2,4,2               ## @TPG110_CTRL2
L_.str.11:                              ## @.str.11
	.asciz	"resolution and standby is controlled by %s\n"

	.comm	_TPG110_CTRL2_RES_PM_CTRL,4,2   ## @TPG110_CTRL2_RES_PM_CTRL
L_.str.12:                              ## @.str.12
	.asciz	"software"

L_.str.13:                              ## @.str.13
	.asciz	"hardware"

	.no_dead_strip	_tpg110_startup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tpg110_startup
_tpg110_startup:                        ; @tpg110_startup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	w0, [x0, #16]
	mov	w1, #0
	bl	_gpiod_set_value_cansleep
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	ldr	w0, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_DEBUG
Lloh2:
	adrp	x20, _TPG110_TEST@GOTPAGE
Lloh3:
	ldr	x20, [x20, _TPG110_TEST@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #85
	bl	_tpg110_write_reg
	ldr	w1, [x20]
	mov	x0, x19
	bl	_tpg110_read_reg
	cmp	w0, #85
	b.ne	LBB0_4
; %bb.1:
Lloh4:
	adrp	x8, _TPG110_CHIPID@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TPG110_CHIPID@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tpg110_read_reg
	ldr	w8, [x19]
	asr	w9, w0, #4
	and	w10, w0, #0xf
	stp	x9, x10, [sp]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x8
	bl	_DRM_DEV_INFO
Lloh9:
	adrp	x8, _TPG110_CTRL1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TPG110_CTRL1@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tpg110_read_reg
Lloh12:
	adrp	x8, _TPG110_RES_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TPG110_RES_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	and	w20, w8, w0
	sub	w8, w20, #128
	cmp	w8, #5
	b.hi	LBB0_5
; %bb.2:
Lloh15:
	adrp	x9, lJTI0_0@PAGE
Lloh16:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_3
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_3:
	ldr	w0, [x19]
Lloh17:
	adrp	x1, l_.str.8@PAGE
Lloh18:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_11
LBB0_4:
	ldr	w0, [x19]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_20
LBB0_5:
	ldr	w0, [x19]
	str	x20, [sp]
Lloh21:
	adrp	x1, l_.str.9@PAGE
Lloh22:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_12
LBB0_6:
	ldr	w0, [x19]
Lloh23:
	adrp	x1, l_.str.7@PAGE
Lloh24:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_11
LBB0_7:
	ldr	w0, [x19]
Lloh25:
	adrp	x1, l_.str.5@PAGE
Lloh26:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_11
LBB0_8:
	ldr	w0, [x19]
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_11
LBB0_9:
	ldr	w0, [x19]
Lloh29:
	adrp	x1, l_.str.6@PAGE
Lloh30:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_11
LBB0_10:
	ldr	w0, [x19]
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_11:
	bl	_DRM_DEV_INFO
LBB0_12:
	mov	w8, #132
	cmp	w20, #131
	csel	w20, w8, w20, eq
Lloh33:
	adrp	x21, _tpg110_modes@GOTPAGE
Lloh34:
	ldr	x21, [x21, _tpg110_modes@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_16
; %bb.13:
	mov	x23, #0
	mov	x22, #0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	ldr	w8, [x0, x23]
	cmp	w8, w20
	b.eq	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	add	x22, x22, #1
	bl	_ARRAY_SIZE
	add	x23, x23, #4
	cmp	x22, w0, sxtw
	b.lt	LBB0_14
	b	LBB0_18
LBB0_16:
	mov	w22, #0
	b	LBB0_18
LBB0_17:
	add	x8, x0, x23
	str	x8, [x19, #8]
LBB0_18:
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w22, w0
	b.ne	LBB0_21
; %bb.19:
	ldr	w0, [x19]
	str	x20, [sp]
Lloh35:
	adrp	x1, l_.str.10@PAGE
Lloh36:
	add	x1, x1, l_.str.10@PAGEOFF
LBB0_20:
	bl	_DRM_DEV_ERROR
Lloh37:
	adrp	x8, _ENODEV@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_22
LBB0_21:
Lloh40:
	adrp	x21, _TPG110_CTRL2@GOTPAGE
Lloh41:
	ldr	x21, [x21, _TPG110_CTRL2@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_tpg110_read_reg
	mov	x20, x0
	ldr	w0, [x19]
Lloh42:
	adrp	x22, _TPG110_CTRL2_RES_PM_CTRL@GOTPAGE
Lloh43:
	ldr	x22, [x22, _TPG110_CTRL2_RES_PM_CTRL@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh44:
	adrp	x9, l_.str.12@PAGE
Lloh45:
	add	x9, x9, l_.str.12@PAGEOFF
Lloh46:
	adrp	x10, l_.str.13@PAGE
Lloh47:
	add	x10, x10, l_.str.13@PAGEOFF
	tst	w8, w20
	csel	x8, x10, x9, eq
	str	x8, [sp]
Lloh48:
	adrp	x1, l_.str.11@PAGE
Lloh49:
	add	x1, x1, l_.str.11@PAGEOFF
	bl	_DRM_DEV_INFO
	ldr	w8, [x22]
	orr	w2, w8, w20
	ldr	w1, [x21]
	mov	x0, x19
	bl	_tpg110_write_reg
	mov	w0, #0
LBB0_22:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_6-LBB0_3)>>2
	.byte	(LBB0_7-LBB0_3)>>2
	.byte	(LBB0_8-LBB0_3)>>2
	.byte	(LBB0_9-LBB0_3)>>2
	.byte	(LBB0_10-LBB0_3)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"de-asserted GRESTB\n"

	.comm	_TPG110_TEST,4,2                ; @TPG110_TEST
l_.str.1:                               ; @.str.1
	.asciz	"failed communication test\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_TPG110_CHIPID,4,2              ; @TPG110_CHIPID
l_.str.2:                               ; @.str.2
	.asciz	"TPG110 chip ID: %d version: %d\n"

	.comm	_TPG110_CTRL1,4,2               ; @TPG110_CTRL1
	.comm	_TPG110_RES_MASK,4,2            ; @TPG110_RES_MASK
l_.str.3:                               ; @.str.3
	.asciz	"IN 400x240 RGB -> OUT 800x480 RGB (dual scan)\n"

l_.str.4:                               ; @.str.4
	.asciz	"IN 480x272 RGB -> OUT 800x480 RGB (dual scan)\n"

l_.str.5:                               ; @.str.5
	.asciz	"480x640 RGB\n"

l_.str.6:                               ; @.str.6
	.asciz	"480x272 RGB\n"

l_.str.7:                               ; @.str.7
	.asciz	"640x480 RGB\n"

l_.str.8:                               ; @.str.8
	.asciz	"800x480 RGB\n"

l_.str.9:                               ; @.str.9
	.asciz	"ILLEGAL RESOLUTION 0x%02x\n"

	.comm	_tpg110_modes,8,3               ; @tpg110_modes
l_.str.10:                              ; @.str.10
	.asciz	"unsupported mode (%02x) detected\n"

	.comm	_TPG110_CTRL2,4,2               ; @TPG110_CTRL2
l_.str.11:                              ; @.str.11
	.asciz	"resolution and standby is controlled by %s\n"

	.comm	_TPG110_CTRL2_RES_PM_CTRL,4,2   ; @TPG110_CTRL2_RES_PM_CTRL
l_.str.12:                              ; @.str.12
	.asciz	"software"

l_.str.13:                              ; @.str.13
	.asciz	"hardware"

	.no_dead_strip	_tpg110_startup
.subsections_via_symbols
