	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gfx_kiq_init_ring       ## -- Begin function amdgpu_gfx_kiq_init_ring
	.p2align	4, 0x90
_amdgpu_gfx_kiq_init_ring:              ## @amdgpu_gfx_kiq_init_ring
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	addq	$16, %rdi
	callq	_spin_lock_init
	leaq	8(%r12), %rsi
	movq	%r12, %rdi
	callq	_amdgpu_device_wb_get
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%r15)
	movl	$1, (%r15)
	movl	4(%r12), %eax
	movl	%eax, 24(%r15)
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_amdgpu_gfx_kiq_acquire
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	movl	12(%r12), %eax
	movl	%eax, 20(%r15)
	movl	16(%r15), %edi
	movl	4(%r15), %edx
	movl	8(%r15), %ecx
	movl	12(%r15), %r8d
	leaq	L_.str(%rip), %rsi
	callq	_sprintf
	movq	_AMDGPU_CP_KIQ_IRQ_DRIVER0@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$1024, %edx                     ## imm = 0x400
	movq	%r14, %rcx
	callq	_amdgpu_ring_init
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %ebx
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	jmp	LBB0_5
LBB0_3:
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kiq_%d.%d.%d"

	.comm	_AMDGPU_CP_KIQ_IRQ_DRIVER0,4,2  ## @AMDGPU_CP_KIQ_IRQ_DRIVER0
L_.str.1:                               ## @.str.1
	.asciz	"(%d) failed to init kiq ring\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gfx_kiq_init_ring       ; -- Begin function amdgpu_gfx_kiq_init_ring
	.p2align	2
_amdgpu_gfx_kiq_init_ring:              ; @amdgpu_gfx_kiq_init_ring
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	add	x0, x0, #16
	bl	_spin_lock_init
	add	x1, x19, #8
	mov	x0, x19
	bl	_amdgpu_device_wb_get
	mov	x22, x0
	cbnz	w0, LBB0_4
; %bb.1:
	stp	xzr, xzr, [x21, #32]
	mov	w8, #1
	str	w8, [x21]
	ldr	w8, [x19, #4]
	str	w8, [x21, #24]
	mov	x0, x19
	mov	x1, x21
	bl	_amdgpu_gfx_kiq_acquire
	mov	x22, x0
	cbnz	w0, LBB0_4
; %bb.2:
	ldr	w8, [x19, #12]
	str	w8, [x21, #20]
	ldp	w2, w3, [x21, #4]
	ldp	w4, w0, [x21, #12]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_sprintf
Lloh2:
	adrp	x8, _AMDGPU_CP_KIQ_IRQ_DRIVER0@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AMDGPU_CP_KIQ_IRQ_DRIVER0@GOTPAGEOFF]
Lloh4:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1024
	mov	x3, x20
	bl	_amdgpu_ring_init
	mov	x22, x0
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_dev_warn
LBB0_4:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kiq_%d.%d.%d"

	.comm	_AMDGPU_CP_KIQ_IRQ_DRIVER0,4,2  ; @AMDGPU_CP_KIQ_IRQ_DRIVER0
l_.str.1:                               ; @.str.1
	.asciz	"(%d) failed to init kiq ring\n"

.subsections_via_symbols
