	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msm_ringbuffer_new             ## -- Begin function msm_ringbuffer_new
	.p2align	4, 0x90
_msm_ringbuffer_new:                    ## @msm_ringbuffer_new
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -84(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movl	%esi, %r13d
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MSM_GPU_RINGBUFFER_SZ@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_is_power_of_2
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUILD_BUG_ON
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$80, %edi
	callq	_kzalloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r14, 72(%rbx)
	movl	%r13d, (%rbx)
	movl	(%r15), %esi
	movq	_MSM_BO_WC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r14), %edi
	movl	4(%r14), %ecx
	leaq	64(%rbx), %r8
	leaq	68(%rbx), %r9
	callq	_msm_gem_kernel_new
	movq	%rax, 32(%rbx)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	32(%rbx), %rdi
	callq	_PTR_ERR
	movl	%eax, %r14d
	movq	$0, 32(%rbx)
	jmp	LBB0_4
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_4:
	movq	%rbx, %rdi
	callq	_msm_ringbuffer_destroy
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.5:
	movl	%r14d, %edi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_6:
	movl	64(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_msm_gem_object_set_name
	movq	32(%rbx), %rax
	movl	(%r15), %ecx
	sarl	$2, %ecx
	movslq	%ecx, %rcx
	addq	%rax, %rcx
	movq	%rcx, 56(%rbx)
	movq	%rax, 48(%rbx)
	movq	%rax, 40(%rbx)
	movq	%r12, 24(%rbx)
	movl	-84(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 16(%rbx)
	leaq	12(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, %rdi
	addq	$8, %rdi
	callq	_spin_lock_init
	movl	(%rbx), %ecx
	leaq	L_.str.1(%rip), %rdx
	leaq	-80(%rbp), %r15
	movq	%r15, %rdi
	movl	$32, %esi
	callq	_snprintf
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	_msm_fence_context_alloc
	movl	%eax, 4(%rbx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movq	%rbx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MSM_GPU_RINGBUFFER_SZ,4,2      ## @MSM_GPU_RINGBUFFER_SZ
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MSM_BO_WC,4,2                  ## @MSM_BO_WC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ring%d"

L_.str.1:                               ## @.str.1
	.asciz	"gpu-ring-%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msm_ringbuffer_new             ; -- Begin function msm_ringbuffer_new
	.p2align	2
_msm_ringbuffer_new:                    ; @msm_ringbuffer_new
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
Lloh3:
	adrp	x24, _MSM_GPU_RINGBUFFER_SZ@GOTPAGE
Lloh4:
	ldr	x24, [x24, _MSM_GPU_RINGBUFFER_SZ@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_is_power_of_2
	cmp	w0, #0
	cset	w0, eq
	bl	_BUILD_BUG_ON
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #80
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_3
; %bb.1:
	str	x20, [x19, #72]
	str	w23, [x19]
Lloh8:
	adrp	x8, _MSM_BO_WC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MSM_BO_WC@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh10:
	ldr	w2, [x8]
	ldp	w0, w3, [x20]
	add	x4, x19, #64
	add	x5, x19, #68
	bl	_msm_gem_kernel_new
	str	x0, [x19, #32]
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.2:
	ldr	x0, [x19, #32]
	bl	_PTR_ERR
	mov	x20, x0
	str	xzr, [x19, #32]
	b	LBB0_4
LBB0_3:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	mov	x0, x19
	bl	_msm_ringbuffer_destroy
	ldr	x8, [sp, #40]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.5:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_ERR_PTR
LBB0_6:
	ldr	w0, [x19, #64]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x23
	bl	_msm_gem_object_set_name
	ldr	x8, [x19, #32]
	ldr	w9, [x24]
	asr	w9, w9, #2
	add	x9, x8, w9, sxtw
	stp	x8, x9, [x19, #48]
	str	x8, [x19, #40]
	str	x22, [x19, #24]
	str	w21, [x19, #16]
	add	x0, x19, #12
	bl	_INIT_LIST_HEAD
	add	x0, x19, #8
	bl	_spin_lock_init
	ldr	w3, [x19]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	add	x0, sp, #8
	mov	w1, #32
	bl	_snprintf
	ldr	w0, [x20]
	add	x1, sp, #8
	bl	_msm_fence_context_alloc
	str	w0, [x19, #4]
	ldr	x8, [sp, #40]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MSM_GPU_RINGBUFFER_SZ,4,2      ; @MSM_GPU_RINGBUFFER_SZ
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MSM_BO_WC,4,2                  ; @MSM_BO_WC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ring%d"

l_.str.1:                               ; @.str.1
	.asciz	"gpu-ring-%d"

.subsections_via_symbols
