	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_otx2_mbox_alloc_msg_rsp        ## -- Begin function otx2_mbox_alloc_msg_rsp
	.p2align	4, 0x90
_otx2_mbox_alloc_msg_rsp:               ## @otx2_mbox_alloc_msg_rsp
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	%edx, %ebx
	movq	%rdi, %r12
	movq	24(%rdi), %r13
	movslq	%esi, %rax
	leaq	(%rax,%rax,4), %r14
	leaq	16(,%r14,8), %rdi
	addq	%r13, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movq	_MBOX_MSG_ALIGN@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	%ebx, %edi
	callq	_ALIGN
	movl	%eax, %ebx
	movl	(%r15), %esi
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	callq	_ALIGN
	movq	(%r13,%r14,8), %r15
	movslq	%ebx, %rbx
	leaq	(%r15,%rbx), %rdx
	movq	(%r12), %rsi
	movq	_msgs_offset@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rcx
	subq	%rcx, %rsi
	cmpq	%rsi, %rdx
	jg	LBB0_1
## %bb.2:
	movslq	%eax, %rsi
	movq	8(%r13,%r14,8), %rax
	addq	%rsi, %rax
	movq	8(%r12), %rdx
	subq	%rcx, %rdx
	cmpq	%rdx, %rax
	jle	LBB0_3
LBB0_1:
	xorl	%r12d, %r12d
	jmp	LBB0_7
LBB0_3:
	leaq	(,%r14,8), %rcx
	addq	%r13, %rcx
	testq	%r15, %r15
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_5
## %bb.4:
	movq	32(%rcx), %rax
	incq	%rax
	jmp	LBB0_6
LBB0_5:
	movq	$0, 32(%rcx)
	movl	$1, %eax
LBB0_6:
	movq	%rax, 32(%rcx)
	movslq	16(%r12), %rax
	shlq	$4, %rax
	addq	24(%r13,%r14,8), %rax
	movq	(%rdi), %r14
	shlq	$4, %r14
	addq	%rax, %r14
	shlq	$4, %r15
	leaq	(%r14,%r15), %r12
	leal	16(%rbx), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%rcx, %r13
	callq	_memset
	movq	_OTX2_MBOX_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15,%r14)
	addq	(%r13), %rbx
	movq	%rbx, (%r13)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	%rax, 8(%r13)
	movq	_msgs_offset@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movq	%rbx, (%r15,%r14)
LBB0_7:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBOX_MSG_ALIGN,4,2             ## @MBOX_MSG_ALIGN
	.comm	_msgs_offset,8,3                ## @msgs_offset
	.comm	_OTX2_MBOX_VERSION,4,2          ## @OTX2_MBOX_VERSION
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_otx2_mbox_alloc_msg_rsp        ; -- Begin function otx2_mbox_alloc_msg_rsp
	.p2align	2
_otx2_mbox_alloc_msg_rsp:               ; @otx2_mbox_alloc_msg_rsp
	.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	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x25, [x0, #24]
	mov	w8, #40
	smaddl	x24, w1, w8, x25
	add	x19, x24, #16
	mov	x0, x19
	bl	_spin_lock
Lloh0:
	adrp	x26, _MBOX_MSG_ALIGN@GOTPAGE
Lloh1:
	ldr	x26, [x26, _MBOX_MSG_ALIGN@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x23
	bl	_ALIGN
	mov	x23, x0
	ldr	w1, [x26]
	mov	x0, x22
	bl	_ALIGN
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x8, [x24]
	sxtw	x23, w23
	add	x9, x8, x23
	ldr	x11, [x20]
Lloh2:
	adrp	x22, _msgs_offset@GOTPAGE
Lloh3:
	ldr	x22, [x22, _msgs_offset@GOTPAGEOFF]
	ldr	x10, [x22]
	sub	x11, x11, x10
	cmp	x9, x11
	b.gt	LBB0_2
; %bb.1:
	sxtw	x9, w21
	mov	w11, #40
	madd	x21, x9, x11, x25
	ldr	x11, [x21, #8]!
	sxtw	x26, w0
	add	x11, x11, x26
	ldr	x12, [x20, #8]
	sub	x10, x12, x10
	cmp	x11, x10
	b.le	LBB0_3
LBB0_2:
	mov	x20, #0
	b	LBB0_7
LBB0_3:
	mov	w10, #40
	madd	x10, x9, x10, x25
	add	x10, x10, #32
	cbz	x8, LBB0_5
; %bb.4:
	ldr	x11, [x10]
	add	x11, x11, #1
	b	LBB0_6
LBB0_5:
	str	xzr, [x10]
	mov	w11, #1
LBB0_6:
	str	x11, [x10]
	mov	w10, #40
	madd	x9, x9, x10, x25
	ldr	x9, [x9, #24]
	ldrsw	x10, [x20, #16]
	add	x9, x9, x10, lsl #4
	ldr	x10, [x22]
	add	x9, x9, x10, lsl #4
	add	x20, x9, x8, lsl #4
	add	w2, w23, #16
	mov	x0, x20
	mov	w1, #0
	bl	_memset
Lloh4:
	adrp	x8, _OTX2_MBOX_VERSION@GOTPAGE
Lloh5:
	ldr	x8, [x8, _OTX2_MBOX_VERSION@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	ldr	x8, [x24]
	add	x8, x8, x23
	str	x8, [x24]
	ldr	x9, [x21]
	add	x9, x9, x26
	str	x9, [x21]
	ldr	x9, [x22]
	add	x8, x9, x8
	str	x8, [x20]
LBB0_7:
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x20
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_MBOX_MSG_ALIGN,4,2             ; @MBOX_MSG_ALIGN
	.comm	_msgs_offset,8,3                ; @msgs_offset
	.comm	_OTX2_MBOX_VERSION,4,2          ; @OTX2_MBOX_VERSION
.subsections_via_symbols
