	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gem_record_fences
_gem_record_fences:                     ## @gem_record_fences
	.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	%rdi, %r14
	movq	16(%rdi), %r12
	leaq	4(%r12), %r15
	movq	%r12, %rdi
	callq	_INTEL_GEN
	cmpl	$6, %eax
	jl	LBB0_5
## %bb.1:
	cmpl	$0, (%r12)
	jle	LBB0_2
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_FENCE_REG_GEN6_LO
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_intel_uncore_read64
	movq	8(%r14), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
	jmp	LBB0_10
LBB0_5:
	movq	%r12, %rdi
	callq	_INTEL_GEN
	movl	(%r12), %ecx
	xorl	%ebx, %ebx
	cmpl	$3, %eax
	jle	LBB0_6
## %bb.8:
	testl	%ecx, %ecx
	jle	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_FENCE_REG_965_LO
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_intel_uncore_read64
	movq	8(%r14), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_9
	jmp	LBB0_10
LBB0_6:
	testl	%ecx, %ecx
	jle	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_FENCE_REG
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_intel_uncore_read
	movq	8(%r14), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_7
	jmp	LBB0_10
LBB0_2:
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, (%r14)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_gem_record_fences
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gem_record_fences
_gem_record_fences:                     ; @gem_record_fences
	.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	x19, x0
	ldr	x20, [x0, #16]
	add	x21, x20, #4
	mov	x0, x20
	bl	_INTEL_GEN
	cmp	w0, #6
	b.lt	LBB0_4
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.2:
	mov	x22, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_FENCE_REG_GEN6_LO
	mov	x1, x0
	mov	x0, x21
	bl	_intel_uncore_read64
	ldr	x8, [x19, #8]
	str	x0, [x8, x22, lsl #3]
	add	x22, x22, #1
	ldrsw	x8, [x20]
	cmp	x22, x8
	b.lt	LBB0_3
	b	LBB0_13
LBB0_4:
	mov	x0, x20
	bl	_INTEL_GEN
	ldr	w8, [x20]
	cmp	w0, #3
	b.le	LBB0_8
; %bb.5:
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.6:
	mov	x22, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_FENCE_REG_965_LO
	mov	x1, x0
	mov	x0, x21
	bl	_intel_uncore_read64
	ldr	x8, [x19, #8]
	str	x0, [x8, x22, lsl #3]
	add	x22, x22, #1
	ldrsw	x8, [x20]
	cmp	x22, x8
	b.lt	LBB0_7
	b	LBB0_11
LBB0_8:
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	mov	x22, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_FENCE_REG
	mov	x1, x0
	mov	x0, x21
	bl	_intel_uncore_read
	ldr	x8, [x19, #8]
	str	x0, [x8, x22, lsl #3]
	add	x22, x22, #1
	ldrsw	x8, [x20]
	cmp	x22, x8
	b.lt	LBB0_10
LBB0_11:
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_13
LBB0_12:
	mov	w22, #0
LBB0_13:
	str	w22, [x19]
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_gem_record_fences
.subsections_via_symbols
