	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i915_perf_open_ioctl_locked
_i915_perf_open_ioctl_locked:           ## @i915_perf_open_ioctl_locked
	.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	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	cmpq	$0, 16(%rdx)
	je	LBB0_3
## %bb.1:
	movl	8(%r15), %ebx
	movq	(%rcx), %rdi
	movl	%ebx, %esi
	callq	_i915_gem_context_lookup
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	_ENOENT@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_18
LBB0_3:
	xorl	%r12d, %r12d
LBB0_4:
	movq	%r14, %rdi
	callq	_IS_HASWELL
	testq	%rax, %rax
	setne	%al
	testq	%r12, %r12
	setne	%cl
	andb	%al, %cl
	cmpb	$1, %cl
	je	LBB0_7
## %bb.5:
	movq	_i915_perf_stream_paranoid@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testl	%eax, %eax
	je	LBB0_15
LBB0_7:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:
	movq	%rax, %r13
	movq	%r14, 32(%rax)
	movq	%r12, 24(%rax)
	movq	%rax, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_i915_oa_stream_init
	movq	%r14, %rbx
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.9:
	movq	(%r13), %rax
	xorl	%edi, %edi
	cmpq	(%r15), %rax
	setne	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_19
## %bb.10:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_11:
	movq	8(%r13), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_13
## %bb.12:
	movq	%r13, %rdi
	callq	*%rcx
LBB0_13:
	movq	%r13, %rdi
	callq	_kfree
	testq	%r12, %r12
	jne	LBB0_17
	jmp	LBB0_18
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_16
LBB0_15:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	_EACCES@GOTPCREL(%rip), %rax
LBB0_16:
	subl	(%rax), %r14d
	testq	%r12, %r12
	je	LBB0_18
LBB0_17:
	movq	%r12, %rdi
	callq	_i915_gem_context_put
LBB0_18:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	%r13, %r15
	addq	$16, %r15
	leaq	4(%rbx), %rsi
	movq	%r15, %rdi
	callq	_list_add
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	_I915_PERF_FLAG_FD_CLOEXEC@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %esi
	movl	$0, %eax
	andl	%edx, %esi
	je	LBB0_21
## %bb.20:
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_21:
	movq	_I915_PERF_FLAG_FD_NONBLOCK@GOTPCREL(%rip), %rsi
	andl	(%rsi), %edx
	je	LBB0_23
## %bb.22:
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
LBB0_23:
	orq	%rax, %rcx
	leaq	L_.str.2(%rip), %rdi
	movq	_fops@GOTPCREL(%rip), %rsi
	movq	%r13, %rdx
	callq	_anon_inode_getfd
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_27
## %bb.24:
	movq	_I915_PERF_FLAG_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	jne	LBB0_26
## %bb.25:
	movq	%r13, %rdi
	callq	_i915_perf_enable_locked
LBB0_26:
	movq	%rbx, %rdi
	callq	_drm_dev_get
	jmp	LBB0_18
LBB0_27:
	movq	%r15, %rdi
	callq	_list_del
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to look up context with ID %u for opening perf stream\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_i915_perf_stream_paranoid,8,3  ## @i915_perf_stream_paranoid
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
L_.str.1:                               ## @.str.1
	.asciz	"Insufficient privileges to open system-wide i915 perf stream\n"

	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_I915_PERF_FLAG_FD_CLOEXEC,4,2  ## @I915_PERF_FLAG_FD_CLOEXEC
	.comm	_O_CLOEXEC,8,3                  ## @O_CLOEXEC
	.comm	_I915_PERF_FLAG_FD_NONBLOCK,4,2 ## @I915_PERF_FLAG_FD_NONBLOCK
	.comm	_O_NONBLOCK,8,3                 ## @O_NONBLOCK
L_.str.2:                               ## @.str.2
	.asciz	"[i915_perf]"

	.comm	_fops,4,2                       ## @fops
	.comm	_I915_PERF_FLAG_DISABLED,4,2    ## @I915_PERF_FLAG_DISABLED
	.no_dead_strip	_i915_perf_open_ioctl_locked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i915_perf_open_ioctl_locked
_i915_perf_open_ioctl_locked:           ; @i915_perf_open_ioctl_locked
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x24, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x2, #16]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	w22, [x24, #8]
	ldr	x0, [x3]
	mov	x1, x22
	bl	_i915_gem_context_lookup
	mov	x19, x0
	cbnz	x0, LBB0_4
; %bb.2:
	str	x22, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
Lloh2:
	adrp	x8, _ENOENT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_18
LBB0_3:
	mov	x19, #0
LBB0_4:
	mov	x0, x20
	bl	_IS_HASWELL
	cmp	x19, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_7
; %bb.5:
Lloh5:
	adrp	x8, _i915_perf_stream_paranoid@GOTPAGE
Lloh6:
	ldr	x8, [x8, _i915_perf_stream_paranoid@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
Lloh8:
	adrp	x8, _CAP_SYS_ADMIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_capable
	cbz	w0, LBB0_15
LBB0_7:
Lloh11:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_14
; %bb.8:
	mov	x22, x0
	stp	x19, x20, [x0, #24]
	mov	x1, x21
	mov	x2, x24
	bl	_i915_oa_stream_init
	mov	x23, x0
	cbnz	w0, LBB0_13
; %bb.9:
	ldr	x8, [x22]
	ldr	x9, [x24]
	cmp	x8, x9
	cset	w0, ne
	bl	_WARN_ON
	cbz	x0, LBB0_19
; %bb.10:
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_11:
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.12:
	mov	x0, x22
	blr	x8
LBB0_13:
	mov	x0, x22
	bl	_kfree
	cbnz	x19, LBB0_17
	b	LBB0_18
LBB0_14:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG
Lloh21:
	adrp	x8, _EACCES@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w23, w8
	cbz	x19, LBB0_18
LBB0_17:
	mov	x0, x19
	bl	_i915_gem_context_put
LBB0_18:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_19:
	add	x24, x22, #16
	add	x1, x20, #4
	mov	x0, x24
	bl	_list_add
	ldr	w8, [x21]
Lloh23:
	adrp	x9, _I915_PERF_FLAG_FD_CLOEXEC@GOTPAGE
Lloh24:
	ldr	x9, [x9, _I915_PERF_FLAG_FD_CLOEXEC@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
Lloh26:
	adrp	x10, _O_CLOEXEC@GOTPAGE
Lloh27:
	ldr	x10, [x10, _O_CLOEXEC@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x10]
	tst	w9, w8
	csel	x9, xzr, x10, eq
Lloh29:
	adrp	x10, _I915_PERF_FLAG_FD_NONBLOCK@GOTPAGE
Lloh30:
	ldr	x10, [x10, _I915_PERF_FLAG_FD_NONBLOCK@GOTPAGEOFF]
Lloh31:
	ldr	w10, [x10]
Lloh32:
	adrp	x11, _O_NONBLOCK@GOTPAGE
Lloh33:
	ldr	x11, [x11, _O_NONBLOCK@GOTPAGEOFF]
Lloh34:
	ldr	x11, [x11]
	tst	w10, w8
	csel	x8, xzr, x11, eq
	orr	x3, x8, x9
Lloh35:
	adrp	x0, l_.str.2@PAGE
Lloh36:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh37:
	adrp	x1, _fops@GOTPAGE
Lloh38:
	ldr	x1, [x1, _fops@GOTPAGEOFF]
	mov	x2, x22
	bl	_anon_inode_getfd
	mov	x23, x0
	tbnz	w0, #31, LBB0_23
; %bb.20:
	ldr	w8, [x21]
Lloh39:
	adrp	x9, _I915_PERF_FLAG_DISABLED@GOTPAGE
Lloh40:
	ldr	x9, [x9, _I915_PERF_FLAG_DISABLED@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_22
; %bb.21:
	mov	x0, x22
	bl	_i915_perf_enable_locked
LBB0_22:
	mov	x0, x20
	bl	_drm_dev_get
	b	LBB0_18
LBB0_23:
	mov	x0, x24
	bl	_list_del
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to look up context with ID %u for opening perf stream\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_i915_perf_stream_paranoid,8,3  ; @i915_perf_stream_paranoid
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
l_.str.1:                               ; @.str.1
	.asciz	"Insufficient privileges to open system-wide i915 perf stream\n"

	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_I915_PERF_FLAG_FD_CLOEXEC,4,2  ; @I915_PERF_FLAG_FD_CLOEXEC
	.comm	_O_CLOEXEC,8,3                  ; @O_CLOEXEC
	.comm	_I915_PERF_FLAG_FD_NONBLOCK,4,2 ; @I915_PERF_FLAG_FD_NONBLOCK
	.comm	_O_NONBLOCK,8,3                 ; @O_NONBLOCK
l_.str.2:                               ; @.str.2
	.asciz	"[i915_perf]"

	.comm	_fops,4,2                       ; @fops
	.comm	_I915_PERF_FLAG_DISABLED,4,2    ; @I915_PERF_FLAG_DISABLED
	.no_dead_strip	_i915_perf_open_ioctl_locked
.subsections_via_symbols
