	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_legacy_addmap_ioctl        ## -- Begin function drm_legacy_addmap_ioctl
	.p2align	4, 0x90
_drm_legacy_addmap_ioctl:               ## @drm_legacy_addmap_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testq	%rax, %rax
	je	LBB0_1
LBB0_5:
	movq	_DRIVER_KMS_LEGACY_CONTEXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_drm_core_check_feature
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:
	movq	_DRIVER_LEGACY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_drm_core_check_feature
	testl	%eax, %eax
	je	LBB0_7
LBB0_8:
	movl	32(%rbx), %esi
	movl	28(%rbx), %edx
	movq	(%rbx), %rcx
	movl	24(%rbx), %r8d
	leaq	-24(%rbp), %r9
	movq	%r14, %rdi
	callq	_drm_addmap_core
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	movl	$-1, 8(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_1:
	movq	(%rbx), %rax
	movq	__DRM_AGP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.2:
	movq	__DRM_SHM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.3:
	movq	_EPERM@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_7:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
LBB0_4:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
	.comm	__DRM_AGP,8,3                   ## @_DRM_AGP
	.comm	__DRM_SHM,8,3                   ## @_DRM_SHM
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_DRIVER_KMS_LEGACY_CONTEXT,4,2  ## @DRIVER_KMS_LEGACY_CONTEXT
	.comm	_DRIVER_LEGACY,4,2              ## @DRIVER_LEGACY
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_legacy_addmap_ioctl        ; -- Begin function drm_legacy_addmap_ioctl
	.p2align	2
_drm_legacy_addmap_ioctl:               ; @drm_legacy_addmap_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _CAP_SYS_ADMIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_capable
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x19]
Lloh3:
	adrp	x9, __DRM_AGP@GOTPAGE
Lloh4:
	ldr	x9, [x9, __DRM_AGP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, __DRM_SHM@GOTPAGE
Lloh7:
	ldr	x10, [x10, __DRM_SHM@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_6
LBB0_2:
Lloh9:
	adrp	x8, _DRIVER_KMS_LEGACY_CONTEXT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DRIVER_KMS_LEGACY_CONTEXT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_drm_core_check_feature
	cbnz	w0, LBB0_4
; %bb.3:
Lloh12:
	adrp	x8, _DRIVER_LEGACY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DRIVER_LEGACY@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_drm_core_check_feature
	cbz	w0, LBB0_7
LBB0_4:
	ldp	w2, w1, [x19, #28]
	ldr	x3, [x19]
	ldr	w4, [x19, #24]
	add	x5, sp, #8
	mov	x0, x20
	bl	_drm_addmap_core
	cbnz	w0, LBB0_9
; %bb.5:
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	str	x8, [x19, #16]
	mov	w8, #-1
	str	w8, [x19, #8]
	b	LBB0_9
LBB0_6:
Lloh15:
	adrp	x8, _EPERM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh17:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
	.comm	__DRM_AGP,8,3                   ; @_DRM_AGP
	.comm	__DRM_SHM,8,3                   ; @_DRM_SHM
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_DRIVER_KMS_LEGACY_CONTEXT,4,2  ; @DRIVER_KMS_LEGACY_CONTEXT
	.comm	_DRIVER_LEGACY,4,2              ; @DRIVER_LEGACY
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
.subsections_via_symbols
