	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcom_task_alloc                ## -- Begin function bcom_task_alloc
	.p2align	4, 0x90
_bcom_task_alloc:                       ## @bcom_task_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
	movl	%edi, %r15d
	movq	_bcom_eng@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.1:
	movl	%edx, %r13d
	movl	%esi, %r12d
	addq	$12, %rdi
	callq	_spin_lock
	movq	_BCOM_MAX_TASKS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r14), %rdi
	testl	%eax, %eax
	jle	LBB0_5
## %bb.2:
	movq	(%rdi), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%rcx,%rbx,4)
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_3
LBB0_5:
	addq	$12, %rdi
	callq	_spin_unlock
	jmp	LBB0_18
LBB0_6:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	$-1, (%rcx,%rbx,4)
	addq	$12, %rdi
	callq	_spin_unlock
	leal	56(%r13), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_17
## %bb.7:
	movq	%rax, %r12
	movl	%ebx, (%rax)
	testl	%r13d, %r13d
	je	LBB0_9
## %bb.8:
	leaq	56(%r12), %rax
	movq	%rax, 48(%r12)
LBB0_9:
	movq	(%r14), %rax
	movl	8(%rax), %edi
	movl	%ebx, %esi
	callq	_irq_of_parse_and_map
	movq	%rax, 32(%r12)
	testq	%rax, %rax
	je	LBB0_16
## %bb.10:
	testl	%r15d, %r15d
	je	LBB0_19
## %bb.11:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	movl	$8, %esi
	callq	_kmalloc_array
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	imull	%r15d, %r13d
	movq	%r12, %rdx
	addq	$40, %rdx
	movl	%r13d, %edi
	movl	$4, %esi
	callq	_bcom_sram_alloc
	movl	%eax, 24(%r12)
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	%r13d, %edx
	callq	_memset
	movl	%r15d, 4(%r12)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r12)
	jmp	LBB0_19
LBB0_14:
	movq	32(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.15:
	callq	_irq_dispose_mapping
LBB0_16:
	movl	24(%r12), %edi
	callq	_bcom_sram_free
	movq	16(%r12), %rdi
	callq	_kfree
	movq	%r12, %rdi
	callq	_kfree
LBB0_17:
	movq	(%r14), %rax
	movq	(%rax), %rax
	movl	$0, (%rax,%rbx,4)
LBB0_18:
	xorl	%r12d, %r12d
LBB0_19:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bcom_eng,8,3                   ## @bcom_eng
	.comm	_BCOM_MAX_TASKS,4,2             ## @BCOM_MAX_TASKS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcom_task_alloc                ; -- Begin function bcom_task_alloc
	.p2align	2
_bcom_task_alloc:                       ; @bcom_task_alloc
	.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
Lloh0:
	adrp	x24, _bcom_eng@GOTPAGE
Lloh1:
	ldr	x24, [x24, _bcom_eng@GOTPAGEOFF]
	ldr	x8, [x24]
	cbz	x8, LBB0_6
; %bb.1:
	mov	x23, x2
	mov	x19, x1
	mov	x21, x0
	add	x0, x8, #12
	bl	_spin_lock
Lloh2:
	adrp	x8, _BCOM_MAX_TASKS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BCOM_MAX_TASKS@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
	ldr	x8, [x24]
	cmp	w9, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x20, #0
	ldr	x10, [x8]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10, x20, lsl #2]
	cbz	w11, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x20, x20, #1
	cmp	x9, x20
	b.ne	LBB0_3
LBB0_5:
	add	x0, x8, #12
	bl	_spin_unlock
LBB0_6:
	mov	x22, #0
LBB0_7:
	mov	x0, x22
	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
LBB0_8:
	mov	w9, #-1
	str	w9, [x10, x20, lsl #2]
	add	x0, x8, #12
	bl	_spin_unlock
	add	w0, w23, #56
Lloh5:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x25]
	bl	_kzalloc
	cbz	x0, LBB0_19
; %bb.9:
	mov	x22, x0
	str	w20, [x0]
	cbz	w23, LBB0_11
; %bb.10:
	add	x8, x22, #56
	str	x8, [x22, #48]
LBB0_11:
	ldr	x8, [x24]
	ldr	w0, [x8, #8]
	mov	x1, x20
	bl	_irq_of_parse_and_map
	str	x0, [x22, #32]
	cbz	x0, LBB0_18
; %bb.12:
	cbz	w21, LBB0_7
; %bb.13:
	ldr	w2, [x25]
	mov	x0, x21
	mov	w1, #8
	bl	_kmalloc_array
	str	x0, [x22, #16]
	cbz	x0, LBB0_16
; %bb.14:
	mul	w23, w19, w21
	add	x2, x22, #40
	mov	x0, x23
	mov	w1, #4
	bl	_bcom_sram_alloc
	str	w0, [x22, #24]
	cbz	w0, LBB0_16
; %bb.15:
	mov	w1, #0
	mov	x2, x23
	bl	_memset
	stp	w21, w19, [x22, #4]
	b	LBB0_7
LBB0_16:
	ldr	x0, [x22, #32]
	cbz	x0, LBB0_18
; %bb.17:
	bl	_irq_dispose_mapping
LBB0_18:
	ldr	w0, [x22, #24]
	bl	_bcom_sram_free
	ldr	x0, [x22, #16]
	bl	_kfree
	mov	x0, x22
	bl	_kfree
LBB0_19:
	mov	x22, #0
	ldr	x8, [x24]
	ldr	x8, [x8]
	str	wzr, [x8, x20, lsl #2]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_bcom_eng,8,3                   ; @bcom_eng
	.comm	_BCOM_MAX_TASKS,4,2             ; @BCOM_MAX_TASKS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
.subsections_via_symbols
