	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ras_reserve_bad_pages   ## -- Begin function amdgpu_ras_reserve_bad_pages
	.p2align	4, 0x90
_amdgpu_ras_reserve_bad_pages:          ## @amdgpu_ras_reserve_bad_pages
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_amdgpu_ras_get_context
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %rbx
	cmpq	$0, 8(%rax)
	je	LBB0_9
## %bb.2:
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %r12
	testq	%r12, %r12
	je	LBB0_8
## %bb.3:
	movslq	(%r12), %r14
	cmpl	4(%r12), %r14d
	jge	LBB0_8
## %bb.4:
	movq	8(%r12), %rax
	movq	%r14, %r15
	shlq	$4, %r15
	leal	1(%r14), %r13d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rcx
	movq	8(%r12), %rax
	movq	%rcx, 8(%rax,%r15)
	incq	%r14
	movl	%r13d, (%r12)
	movslq	4(%r12), %rcx
	addq	$16, %r15
	incl	%r13d
	cmpq	%rcx, %r14
	jge	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rax,%r15), %ebx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	movl	%ebx, %esi
	shll	%cl, %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	-64(%rbp), %rcx
	callq	_amdgpu_ras_reserve_vram
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_DRM_ERROR
	jmp	LBB0_7
LBB0_8:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_9:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RAS ERROR: reserve vram %llx fail\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ras_reserve_bad_pages   ; -- Begin function amdgpu_ras_reserve_bad_pages
	.p2align	2
_amdgpu_ras_reserve_bad_pages:          ; @amdgpu_ras_reserve_bad_pages
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_amdgpu_ras_get_context
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_9
; %bb.2:
	mov	x0, x20
	bl	_mutex_lock
	ldr	x23, [x20, #8]
	cbz	x23, LBB0_8
; %bb.3:
	ldp	w24, w8, [x23]
                                        ; kill: def $w24 killed $w24 def $x24
	sxtw	x24, w24
	cmp	w24, w8
	b.ge	LBB0_8
; %bb.4:
	ldr	x8, [x23, #8]
	lsl	x25, x24, #4
	add	w26, w24, #1
Lloh0:
	adrp	x27, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x27, [x27, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	adrp	x28, _PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x28, [x28, _PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	adrp	x21, l_.str@PAGE
Lloh5:
	add	x21, x21, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x9, [sp, #8]
	ldr	x8, [x23, #8]
	add	x10, x8, x25
	str	x9, [x10, #8]
	add	x24, x24, #1
	str	w26, [x23]
	ldrsw	x9, [x23, #4]
	add	x25, x25, #16
	add	w26, w26, #1
	cmp	x24, x9
	b.ge	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x8, x25]
	ldr	w8, [x27]
	lsl	w1, w22, w8
	ldr	w2, [x28]
	add	x3, sp, #8
	mov	x0, x19
	bl	_amdgpu_ras_reserve_vram
	cbz	x0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_DRM_ERROR
	b	LBB0_5
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_9:
	mov	w0, #0
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RAS ERROR: reserve vram %llx fail\n"

.subsections_via_symbols
