	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ih_ring_init            ## -- Begin function amdgpu_ih_ring_init
	.p2align	4, 0x90
_amdgpu_ih_ring_init:                   ## @amdgpu_ih_ring_init
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rsi, %r12
	movq	%rdi, %r14
	shrl	$2, %edx
	movl	%edx, %edi
	callq	_order_base_2
	movl	$4, %esi
	movl	%eax, %ecx
	shll	%cl, %esi
	movl	%esi, (%r12)
	leal	-1(%rsi), %eax
	movl	%eax, 4(%r12)
	movq	$0, 72(%r12)
	movl	%ebx, 8(%r12)
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.1:
	xorl	%r15d, %r15d
	cmpq	$0, 48(%r12)
	jne	LBB0_11
## %bb.2:
	movl	16(%r14), %edi
	addl	$8, %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_dma_alloc_coherent
	movq	%rax, 48(%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	(%r12), %edx
	addl	$8, %edx
	xorl	%r15d, %r15d
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	-48(%rbp), %rax
	movq	%rax, 56(%r12)
	movl	(%r12), %ecx
	leaq	(%rax,%rcx), %rdx
	movq	%rdx, 40(%r12)
	movq	48(%r12), %rdx
	addq	%rcx, %rax
	addq	$4, %rax
                                        ## kill: def $ecx killed $ecx killed $rcx def $rcx
	andl	$-4, %ecx
	leaq	(%rdx,%rcx), %rsi
	movq	%rsi, 32(%r12)
	movq	%rax, 24(%r12)
	leaq	(%rdx,%rcx), %rax
	addq	$4, %rax
	movq	%rax, 16(%r12)
	jmp	LBB0_11
LBB0_5:
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_amdgpu_device_wb_get
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	leaq	-36(%rbp), %rsi
	movq	%r14, %rdi
	callq	_amdgpu_device_wb_get
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:
	movl	(%r12), %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AMDGPU_GEM_DOMAIN_GTT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	64(%r12), %r8
	leaq	56(%r12), %r9
	leaq	48(%r12), %rax
	movq	%rax, (%rsp)
	movq	%r14, %rdi
	callq	_amdgpu_bo_create_kernel
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, %r15d
	movl	-36(%rbp), %esi
	movq	%r14, %rdi
	callq	_amdgpu_device_wb_free
LBB0_9:
	movl	-48(%rbp), %esi
	movq	%r14, %rdi
	callq	_amdgpu_device_wb_free
	jmp	LBB0_11
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	8(%r14), %rax
	movl	-48(%rbp), %ecx
	leal	(,%rcx,4), %edx
	addq	%rax, %rdx
	movq	%rdx, 40(%r12)
	movq	(%r14), %rdx
	leaq	(%rdx,%rcx,4), %rcx
	movq	%rcx, 32(%r12)
	movl	-36(%rbp), %ecx
	leal	(,%rcx,4), %esi
	addq	%rax, %rsi
	movq	%rsi, 24(%r12)
	leaq	(%rdx,%rcx,4), %rax
	movq	%rax, 16(%r12)
	xorl	%r15d, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_GTT,4,2      ## @AMDGPU_GEM_DOMAIN_GTT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ih_ring_init            ; -- Begin function amdgpu_ih_ring_init
	.p2align	2
_amdgpu_ih_ring_init:                   ; @amdgpu_ih_ring_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x3
	mov	x19, x1
	mov	x20, x0
	lsr	w0, w2, #2
	bl	_order_base_2
	mov	w8, #4
	lsl	w8, w8, w0
	sub	w9, w8, #1
	stp	w8, w9, [x19]
	str	xzr, [x19, #72]
	str	w21, [x19, #8]
	cbz	w21, LBB0_3
; %bb.1:
	ldr	x9, [x19, #48]
	cbz	x9, LBB0_8
; %bb.2:
	mov	w21, #0
	b	LBB0_12
LBB0_3:
	add	x1, sp, #8
	mov	x0, x20
	bl	_amdgpu_device_wb_get
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.4:
	add	x1, sp, #4
	mov	x0, x20
	bl	_amdgpu_device_wb_get
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.5:
	mov	x6, x19
	ldr	w1, [x6], #48
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _AMDGPU_GEM_DOMAIN_GTT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AMDGPU_GEM_DOMAIN_GTT@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x4, x19, #64
	add	x5, x19, #56
	mov	x0, x20
	bl	_amdgpu_bo_create_kernel
	mov	x21, x0
	cbz	w0, LBB0_13
; %bb.6:
	ldr	w1, [sp, #4]
	mov	x0, x20
	bl	_amdgpu_device_wb_free
LBB0_7:
	ldr	w1, [sp, #8]
	mov	x0, x20
	bl	_amdgpu_device_wb_free
	b	LBB0_12
LBB0_8:
	ldr	w0, [x20, #16]
	add	w1, w8, #8
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	add	x2, sp, #8
	bl	_dma_alloc_coherent
	str	x0, [x19, #48]
	cbz	x0, LBB0_11
; %bb.9:
	ldr	w8, [x19]
	add	w2, w8, #8
	mov	w1, #0
	bl	_memset
	mov	w21, #0
	ldr	x8, [sp, #8]
	str	x8, [x19, #56]
	ldr	w9, [x19]
	add	x8, x8, x9
	ldr	x10, [x19, #48]
	lsr	x9, x9, #2
	add	x11, x10, x9, lsl #2
	stp	x11, x8, [x19, #32]
	add	x8, x8, #4
	add	w9, w9, #1
	add	x9, x10, w9, uxtw #2
LBB0_10:
	stp	x9, x8, [x19, #16]
	b	LBB0_12
LBB0_11:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_13:
	ldr	x8, [x20, #8]
	ldr	w9, [sp, #8]
	lsl	w10, w9, #2
	add	x10, x8, x10
	str	x10, [x19, #40]
	ldr	x10, [x20]
	add	x9, x10, x9, lsl #2
	str	x9, [x19, #32]
	ldr	w9, [sp, #4]
	lsl	w11, w9, #2
	add	x8, x8, x11
	add	x9, x10, x9, lsl #2
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_GTT,4,2      ; @AMDGPU_GEM_DOMAIN_GTT
.subsections_via_symbols
