	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_mode_attachmode_ioctl      ## -- Begin function drm_mode_attachmode_ioctl
	.p2align	4, 0x90
_drm_mode_attachmode_ioctl:             ## @drm_mode_attachmode_ioctl
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	_DRIVER_MODESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_drm_core_check_feature
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_drm_modeset_lock_all
	movl	(%r14), %esi
	movq	_DRM_MODE_OBJECT_CONNECTOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_drm_mode_object_find
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %rdi
	callq	_obj_to_connector
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_drm_mode_create
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r12
	addq	$4, %r14
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_drm_crtc_convert_umode
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_drm_mode_destroy
	jmp	LBB0_10
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_9:
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_drm_mode_attachmode
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r15, %rdi
	callq	_drm_modeset_unlock_all
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRIVER_MODESET,4,2             ## @DRIVER_MODESET
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DRM_MODE_OBJECT_CONNECTOR,4,2  ## @DRM_MODE_OBJECT_CONNECTOR
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid mode\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_mode_attachmode_ioctl      ; -- Begin function drm_mode_attachmode_ioctl
	.p2align	2
_drm_mode_attachmode_ioctl:             ; @drm_mode_attachmode_ioctl
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _DRIVER_MODESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRIVER_MODESET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_drm_core_check_feature
	cbz	w0, LBB0_5
; %bb.1:
	mov	x0, x19
	bl	_drm_modeset_lock_all
	ldr	w1, [x20]
Lloh3:
	adrp	x8, _DRM_MODE_OBJECT_CONNECTOR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRM_MODE_OBJECT_CONNECTOR@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_drm_mode_object_find
	cbz	x0, LBB0_6
; %bb.2:
	bl	_obj_to_connector
	mov	x22, x0
	mov	x0, x19
	bl	_drm_mode_create
	cbz	x0, LBB0_7
; %bb.3:
	mov	x21, x0
	add	x1, x20, #4
	bl	_drm_crtc_convert_umode
	mov	x20, x0
	cbz	w0, LBB0_9
; %bb.4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	mov	x0, x19
	mov	x1, x21
	bl	_drm_mode_destroy
	b	LBB0_10
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_6:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_drm_mode_attachmode
LBB0_10:
	mov	x0, x19
	bl	_drm_modeset_unlock_all
LBB0_11:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_DRIVER_MODESET,4,2             ; @DRIVER_MODESET
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DRM_MODE_OBJECT_CONNECTOR,4,2  ; @DRM_MODE_OBJECT_CONNECTOR
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid mode\n"

.subsections_via_symbols
