	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vulkan_buffer_chain_alloc      ## -- Begin function vulkan_buffer_chain_alloc
	.p2align	4, 0x90
_vulkan_buffer_chain_alloc:             ## @vulkan_buffer_chain_alloc
	.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	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r13
	cmpq	$0, 32(%rsi)
	jne	LBB0_3
## %bb.1:
	movq	(%rbx), %rsi
	movl	16(%rbx), %edx
	movq	%r13, %rdi
	callq	_vulkan_buffer_chain_alloc_node
	movq	%rax, 32(%rbx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.2:
	movq	%rax, 8(%rbx)
	movq	$0, 24(%rbx)
LBB0_3:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_vulkan_buffer_chain_suballoc
	movl	$1, %r12d
	testq	%rax, %rax
	jne	LBB0_6
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_vulkan_buffer_chain_step
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_vulkan_buffer_chain_suballoc
	testq	%rax, %rax
	je	LBB0_4
	jmp	LBB0_6
LBB0_7:
	movq	(%rbx), %rax
	cmpq	%r15, %rax
	cmovaq	%rax, %r15
	movl	16(%rbx), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_vulkan_buffer_chain_alloc_node
	movq	8(%rbx), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%rbx, %rdi
	callq	_vulkan_buffer_chain_step
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_vulkan_buffer_chain_suballoc
	movq	%rax, %rdi
	callq	_retro_assert
	jmp	LBB0_6
LBB0_10:
	xorl	%r12d, %r12d
LBB0_6:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vulkan_buffer_chain_alloc      ; -- Begin function vulkan_buffer_chain_alloc
	.p2align	2
_vulkan_buffer_chain_alloc:             ; @vulkan_buffer_chain_alloc
	.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, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x1, #32]
	cbnz	x8, LBB0_5
; %bb.1:
	ldr	x1, [x20]
	ldr	w2, [x20, #16]
	mov	x0, x21
	bl	_vulkan_buffer_chain_alloc_node
	str	x0, [x20, #32]
	cbz	x0, LBB0_7
; %bb.2:
	str	x0, [x20, #8]
	str	xzr, [x20, #24]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_vulkan_buffer_chain_step
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	bl	_vulkan_buffer_chain_suballoc
	cbz	x0, LBB0_3
LBB0_6:
	mov	w0, #1
LBB0_7:
	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
LBB0_8:
	ldr	x8, [x20]
	cmp	x8, x22
	csel	x22, x8, x22, hi
	ldr	w2, [x20, #16]
	mov	x0, x21
	mov	x1, x22
	bl	_vulkan_buffer_chain_alloc_node
	ldr	x8, [x20, #8]
	str	x0, [x8]
	cbz	x0, LBB0_7
; %bb.9:
	mov	x0, x20
	bl	_vulkan_buffer_chain_step
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	bl	_vulkan_buffer_chain_suballoc
	bl	_retro_assert
	b	LBB0_6
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
