	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	2                               ## -- Begin function gfx_ctx_drm_set_video_mode
LCPI0_0:
	.long	0x3f000000                      ## float 0.5
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_gfx_ctx_drm_set_video_mode:            ## @gfx_ctx_drm_set_video_mode
	.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
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.1:
	movl	%r8d, %r13d
	movl	%ecx, %r15d
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_frontend_driver_install_signal_handler
	xorl	%ecx, %ecx
	cmpq	$0, 8(%r12)
	sete	%dl
	movl	%r15d, %eax
	orl	%r14d, %eax
	movq	_g_drm_connector@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	je	LBB0_22
## %bb.2:
	testl	%r13d, %r13d
	je	LBB0_22
## %bb.3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rax)
	jle	LBB0_11
## %bb.4:
	movb	%dl, %cl
	leaq	LCPI0_0(%rip), %rdx
	movss	(%rdx,%rcx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -48(%rbp)                ## 4-byte Spill
	xorps	%xmm0, %xmm0
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_5
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rax), %rcx
	addq	%rbx, %rcx
	movq	_g_drm_mode@GOTPCREL(%rip), %rdx
	movq	%rcx, (%rdx)
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%r13
	movslq	(%rax), %rcx
	addq	$12, %rbx
	cmpq	%rcx, %r13
	jge	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rax), %rcx
	cmpl	%r14d, (%rcx,%rbx)
	jne	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%r15d, 4(%rcx,%rbx)
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	xorps	%xmm0, %xmm0
	cvtsi2ssq	(%r12), %xmm0
	movss	8(%rcx,%rbx), %xmm1             ## xmm1 = mem[0],zero,zero,zero
	mulss	-48(%rbp), %xmm1                ## 4-byte Folded Reload
	subss	%xmm0, %xmm1
	cvttss2si	%xmm1, %rdi
	callq	_fabsf
	movq	_g_drm_mode@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	_g_drm_connector@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movss	-44(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	jbe	LBB0_10
	jmp	LBB0_9
LBB0_22:
	movq	8(%rax), %rax
	movq	_g_drm_mode@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_13
LBB0_14:
	movl	(%rax), %esi
	movl	%esi, (%rbx)
	movl	4(%rax), %edx
	movq	%rbx, %r14
	movl	%edx, 4(%rbx)
	movq	_g_gbm_dev@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GBM_FORMAT_XRGB8888@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_GBM_BO_USE_SCANOUT@GOTPCREL(%rip), %rax
	movq	_GBM_BO_USE_RENDERING@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r8d
	orl	(%rax), %r8d
	callq	_gbm_surface_create
	movq	_g_gbm_surface@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	testl	%eax, %eax
	je	LBB0_15
## %bb.16:
	movl	%eax, %edi
	callq	_gbm_surface_lock_front_buffer
	movq	_g_bo@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	movl	%eax, %edi
	callq	_gbm_bo_get_user_data
	testq	%rax, %rax
	jne	LBB0_18
## %bb.17:
	movl	(%rbx), %edi
	callq	_drm_fb_get_from_bo
LBB0_18:
	movq	_g_drm_fd@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_g_crtc_id@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %edx
	movq	_g_drm_mode@GOTPCREL(%rip), %rax
	movq	_g_connector_id@GOTPCREL(%rip), %r9
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	pushq	(%rax)
	pushq	$1
	callq	_drmModeSetCrtc
	addq	$16, %rsp
	movl	%eax, %ecx
	movl	$1, %eax
	testl	%ecx, %ecx
	movq	%r14, %rbx
	jns	LBB0_21
	jmp	LBB0_19
LBB0_11:
	movq	_g_drm_mode@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	testq	%rax, %rax
	jne	LBB0_14
LBB0_13:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_19
LBB0_15:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	movq	%r14, %rbx
LBB0_19:
	movq	%rbx, %rdi
	callq	_gfx_ctx_drm_destroy_resources
	movq	%rbx, %rdi
	callq	_free
LBB0_20:
	xorl	%eax, %eax
LBB0_21:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_g_drm_connector,8,3            ## @g_drm_connector
	.comm	_g_drm_mode,8,3                 ## @g_drm_mode
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[KMS/EGL]: Did not find suitable video mode for %u x %u.\n"

	.comm	_g_gbm_dev,4,2                  ## @g_gbm_dev
	.comm	_GBM_FORMAT_XRGB8888,4,2        ## @GBM_FORMAT_XRGB8888
	.comm	_GBM_BO_USE_SCANOUT,4,2         ## @GBM_BO_USE_SCANOUT
	.comm	_GBM_BO_USE_RENDERING,4,2       ## @GBM_BO_USE_RENDERING
	.comm	_g_gbm_surface,4,2              ## @g_gbm_surface
L_.str.1:                               ## @.str.1
	.asciz	"[KMS/EGL]: Couldn't create GBM surface.\n"

	.comm	_drm_api,4,2                    ## @drm_api
	.comm	_g_bo,4,2                       ## @g_bo
	.comm	_g_drm_fd,4,2                   ## @g_drm_fd
	.comm	_g_crtc_id,4,2                  ## @g_crtc_id
	.comm	_g_connector_id,4,2             ## @g_connector_id
	.no_dead_strip	_gfx_ctx_drm_set_video_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_ctx_drm_set_video_mode
_gfx_ctx_drm_set_video_mode:            ; @gfx_ctx_drm_set_video_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset b8, -88
	.cfi_offset b9, -96
	cbz	x0, LBB0_21
; %bb.1:
	mov	x23, x4
	mov	x21, x3
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	bl	_frontend_driver_install_signal_handler
	ldr	x8, [x22, #8]
	cmp	x8, #0
	fmov	s0, #0.50000000
	fmov	s1, #1.00000000
	fcsel	s8, s1, s0, eq
Lloh0:
	adrp	x24, _g_drm_connector@GOTPAGE
Lloh1:
	ldr	x24, [x24, _g_drm_connector@GOTPAGEOFF]
	ldr	x8, [x24]
	orr	w9, w21, w20
	cbz	w9, LBB0_11
; %bb.2:
	cbz	w23, LBB0_11
; %bb.3:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_16
; %bb.4:
	mov	x23, #0
	mov	x25, #0
	movi	d9, #0000000000000000
Lloh2:
	adrp	x26, _g_drm_mode@GOTPAGE
Lloh3:
	ldr	x26, [x26, _g_drm_mode@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [x8, #8]
	add	x9, x9, x23
	str	x9, [x26]
	fmov	s9, s0
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x25, x25, #1
	ldrsw	x9, [x8]
	add	x23, x23, #12
	cmp	x25, x9
	b.ge	LBB0_16
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x8, #8]
	ldr	w10, [x9, x23]
	cmp	w10, w20
	b.ne	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x9, x9, x23
	ldr	w10, [x9, #4]
	cmp	w10, w21
	b.ne	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	s0, [x9, #8]
	ldr	x8, [x22]
	scvtf	s1, x8
	fnmsub	s0, s8, s0, s1
	fcvtzs	x0, s0
	bl	_fabsf
	ldr	x9, [x26]
	ldr	x8, [x24]
	cbz	x9, LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	fcmp	s0, s9
	b.pl	LBB0_6
	b	LBB0_5
LBB0_11:
	ldr	x8, [x8, #8]
Lloh4:
	adrp	x9, _g_drm_mode@GOTPAGE
Lloh5:
	ldr	x9, [x9, _g_drm_mode@GOTPAGEOFF]
Lloh6:
	str	x8, [x9]
	cbz	x8, LBB0_17
LBB0_12:
	ldp	w1, w2, [x8]
Lloh7:
	adrp	x8, _g_gbm_dev@GOTPAGE
Lloh8:
	ldr	x8, [x8, _g_gbm_dev@GOTPAGEOFF]
	stp	w1, w2, [x19]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x8, _GBM_FORMAT_XRGB8888@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GBM_FORMAT_XRGB8888@GOTPAGEOFF]
Lloh12:
	adrp	x9, _GBM_BO_USE_SCANOUT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GBM_BO_USE_SCANOUT@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
Lloh15:
	ldr	w8, [x9]
Lloh16:
	adrp	x9, _GBM_BO_USE_RENDERING@GOTPAGE
Lloh17:
	ldr	x9, [x9, _GBM_BO_USE_RENDERING@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w4, w9, w8
	bl	_gbm_surface_create
Lloh19:
	adrp	x8, _g_gbm_surface@GOTPAGE
Lloh20:
	ldr	x8, [x8, _g_gbm_surface@GOTPAGEOFF]
Lloh21:
	str	w0, [x8]
	cbz	w0, LBB0_18
; %bb.13:
	bl	_gbm_surface_lock_front_buffer
Lloh22:
	adrp	x20, _g_bo@GOTPAGE
Lloh23:
	ldr	x20, [x20, _g_bo@GOTPAGEOFF]
	str	w0, [x20]
	bl	_gbm_bo_get_user_data
	cbnz	x0, LBB0_15
; %bb.14:
	ldr	w0, [x20]
	bl	_drm_fb_get_from_bo
LBB0_15:
Lloh24:
	adrp	x8, _g_drm_fd@GOTPAGE
Lloh25:
	ldr	x8, [x8, _g_drm_fd@GOTPAGEOFF]
Lloh26:
	adrp	x9, _g_crtc_id@GOTPAGE
Lloh27:
	ldr	x9, [x9, _g_crtc_id@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
Lloh29:
	ldr	w1, [x9]
	ldr	w2, [x0]
Lloh30:
	adrp	x9, _g_drm_mode@GOTPAGE
Lloh31:
	ldr	x9, [x9, _g_drm_mode@GOTPAGEOFF]
Lloh32:
	ldr	x7, [x9]
Lloh33:
	adrp	x5, _g_connector_id@GOTPAGE
Lloh34:
	ldr	x5, [x5, _g_connector_id@GOTPAGEOFF]
	mov	w20, #1
	mov	x0, x8
	mov	w3, #0
	mov	w4, #0
	mov	w6, #1
	bl	_drmModeSetCrtc
	tbz	w0, #31, LBB0_22
	b	LBB0_20
LBB0_16:
Lloh35:
	adrp	x8, _g_drm_mode@GOTPAGE
Lloh36:
	ldr	x8, [x8, _g_drm_mode@GOTPAGEOFF]
Lloh37:
	ldr	x8, [x8]
	cbnz	x8, LBB0_12
LBB0_17:
	stp	x20, x21, [sp]
Lloh38:
	adrp	x0, l_.str@PAGE
Lloh39:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_19
LBB0_18:
Lloh40:
	adrp	x0, l_.str.1@PAGE
Lloh41:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_19:
	bl	_RARCH_ERR
LBB0_20:
	mov	x0, x19
	bl	_gfx_ctx_drm_destroy_resources
	mov	x0, x19
	bl	_free
LBB0_21:
	mov	w20, #0
LBB0_22:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotStr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh14
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh28
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_g_drm_connector,8,3            ; @g_drm_connector
	.comm	_g_drm_mode,8,3                 ; @g_drm_mode
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[KMS/EGL]: Did not find suitable video mode for %u x %u.\n"

	.comm	_g_gbm_dev,4,2                  ; @g_gbm_dev
	.comm	_GBM_FORMAT_XRGB8888,4,2        ; @GBM_FORMAT_XRGB8888
	.comm	_GBM_BO_USE_SCANOUT,4,2         ; @GBM_BO_USE_SCANOUT
	.comm	_GBM_BO_USE_RENDERING,4,2       ; @GBM_BO_USE_RENDERING
	.comm	_g_gbm_surface,4,2              ; @g_gbm_surface
l_.str.1:                               ; @.str.1
	.asciz	"[KMS/EGL]: Couldn't create GBM surface.\n"

	.comm	_drm_api,4,2                    ; @drm_api
	.comm	_g_bo,4,2                       ; @g_bo
	.comm	_g_drm_fd,4,2                   ; @g_drm_fd
	.comm	_g_crtc_id,4,2                  ; @g_crtc_id
	.comm	_g_connector_id,4,2             ; @g_connector_id
	.no_dead_strip	_gfx_ctx_drm_set_video_mode
.subsections_via_symbols
