	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ras_add_bad_pages       ## -- Begin function amdgpu_ras_add_bad_pages
	.p2align	4, 0x90
_amdgpu_ras_add_bad_pages:              ## @amdgpu_ras_add_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r13
	callq	_amdgpu_ras_get_context
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_26
## %bb.1:
	testl	%ebx, %ebx
	jle	LBB0_26
## %bb.2:
	testq	%r15, %r15
	je	LBB0_26
## %bb.3:
	movq	%rax, %r12
	cmpq	$0, 8(%rax)
	je	LBB0_26
## %bb.4:
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	8(%r12), %r11
	xorl	%r14d, %r14d
	testq	%r11, %r11
	je	LBB0_25
## %bb.5:
	cmpl	%ebx, (%r11)
	jg	LBB0_8
## %bb.6:
	movq	%r13, %rdi
	movq	%r11, %rsi
	movl	%ebx, %edx
	movq	%r11, %r13
	callq	_amdgpu_ras_realloc_eh_data_space
	movq	%r13, %r11
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_25
LBB0_8:
	movq	8(%r11), %rcx
	movslq	4(%r11), %rax
	movl	%ebx, %edx
	leal	-1(%rbx), %r10d
	cmpl	$3, %r10d
	jb	LBB0_20
## %bb.9:
	leaq	(%rcx,%rax,8), %rsi
	leaq	(%r15,%rdx,8), %rdi
	cmpq	%rdi, %rsi
	jae	LBB0_11
## %bb.10:
	leaq	(%rax,%r10), %rsi
	movq	%r10, %rdi
	notq	%rdi
	addq	%rdx, %rdi
	leaq	(%r15,%rdi,8), %rdi
	leaq	(%rcx,%rsi,8), %rsi
	addq	$8, %rsi
	cmpq	%rsi, %rdi
	jb	LBB0_20
LBB0_11:
	incq	%r10
	movq	%r10, %r8
	andq	$-4, %r8
	leaq	-4(%r8), %rsi
	movq	%rsi, %r9
	shrq	$2, %r9
	incq	%r9
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.13:
	movq	%r11, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r13
	movq	%r9, %rsi
	andq	$-2, %rsi
	leaq	(%rcx,%rax,8), %rbx
	addq	$48, %rbx
	leaq	(%r15,%rdx,8), %r11
	addq	$-16, %r11
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%r11,%rdi,8), %xmm0
	movdqu	(%r11,%rdi,8), %xmm1
	pshufd	$78, %xmm1, %xmm1               ## xmm1 = xmm1[2,3,0,1]
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm1, -48(%rbx)
	movdqu	%xmm0, -32(%rbx)
	movdqu	-48(%r11,%rdi,8), %xmm0
	movdqu	-32(%r11,%rdi,8), %xmm1
	pshufd	$78, %xmm1, %xmm1               ## xmm1 = xmm1[2,3,0,1]
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm1, -16(%rbx)
	movdqu	%xmm0, (%rbx)
	addq	$64, %rbx
	addq	$-8, %rdi
	addq	$-2, %rsi
	jne	LBB0_14
## %bb.15:
	negq	%rdi
	movq	%r13, %rbx
	movq	-48(%rbp), %r11                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_12:
	xorl	%edi, %edi
LBB0_16:
	testb	$1, %r9b
	je	LBB0_18
## %bb.17:
	leaq	(%rdi,%rax), %rsi
	notq	%rdi
	addq	%rdx, %rdi
	movdqu	-24(%r15,%rdi,8), %xmm0
	movdqu	-8(%r15,%rdi,8), %xmm1
	pshufd	$78, %xmm1, %xmm1               ## xmm1 = xmm1[2,3,0,1]
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm1, (%rcx,%rsi,8)
	movdqu	%xmm0, 16(%rcx,%rsi,8)
LBB0_18:
	addq	%r8, %rax
	cmpq	%r8, %r10
	je	LBB0_24
## %bb.19:
	subq	%r8, %rdx
LBB0_20:
	leal	-1(%rdx), %r8d
	movl	%edx, %edi
	movq	%rbx, %rsi
	andl	$3, %edi
	je	LBB0_22
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	-8(%r15,%rdx,8), %rbx
	decq	%rdx
	movq	%rbx, (%rcx,%rax,8)
	incq	%rax
	decl	%edi
	jne	LBB0_21
LBB0_22:
	cmpl	$3, %r8d
	movq	%rsi, %rbx
	jb	LBB0_24
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	-8(%r15,%rdx,8), %rsi
	movq	%rsi, (%rcx,%rax,8)
	movq	-16(%r15,%rdx,8), %rsi
	movq	%rsi, 8(%rcx,%rax,8)
	movq	-24(%r15,%rdx,8), %rsi
	movq	%rsi, 16(%rcx,%rax,8)
	movq	-32(%r15,%rdx,8), %rsi
	addq	$-4, %rdx
	movq	%rsi, 24(%rcx,%rax,8)
	addq	$4, %rax
	testl	%edx, %edx
	jne	LBB0_23
LBB0_24:
	movl	%eax, 4(%r11)
	subl	%ebx, (%r11)
LBB0_25:
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_26:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ras_add_bad_pages       ; -- Begin function amdgpu_ras_add_bad_pages
	.p2align	2
_amdgpu_ras_add_bad_pages:              ; @amdgpu_ras_add_bad_pages
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x24, x0
	bl	_amdgpu_ras_get_context
	mov	w23, #0
	cbz	x0, LBB0_18
; %bb.1:
	subs	w25, w20, #1
	b.lt	LBB0_18
; %bb.2:
	cbz	x21, LBB0_18
; %bb.3:
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_18
; %bb.4:
	mov	x0, x19
	bl	_mutex_lock
	ldr	x22, [x19, #8]
	cbz	x22, LBB0_16
; %bb.5:
	ldr	w8, [x22]
	cmp	w8, w20
	b.gt	LBB0_8
; %bb.6:
	mov	x0, x24
	mov	x1, x22
	mov	x2, x20
	bl	_amdgpu_ras_realloc_eh_data_space
	cbz	x0, LBB0_8
; %bb.7:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_17
LBB0_8:
	ldr	x8, [x22, #8]
	ldrsw	x10, [x22, #4]
	mov	w9, w20
	cmp	w25, #7
	b.lo	LBB0_13
; %bb.9:
	add	x13, x8, x10, lsl #3
	add	x11, x10, x25
	mvn	x12, x25
	add	x12, x12, x9
	add	x12, x21, x12, lsl #3
	add	x14, x21, x9, lsl #3
	add	x11, x8, x11, lsl #3
	add	x11, x11, #8
	cmp	x13, x14
	ccmp	x12, x11, #2, lo
	b.lo	LBB0_13
; %bb.10:
	add	x11, x25, #1
	and	x12, x11, #0x1fffffff8
	sub	x9, x9, x12
	add	x10, x12, x10
	add	x13, x13, #32
	sub	x14, x14, #32
	mov	x15, x12
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldp	q1, q0, [x14]
	ext.16b	v0, v0, v0, #8
	ext.16b	v1, v1, v1, #8
	ldp	q3, q2, [x14, #-32]
	ext.16b	v2, v2, v2, #8
	ext.16b	v3, v3, v3, #8
	stp	q0, q1, [x13, #-32]
	stp	q2, q3, [x13], #64
	sub	x14, x14, #64
	sub	x15, x15, #8
	cbnz	x15, LBB0_11
; %bb.12:
	cmp	x11, x12
	b.eq	LBB0_15
LBB0_13:
	sub	x11, x21, #8
	mov	x12, x10
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x11, x9, lsl #3]
	add	x10, x12, #1
	str	x13, [x8, x12, lsl #3]
	mov	x12, x10
	sub	x13, x9, #1
	mov	x9, x13
	cbnz	w13, LBB0_14
LBB0_15:
	mov	w23, #0
	ldr	w8, [x22]
	sub	w8, w8, w20
	stp	w8, w10, [x22]
	b	LBB0_17
LBB0_16:
	mov	w23, #0
LBB0_17:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_18:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
