	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_compat_ioctl               ## -- Begin function mga_compat_ioctl
	.p2align	4, 0x90
_mga_compat_ioctl:                      ## @mga_compat_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r15
	movl	%esi, %edi
	callq	_DRM_IOCTL_NR
	movl	%eax, %ebx
	movq	_DRM_COMMAND_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	cmpl	%r13d, %ebx
	jae	LBB0_1
## %bb.6:
	movq	%r15, %rdi
	movl	%r12d, %esi
	movq	%r14, %rdx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_drm_compat_ioctl               ## TAILCALL
LBB0_1:
	movq	(%r15), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_mga_compat_ioctls@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	addl	%r13d, %eax
	cmpl	%eax, %ebx
	jae	LBB0_7
## %bb.2:
	movl	%ebx, %eax
	movq	_DRM_COMMAND_BASE@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movq	_mga_compat_ioctls@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shlq	$4, %rax
	movq	(%rcx,%rax), %r13
	testq	%r13, %r13
	je	LBB0_7
## %bb.3:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_task_pid_nr
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	8(%r13), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_old_encode_dev
	movl	(%r13), %ecx
	movq	_mga_compat_ioctls@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	_DRM_COMMAND_BASE@GOTPCREL(%rip), %rsi
	subl	(%rsi), %ebx
	shlq	$4, %rbx
	movl	8(%rdx,%rbx), %r8d
	leaq	L_.str(%rip), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	%r15, %rdi
	movl	%r12d, %esi
	movq	%r14, %rdx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
LBB0_5:
	movslq	%ebx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r15, %rdi
	movl	%r12d, %esi
	movq	%r14, %rdx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_drm_ioctl                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_COMMAND_BASE,4,2           ## @DRM_COMMAND_BASE
	.comm	_mga_compat_ioctls,8,3          ## @mga_compat_ioctls
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pid=%d, dev=0x%lx, auth=%d, %s\n"

	.comm	_current,4,2                    ## @current
L_.str.1:                               ## @.str.1
	.asciz	"ret = %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_compat_ioctl               ; -- Begin function mga_compat_ioctl
	.p2align	2
_mga_compat_ioctl:                      ; @mga_compat_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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 w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_DRM_IOCTL_NR
Lloh0:
	adrp	x24, _DRM_COMMAND_BASE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _DRM_COMMAND_BASE@GOTPAGEOFF]
	ldr	w23, [x24]
	cmp	w0, w23
	b.hs	LBB0_2
; %bb.1:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_drm_compat_ioctl
LBB0_2:
	mov	x22, x0
	ldr	x25, [x21]
Lloh2:
	adrp	x27, _mga_compat_ioctls@GOTPAGE
Lloh3:
	ldr	x27, [x27, _mga_compat_ioctls@GOTPAGEOFF]
	ldr	x0, [x27]
	bl	_ARRAY_SIZE
	add	w8, w0, w23
	cmp	w22, w8
	b.hs	LBB0_7
; %bb.3:
	ldr	x8, [x27]
	ldr	w9, [x24]
	sub	w9, w22, w9
	lsl	x9, x9, #4
	ldr	x26, [x8, x9]
	cbz	x26, LBB0_7
; %bb.4:
Lloh4:
	adrp	x8, _current@GOTPAGE
Lloh5:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_task_pid_nr
	mov	x23, x0
	ldr	x8, [x25, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_old_encode_dev
	ldr	x8, [x27]
	ldr	w9, [x24]
	sub	w9, w22, w9
	add	x8, x8, w9, uxtw #4
	ldr	w8, [x8, #8]
	ldr	w9, [x25]
	stp	x9, x8, [sp, #8]
	str	x0, [sp]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	bl	_DRM_DEBUG
	ldr	x8, [x26]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	blr	x8
	mov	x19, x0
	cbz	w0, LBB0_6
; %bb.5:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_DRM_DEBUG
LBB0_6:
	sxtw	x0, w19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_7:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_drm_ioctl
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_COMMAND_BASE,4,2           ; @DRM_COMMAND_BASE
	.comm	_mga_compat_ioctls,8,3          ; @mga_compat_ioctls
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pid=%d, dev=0x%lx, auth=%d, %s\n"

	.comm	_current,4,2                    ; @current
l_.str.1:                               ; @.str.1
	.asciz	"ret = %d\n"

.subsections_via_symbols
