	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_octeon_allocate_device         ## -- Begin function octeon_allocate_device
	.p2align	4, 0x90
_octeon_allocate_device:                ## @octeon_allocate_device
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	_octeon_devices_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock
	movq	_MAX_OCTEON_DEVICES@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	_octeon_device@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx,%rbx,8)
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_2
	jmp	LBB0_5
LBB0_4:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_octeon_allocate_device_mem
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r14
	movq	_octeon_device_count@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	(%r12), %rax
	movq	%r14, (%rax,%rbx,8)
	movq	_octeon_devices_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock
	leaq	16(%r14), %rdi
	callq	_spin_lock_init
	movq	%r14, %rdi
	addq	$12, %rdi
	callq	_spin_lock_init
	movq	%rbx, (%r14)
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rdx
	movl	$4, %esi
	movq	%rbx, %rcx
	callq	_snprintf
	jmp	LBB0_7
LBB0_5:
	movq	_octeon_devices_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock
	xorl	%r14d, %r14d
LBB0_7:
	movq	%r14, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_octeon_devices_lock,4,2        ## @octeon_devices_lock
	.comm	_MAX_OCTEON_DEVICES,8,3         ## @MAX_OCTEON_DEVICES
	.comm	_octeon_device,8,3              ## @octeon_device
	.comm	_octeon_device_count,4,2        ## @octeon_device_count
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LiquidIO%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_octeon_allocate_device         ; -- Begin function octeon_allocate_device
	.p2align	2
_octeon_allocate_device:                ; @octeon_allocate_device
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x0, _octeon_devices_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _octeon_devices_lock@GOTPAGEOFF]
	bl	_spin_lock
Lloh2:
	adrp	x8, _MAX_OCTEON_DEVICES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_OCTEON_DEVICES@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.1:
	mov	x19, #0
Lloh5:
	adrp	x22, _octeon_device@GOTPAGE
Lloh6:
	ldr	x22, [x22, _octeon_device@GOTPAGEOFF]
	ldr	x9, [x22]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, x19, lsl #3]
	cbz	x10, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x19, x19, #1
	cmp	x8, x19
	b.ne	LBB0_2
	b	LBB0_6
LBB0_4:
	mov	x0, x21
	mov	x1, x20
	bl	_octeon_allocate_device_mem
	cbz	x0, LBB0_6
; %bb.5:
	mov	x20, x0
Lloh7:
	adrp	x8, _octeon_device_count@GOTPAGE
Lloh8:
	ldr	x8, [x8, _octeon_device_count@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	ldr	x8, [x22]
	str	x0, [x8, x19, lsl #3]
Lloh9:
	adrp	x0, _octeon_devices_lock@GOTPAGE
Lloh10:
	ldr	x0, [x0, _octeon_devices_lock@GOTPAGEOFF]
	bl	_spin_unlock
	add	x0, x20, #16
	bl	_spin_lock_init
	add	x0, x20, #12
	bl	_spin_lock_init
	str	x19, [x20]
	ldr	w0, [x20, #8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #4
	mov	x3, x19
	bl	_snprintf
	b	LBB0_7
LBB0_6:
Lloh13:
	adrp	x0, _octeon_devices_lock@GOTPAGE
Lloh14:
	ldr	x0, [x0, _octeon_devices_lock@GOTPAGEOFF]
	bl	_spin_unlock
	mov	x20, #0
LBB0_7:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_octeon_devices_lock,4,2        ; @octeon_devices_lock
	.comm	_MAX_OCTEON_DEVICES,8,3         ; @MAX_OCTEON_DEVICES
	.comm	_octeon_device,8,3              ; @octeon_device
	.comm	_octeon_device_count,4,2        ; @octeon_device_count
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LiquidIO%d"

.subsections_via_symbols
