	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ili9322_get_modes
_ili9322_get_modes:                     ## @ili9322_get_modes
	.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
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	callq	_panel_to_ili9322
	movq	%rax, %r14
	movq	8(%rax), %rcx
	movl	4(%rcx), %eax
	movl	%eax, 8(%rbx)
	movl	(%rcx), %eax
	movl	%eax, 4(%rbx)
	cmpq	$0, 32(%rcx)
	je	LBB0_2
## %bb.1:
	movq	_DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE@GOTPCREL(%rip), %rdx
	jmp	LBB0_3
LBB0_2:
	movq	_DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE@GOTPCREL(%rip), %rdx
LBB0_3:
	movl	(%rbx), %eax
	orl	(%rdx), %eax
	movl	%eax, (%rbx)
	cmpq	$0, 24(%rcx)
	jne	LBB0_4
## %bb.5:
	movq	_DRM_BUS_FLAG_DE_LOW@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_4:
	movq	_DRM_BUS_FLAG_DE_HIGH@GOTPCREL(%rip), %rcx
LBB0_6:
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	movl	(%r14), %eax
	addl	$-128, %eax
	cmpl	$7, %eax
	ja	LBB0_8
## %bb.7:
	cltq
	leaq	l_switch.table.ili9322_get_modes(%rip), %rcx
	movq	(%rcx,%rax,8), %rsi
	movl	(%r15), %edi
	callq	_drm_mode_duplicate
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_drm_mode_set_name
	movq	_DRM_MODE_TYPE_DRIVER@GOTPCREL(%rip), %rax
	movq	_DRM_MODE_TYPE_PREFERRED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, (%r15)
	movq	8(%r14), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_11
## %bb.10:
	movq	_DRM_MODE_FLAG_PHSYNC@GOTPCREL(%rip), %rdx
	jmp	LBB0_12
LBB0_8:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_16
LBB0_11:
	movq	_DRM_MODE_FLAG_NHSYNC@GOTPCREL(%rip), %rdx
LBB0_12:
	movl	12(%r15), %ecx
	orl	(%rdx), %ecx
	movl	%ecx, 12(%r15)
	cmpq	$0, 8(%rax)
	jne	LBB0_13
## %bb.14:
	movq	_DRM_MODE_FLAG_NVSYNC@GOTPCREL(%rip), %rdx
	jmp	LBB0_15
LBB0_13:
	movq	_DRM_MODE_FLAG_PVSYNC@GOTPCREL(%rip), %rdx
LBB0_15:
	orl	(%rdx), %ecx
	movl	%ecx, 12(%r15)
	movl	4(%rax), %ecx
	movl	%ecx, 8(%r15)
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_drm_mode_probed_add
	movl	$1, %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,4,2 ## @DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE
	.comm	_DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,4,2 ## @DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE
	.comm	_DRM_BUS_FLAG_DE_HIGH,4,2       ## @DRM_BUS_FLAG_DE_HIGH
	.comm	_DRM_BUS_FLAG_DE_LOW,4,2        ## @DRM_BUS_FLAG_DE_LOW
	.comm	_srgb_320x240_mode,4,2          ## @srgb_320x240_mode
	.comm	_srgb_360x240_mode,4,2          ## @srgb_360x240_mode
	.comm	_prgb_320x240_mode,4,2          ## @prgb_320x240_mode
	.comm	_yuv_640x320_mode,4,2           ## @yuv_640x320_mode
	.comm	_yuv_720x360_mode,4,2           ## @yuv_720x360_mode
	.comm	_itu_r_bt_656_720_mode,4,2      ## @itu_r_bt_656_720_mode
	.comm	_itu_r_bt_656_640_mode,4,2      ## @itu_r_bt_656_640_mode
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad mode or failed to add mode\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DRM_MODE_TYPE_DRIVER,4,2       ## @DRM_MODE_TYPE_DRIVER
	.comm	_DRM_MODE_TYPE_PREFERRED,4,2    ## @DRM_MODE_TYPE_PREFERRED
	.comm	_DRM_MODE_FLAG_PHSYNC,4,2       ## @DRM_MODE_FLAG_PHSYNC
	.comm	_DRM_MODE_FLAG_NHSYNC,4,2       ## @DRM_MODE_FLAG_NHSYNC
	.comm	_DRM_MODE_FLAG_PVSYNC,4,2       ## @DRM_MODE_FLAG_PVSYNC
	.comm	_DRM_MODE_FLAG_NVSYNC,4,2       ## @DRM_MODE_FLAG_NVSYNC
	.no_dead_strip	_ili9322_get_modes
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ili9322_get_modes
l_switch.table.ili9322_get_modes:
	.quad	_yuv_720x360_mode
	.quad	_yuv_640x320_mode
	.quad	_srgb_360x240_mode
	.quad	_srgb_320x240_mode
	.quad	_prgb_320x240_mode
	.quad	_prgb_320x240_mode
	.quad	_itu_r_bt_656_720_mode
	.quad	_itu_r_bt_656_640_mode

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ili9322_get_modes
_ili9322_get_modes:                     ; @ili9322_get_modes
	.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
	mov	x21, x0
	ldr	x19, [x0, #8]
	bl	_panel_to_ili9322
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	d0, [x8]
	stur	d0, [x19, #4]
	ldr	x9, [x8, #32]
	cbz	x9, LBB0_2
; %bb.1:
Lloh0:
	adrp	x9, _DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x9, _DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE@GOTPAGEOFF]
LBB0_3:
	ldr	w9, [x9]
	ldr	w10, [x19]
	orr	w9, w10, w9
	str	w9, [x19]
	ldr	x8, [x8, #24]
Lloh4:
	adrp	x10, _DRM_BUS_FLAG_DE_LOW@GOTPAGE
Lloh5:
	ldr	x10, [x10, _DRM_BUS_FLAG_DE_LOW@GOTPAGEOFF]
Lloh6:
	adrp	x11, _DRM_BUS_FLAG_DE_HIGH@GOTPAGE
Lloh7:
	ldr	x11, [x11, _DRM_BUS_FLAG_DE_HIGH@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	orr	w8, w9, w8
	str	w8, [x19]
	ldr	w8, [x20]
	sub	w8, w8, #128
	cmp	w8, #7
	b.hi	LBB0_7
; %bb.4:
Lloh8:
	adrp	x9, l_switch.table.ili9322_get_modes@PAGE
Lloh9:
	add	x9, x9, l_switch.table.ili9322_get_modes@PAGEOFF
	ldr	x1, [x9, w8, sxtw #3]
	ldr	w0, [x21]
	bl	_drm_mode_duplicate
	cbz	x0, LBB0_7
; %bb.5:
	mov	x21, x0
	bl	_drm_mode_set_name
Lloh10:
	adrp	x8, _DRM_MODE_TYPE_DRIVER@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DRM_MODE_TYPE_DRIVER@GOTPAGEOFF]
Lloh12:
	adrp	x9, _DRM_MODE_TYPE_PREFERRED@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DRM_MODE_TYPE_PREFERRED@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x21]
	ldr	x8, [x20, #8]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_8
; %bb.6:
Lloh16:
	adrp	x9, _DRM_MODE_FLAG_PHSYNC@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DRM_MODE_FLAG_PHSYNC@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_8:
Lloh23:
	adrp	x9, _DRM_MODE_FLAG_NHSYNC@GOTPAGE
Lloh24:
	ldr	x9, [x9, _DRM_MODE_FLAG_NHSYNC@GOTPAGEOFF]
LBB0_9:
	ldr	w9, [x9]
	ldr	w10, [x21, #12]
	orr	w9, w10, w9
	str	w9, [x21, #12]
	ldr	x10, [x8, #8]
Lloh25:
	adrp	x11, _DRM_MODE_FLAG_NVSYNC@GOTPAGE
Lloh26:
	ldr	x11, [x11, _DRM_MODE_FLAG_NVSYNC@GOTPAGEOFF]
Lloh27:
	adrp	x12, _DRM_MODE_FLAG_PVSYNC@GOTPAGE
Lloh28:
	ldr	x12, [x12, _DRM_MODE_FLAG_PVSYNC@GOTPAGEOFF]
	cmp	x10, #0
	csel	x10, x11, x12, eq
	ldr	w10, [x10]
	orr	w9, w9, w10
	str	w9, [x21, #12]
	ldr	d0, [x8]
	stur	d0, [x21, #4]
	mov	x0, x19
	mov	x1, x21
	bl	_drm_mode_probed_add
	mov	w0, #1
LBB0_10:
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh14
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,4,2 ; @DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE
	.comm	_DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,4,2 ; @DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE
	.comm	_DRM_BUS_FLAG_DE_HIGH,4,2       ; @DRM_BUS_FLAG_DE_HIGH
	.comm	_DRM_BUS_FLAG_DE_LOW,4,2        ; @DRM_BUS_FLAG_DE_LOW
	.comm	_srgb_320x240_mode,4,2          ; @srgb_320x240_mode
	.comm	_srgb_360x240_mode,4,2          ; @srgb_360x240_mode
	.comm	_prgb_320x240_mode,4,2          ; @prgb_320x240_mode
	.comm	_yuv_640x320_mode,4,2           ; @yuv_640x320_mode
	.comm	_yuv_720x360_mode,4,2           ; @yuv_720x360_mode
	.comm	_itu_r_bt_656_720_mode,4,2      ; @itu_r_bt_656_720_mode
	.comm	_itu_r_bt_656_640_mode,4,2      ; @itu_r_bt_656_640_mode
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad mode or failed to add mode\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DRM_MODE_TYPE_DRIVER,4,2       ; @DRM_MODE_TYPE_DRIVER
	.comm	_DRM_MODE_TYPE_PREFERRED,4,2    ; @DRM_MODE_TYPE_PREFERRED
	.comm	_DRM_MODE_FLAG_PHSYNC,4,2       ; @DRM_MODE_FLAG_PHSYNC
	.comm	_DRM_MODE_FLAG_NHSYNC,4,2       ; @DRM_MODE_FLAG_NHSYNC
	.comm	_DRM_MODE_FLAG_PVSYNC,4,2       ; @DRM_MODE_FLAG_PVSYNC
	.comm	_DRM_MODE_FLAG_NVSYNC,4,2       ; @DRM_MODE_FLAG_NVSYNC
	.no_dead_strip	_ili9322_get_modes
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ili9322_get_modes
l_switch.table.ili9322_get_modes:
	.quad	_yuv_720x360_mode
	.quad	_yuv_640x320_mode
	.quad	_srgb_360x240_mode
	.quad	_srgb_320x240_mode
	.quad	_prgb_320x240_mode
	.quad	_prgb_320x240_mode
	.quad	_itu_r_bt_656_720_mode
	.quad	_itu_r_bt_656_640_mode

.subsections_via_symbols
