	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_oa_buffer
_alloc_oa_buffer:                       ## @alloc_oa_buffer
	.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	%rdi, %r12
	movq	(%rdi), %rdi
	movq	16(%r12), %r14
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	movq	%r14, %rdi
	callq	_i915_mutex_lock_interruptible
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.3:
	movq	_OA_BUFFER_SIZE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_BUILD_BUG_ON_NOT_POWER_OF_2
	movq	(%rbx), %rax
	movq	_SZ_128K@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setl	%cl
	movq	_SZ_16M@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	setg	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_BUILD_BUG_ON
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_i915_gem_object_create_shmem
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_5:
	movq	_I915_CACHE_LLC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i915_gem_object_set_cache_coherency
	movq	(%r13), %rcx
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	callq	_i915_gem_object_ggtt_pin
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_7:
	movq	%r13, (%r12)
	movq	_I915_MAP_WB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i915_gem_object_pin_map
	movq	%rax, 8(%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:
	movq	8(%r12), %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	___i915_vma_unpin
LBB0_9:
	movq	%r15, %rdi
	callq	_i915_gem_object_put
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r12)
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	(%r12), %rdi
	callq	_i915_ggtt_offset
	movq	8(%r12), %rdx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_DEBUG_DRIVER
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_OA_BUFFER_SIZE,8,3             ## @OA_BUFFER_SIZE
	.comm	_SZ_128K,8,3                    ## @SZ_128K
	.comm	_SZ_16M,8,3                     ## @SZ_16M
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate OA buffer\n"

	.comm	_I915_CACHE_LLC,4,2             ## @I915_CACHE_LLC
	.comm	_I915_MAP_WB,4,2                ## @I915_MAP_WB
L_.str.1:                               ## @.str.1
	.asciz	"OA Buffer initialized, gtt offset = 0x%x, vaddr = %p\n"

	.no_dead_strip	_alloc_oa_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_oa_buffer
_alloc_oa_buffer:                       ; @alloc_oa_buffer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x0
	ldr	x19, [x0, #16]
	ldr	x0, [x0]
	bl	_WARN_ON
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_11
LBB0_2:
	mov	x0, x19
	bl	_i915_mutex_lock_interruptible
	mov	x22, x0
	cbnz	w0, LBB0_11
; %bb.3:
Lloh3:
	adrp	x21, _OA_BUFFER_SIZE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _OA_BUFFER_SIZE@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_BUILD_BUG_ON_NOT_POWER_OF_2
	ldr	x8, [x21]
Lloh5:
	adrp	x9, _SZ_128K@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SZ_128K@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
Lloh8:
	adrp	x22, _SZ_16M@GOTPAGE
Lloh9:
	ldr	x22, [x22, _SZ_16M@GOTPAGEOFF]
	ldr	x9, [x22]
	ccmp	x8, x9, #0, ge
	cset	w0, gt
	bl	_BUILD_BUG_ON
	ldr	x1, [x21]
	mov	x0, x19
	bl	_i915_gem_object_create_shmem
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.4:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x21
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_10
LBB0_5:
Lloh12:
	adrp	x8, _I915_CACHE_LLC@GOTPAGE
Lloh13:
	ldr	x8, [x8, _I915_CACHE_LLC@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i915_gem_object_set_cache_coherency
	ldr	x3, [x22]
	mov	x0, x21
	mov	x1, #0
	mov	w2, #0
	mov	w4, #0
	bl	_i915_gem_object_ggtt_pin
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.6:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_9
LBB0_7:
	str	x23, [x20]
Lloh15:
	adrp	x8, _I915_MAP_WB@GOTPAGE
Lloh16:
	ldr	x8, [x8, _I915_MAP_WB@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i915_gem_object_pin_map
	str	x0, [x20, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_12
; %bb.8:
	ldr	x0, [x20, #8]
	bl	_PTR_ERR
	mov	x22, x0
	mov	x0, x23
	bl	___i915_vma_unpin
LBB0_9:
	mov	x0, x21
	bl	_i915_gem_object_put
	stp	xzr, xzr, [x20]
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x0, [x20]
	bl	_i915_ggtt_offset
	mov	x1, x0
	ldr	x2, [x20, #8]
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	mov	w22, #0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_OA_BUFFER_SIZE,8,3             ; @OA_BUFFER_SIZE
	.comm	_SZ_128K,8,3                    ; @SZ_128K
	.comm	_SZ_16M,8,3                     ; @SZ_16M
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate OA buffer\n"

	.comm	_I915_CACHE_LLC,4,2             ; @I915_CACHE_LLC
	.comm	_I915_MAP_WB,4,2                ; @I915_MAP_WB
l_.str.1:                               ; @.str.1
	.asciz	"OA Buffer initialized, gtt offset = 0x%x, vaddr = %p\n"

	.no_dead_strip	_alloc_oa_buffer
.subsections_via_symbols
