	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_device_wb_init
_amdgpu_device_wb_init:                 ## @amdgpu_device_wb_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r14d, %r14d
	cmpq	$0, 24(%rdi)
	jne	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	leaq	24(%rdi), %r8
	movq	_AMDGPU_MAX_WB@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	shll	$5, %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AMDGPU_GEM_DOMAIN_GTT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	16(%rdi), %r9
	leaq	8(%rdi), %rax
	movq	%rax, (%rsp)
	callq	_amdgpu_bo_create_kernel
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r14d
	movl	32(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	jmp	LBB0_4
LBB0_3:
	movl	(%r15), %eax
	movl	%eax, (%rbx)
	leaq	4(%rbx), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_memset
	movq	8(%rbx), %rdi
	movl	(%r15), %edx
	shll	$5, %edx
	xorl	%esi, %esi
	callq	_memset
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_MAX_WB,4,2              ## @AMDGPU_MAX_WB
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_GTT,4,2      ## @AMDGPU_GEM_DOMAIN_GTT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%d) create WB bo failed\n"

	.no_dead_strip	_amdgpu_device_wb_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_device_wb_init
_amdgpu_device_wb_init:                 ; @amdgpu_device_wb_init
	.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	x4, x0
	ldr	x8, [x4, #24]!
	cbz	x8, LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_5
LBB0_2:
	mov	x19, x0
Lloh0:
	adrp	x21, _AMDGPU_MAX_WB@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AMDGPU_MAX_WB@GOTPAGEOFF]
	ldr	w8, [x21]
	lsl	w1, w8, #5
Lloh2:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
Lloh5:
	adrp	x8, _AMDGPU_GEM_DOMAIN_GTT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AMDGPU_GEM_DOMAIN_GTT@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	add	x5, x0, #16
	add	x6, x0, #8
	bl	_amdgpu_bo_create_kernel
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x19, #32]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_warn
	b	LBB0_5
LBB0_4:
	ldr	w8, [x21]
	str	w8, [x19]
	add	x0, x19, #4
	mov	w1, #0
	mov	w2, #1
	bl	_memset
	ldr	x0, [x19, #8]
	ldr	w8, [x21]
	lsl	w2, w8, #5
	mov	w1, #0
	bl	_memset
LBB0_5:
	mov	x0, x20
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_MAX_WB,4,2              ; @AMDGPU_MAX_WB
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_GTT,4,2      ; @AMDGPU_GEM_DOMAIN_GTT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%d) create WB bo failed\n"

	.no_dead_strip	_amdgpu_device_wb_init
.subsections_via_symbols
