	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocxl_sysfs_register_afu        ## -- Begin function ocxl_sysfs_register_afu
	.p2align	4, 0x90
_ocxl_sysfs_register_afu:               ## @ocxl_sysfs_register_afu
	.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
	movq	%rdi, %r13
	movq	_afu_attrs@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	xorl	%ebx, %ebx
	movl	$0, %r14d
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rsi
	addq	%rbx, %rsi
	movq	%r13, %rdi
	callq	_device_create_file
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %rbx
	cmpq	%rax, %r14
	jl	LBB0_2
## %bb.4:
	xorl	%ebx, %ebx
LBB0_5:
	leaq	8(%r13), %r15
	leaq	24(%r13), %rdi
	callq	_sysfs_attr_init
	leaq	L_.str(%rip), %rax
	movq	%rax, 24(%r13)
	movl	$384, 32(%r13)                  ## imm = 0x180
	movq	40(%r13), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r13)
	movq	_global_mmio_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r13)
	movq	_global_mmio_mmap@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r13)
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_device_create_bin_file
	testl	%eax, %eax
	je	LBB0_12
## %bb.6:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_dev_err
	movl	%r15d, %ebx
	testl	%r14d, %r14d
	jg	LBB0_9
	jmp	LBB0_12
LBB0_7:
	movl	%eax, %ebx
	testl	%r14d, %r14d
	jle	LBB0_12
LBB0_9:
	movl	%ebx, %r15d
	movl	%r14d, %r14d
	leaq	-4(,%r14,4), %rbx
	incq	%r14
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rsi
	addq	%rbx, %rsi
	movq	%r13, %rdi
	callq	_device_remove_file
	decq	%r14
	addq	$-4, %rbx
	cmpq	$1, %r14
	ja	LBB0_10
## %bb.11:
	movl	%r15d, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_afu_attrs,8,3                  ## @afu_attrs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"global_mmio_area"

	.comm	_global_mmio_read,4,2           ## @global_mmio_read
	.comm	_global_mmio_mmap,4,2           ## @global_mmio_mmap
L_.str.1:                               ## @.str.1
	.asciz	"Unable to create global mmio attr for afu: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocxl_sysfs_register_afu        ; -- Begin function ocxl_sysfs_register_afu
	.p2align	2
_ocxl_sysfs_register_afu:               ; @ocxl_sysfs_register_afu
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x21, _afu_attrs@GOTPAGE
Lloh1:
	ldr	x21, [x21, _afu_attrs@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x23, #0
	mov	x22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	add	x1, x8, x23
	mov	x0, x19
	bl	_device_create_file
	cbnz	w0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x22, x22, #1
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	add	x23, x23, #4
	cmp	x22, w0, sxtw
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w22, #0
LBB0_5:
	add	x0, x19, #24
	bl	_sysfs_attr_init
Lloh2:
	adrp	x8, l_.str@PAGE
Lloh3:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x19, #24]
	mov	w8, #384
	str	w8, [x19, #32]
	ldr	x8, [x19, #40]
	ldr	w8, [x8]
Lloh4:
	adrp	x9, _global_mmio_read@GOTPAGE
Lloh5:
	ldr	x9, [x9, _global_mmio_read@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #12]
Lloh7:
	adrp	x8, _global_mmio_mmap@GOTPAGE
Lloh8:
	ldr	x8, [x8, _global_mmio_mmap@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	mov	x1, x19
	str	w8, [x1, #8]!
	mov	x0, x19
	bl	_device_create_bin_file
	mov	x20, x0
	cbz	w0, LBB0_10
; %bb.6:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
	cmp	w22, #1
	b.ge	LBB0_8
	b	LBB0_10
LBB0_7:
	mov	x20, x0
	cmp	w22, #1
	b.lt	LBB0_10
LBB0_8:
	mov	w8, w22
	add	x22, x8, #1
	lsl	x8, x8, #2
	sub	x23, x8, #4
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	add	x1, x8, x23
	mov	x0, x19
	bl	_device_remove_file
	sub	x22, x22, #1
	sub	x23, x23, #4
	cmp	x22, #1
	b.hi	LBB0_9
LBB0_10:
	mov	x0, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_afu_attrs,8,3                  ; @afu_attrs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"global_mmio_area"

	.comm	_global_mmio_read,4,2           ; @global_mmio_read
	.comm	_global_mmio_mmap,4,2           ; @global_mmio_mmap
l_.str.1:                               ; @.str.1
	.asciz	"Unable to create global mmio attr for afu: %d\n"

.subsections_via_symbols
