	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amb_close
_amb_close:                             ## @amb_close
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movl	32(%rdi), %edi
	callq	_AMB_DEV
	movq	%rax, %r15
	movq	%r13, %rdi
	callq	_AMB_VCC
	movq	%rax, %rbx
	movq	(%r13), %r12
	movq	_DBG_VCC@GOTPCREL(%rip), %rax
	movq	_DBG_FLOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_PRINTD
	movq	_ATM_VF_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%r13), %rsi
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
	callq	_clear_bit
	movq	24(%r13), %rax
	movq	_ATM_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.1:
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	16(%r15), %rax
	cmpq	$0, (%rax,%r12,8)
	je	LBB0_3
## %bb.2:
	movq	_SRB_MODIFY_VC_RATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_cpu_to_be32
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_cpu_to_be32
	movq	%rax, -64(%rbp)
	xorl	%edi, %edi
	callq	_cpu_to_be32
	movq	%rax, -72(%rbp)
	jmp	LBB0_4
LBB0_3:
	movq	_SRB_CLOSE_VC@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_cpu_to_be32
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_cpu_to_be32
	movq	%rax, -96(%rbp)
LBB0_4:
	movq	%r14, -56(%rbp)
	movq	24(%r15), %rax
	movq	%r12, %rcx
	shlq	$4, %rcx
	movq	$0, 8(%rax,%rcx)
	leaq	-96(%rbp), %rsi
	movq	%r15, %rdi
	callq	_command_do
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	leaq	-96(%rbp), %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_schedule
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_command_do
	testq	%rax, %rax
	jne	LBB0_6
LBB0_7:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_ATM_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_8:
	cmpq	%rax, 16(%r13)
	je	LBB0_20
## %bb.9:
	movzbl	(%rbx), %r14d
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	24(%r15), %rax
	movq	%r12, %rbx
	shlq	$4, %rbx
	cmpq	$0, 8(%rax,%rbx)
	je	LBB0_11
## %bb.10:
	movq	_SRB_MODIFY_VC_FLAGS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_cpu_to_be32
	movq	%rax, -56(%rbp)
	movq	%r12, %rdi
	callq	_cpu_to_be32
	movq	%rax, -80(%rbp)
	movq	24(%r15), %rax
	movq	(%rax,%rbx), %rdi
	movq	_SRB_FLAGS_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %rdi
	callq	_cpu_to_be32
	movq	%rax, -88(%rbp)
	jmp	LBB0_12
LBB0_11:
	movq	_SRB_CLOSE_VC@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_cpu_to_be32
	movq	%rax, -56(%rbp)
	movq	%r12, %rdi
	callq	_cpu_to_be32
	movq	%rax, -96(%rbp)
LBB0_12:
	movq	16(%r15), %rax
	movq	(%rax,%r12,8), %r8
	cmpq	%r13, %r8
	je	LBB0_14
## %bb.13:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	leaq	L_.str.2(%rip), %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_PRINTK
	movq	16(%r15), %rax
LBB0_14:
	movq	$0, (%rax,%r12,8)
	leaq	-96(%rbp), %rsi
	movq	%r15, %rdi
	callq	_command_do
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	leaq	-96(%rbp), %rbx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_schedule
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_command_do
	testq	%rax, %rax
	jne	LBB0_16
LBB0_17:
	movq	8(%r15), %rax
	movq	(%rax,%r14,8), %rcx
	decq	%rcx
	movq	%rcx, (%rax,%r14,8)
	movq	_rx_lats@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_19
## %bb.18:
	movq	$0, (%rax,%r14,8)
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_drain_rx_pool
LBB0_19:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_20:
	movq	%rbx, %rdi
	callq	_kfree
	movq	_ATM_VF_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	callq	_clear_bit
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DBG_VCC,4,2                    ## @DBG_VCC
	.comm	_DBG_FLOW,4,2                   ## @DBG_FLOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"amb_close"

	.comm	_ATM_VF_READY,4,2               ## @ATM_VF_READY
	.comm	_ATM_NONE,8,3                   ## @ATM_NONE
	.comm	_SRB_MODIFY_VC_RATE,8,3         ## @SRB_MODIFY_VC_RATE
	.comm	_SRB_CLOSE_VC,8,3               ## @SRB_CLOSE_VC
	.comm	_SRB_MODIFY_VC_FLAGS,8,3        ## @SRB_MODIFY_VC_FLAGS
	.comm	_SRB_FLAGS_SHIFT,8,3            ## @SRB_FLAGS_SHIFT
	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
L_.str.1:                               ## @.str.1
	.asciz	"%s vcc=%p rxer[vci]=%p"

L_.str.2:                               ## @.str.2
	.asciz	"arghhh! we're going to die!"

	.comm	_rx_lats,8,3                    ## @rx_lats
	.comm	_ATM_VF_ADDR,4,2                ## @ATM_VF_ADDR
	.no_dead_strip	_amb_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amb_close
_amb_close:                             ; @amb_close
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x23, x0
	ldr	w0, [x0, #32]
	bl	_AMB_DEV
	mov	x19, x0
	mov	x0, x23
	bl	_AMB_VCC
	mov	x20, x0
Lloh0:
	adrp	x8, _DBG_VCC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DBG_VCC@GOTPAGEOFF]
	ldr	x22, [x23]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _DBG_FLOW@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DBG_FLOW@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PRINTD
Lloh8:
	adrp	x8, _ATM_VF_READY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ATM_VF_READY@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	add	x21, x23, #8
	mov	x1, x21
	bl	_clear_bit
	ldr	x8, [x23, #24]
Lloh11:
	adrp	x25, _ATM_NONE@GOTPAGE
Lloh12:
	ldr	x25, [x25, _ATM_NONE@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.1:
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x22, lsl #3]
	cbz	x8, LBB0_3
; %bb.2:
Lloh13:
	adrp	x8, _SRB_MODIFY_VC_RATE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SRB_MODIFY_VC_RATE@GOTPAGEOFF]
Lloh15:
	ldr	x0, [x8]
	bl	_cpu_to_be32
	mov	x24, x0
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [sp, #32]
	mov	x0, #0
	bl	_cpu_to_be32
	str	x0, [sp, #24]
	b	LBB0_4
LBB0_3:
Lloh16:
	adrp	x8, _SRB_CLOSE_VC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SRB_CLOSE_VC@GOTPAGEOFF]
Lloh18:
	ldr	x0, [x8]
	bl	_cpu_to_be32
	mov	x24, x0
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [sp]
LBB0_4:
	str	x24, [sp, #40]
	ldr	x8, [x19, #24]
	add	x8, x8, x22, lsl #4
	str	xzr, [x8, #8]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x1, sp
	mov	x0, x19
	bl	_command_do
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_schedule
	b	LBB0_5
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	ldr	x8, [x25]
LBB0_8:
	ldr	x9, [x23, #16]
	cmp	x9, x8
	b.eq	LBB0_20
; %bb.9:
	ldrb	w24, [x20]
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x19, #24]
	add	x8, x8, x22, lsl #4
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_11
; %bb.10:
Lloh19:
	adrp	x8, _SRB_MODIFY_VC_FLAGS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SRB_MODIFY_VC_FLAGS@GOTPAGEOFF]
Lloh21:
	ldr	x0, [x8]
	bl	_cpu_to_be32
	str	x0, [sp, #40]
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [sp, #16]
	ldr	x8, [x19, #24]
	lsl	x9, x22, #4
	ldr	x8, [x8, x9]
Lloh22:
	adrp	x9, _SRB_FLAGS_SHIFT@GOTPAGE
Lloh23:
	ldr	x9, [x9, _SRB_FLAGS_SHIFT@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	lsl	x0, x8, x9
	bl	_cpu_to_be32
	str	x0, [sp, #8]
	b	LBB0_12
LBB0_11:
Lloh25:
	adrp	x8, _SRB_CLOSE_VC@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SRB_CLOSE_VC@GOTPAGEOFF]
Lloh27:
	ldr	x0, [x8]
	bl	_cpu_to_be32
	str	x0, [sp, #40]
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [sp]
LBB0_12:
	ldr	x8, [x19, #16]
	ldr	x4, [x8, x22, lsl #3]
	cmp	x4, x23
	b.eq	LBB0_14
; %bb.13:
Lloh28:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
Lloh33:
	adrp	x2, l_.str.2@PAGE
Lloh34:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x3, x20
	bl	_PRINTK
	ldr	x8, [x19, #16]
LBB0_14:
	str	xzr, [x8, x22, lsl #3]
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x1, sp
	mov	x0, x19
	bl	_command_do
	cbz	x0, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	bl	_schedule
	b	LBB0_15
LBB0_17:
	ldr	x8, [x19, #8]
	lsl	x9, x24, #3
	ldr	x10, [x8, x9]
	sub	x10, x10, #1
	str	x10, [x8, x9]
Lloh35:
	adrp	x9, _rx_lats@GOTPAGE
Lloh36:
	ldr	x9, [x9, _rx_lats@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x10, x9
	b.ne	LBB0_19
; %bb.18:
	str	xzr, [x8, x24, lsl #3]
	mov	x0, x19
	mov	x1, x24
	bl	_drain_rx_pool
LBB0_19:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_20:
	mov	x0, x20
	bl	_kfree
Lloh38:
	adrp	x8, _ATM_VF_ADDR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ATM_VF_ADDR@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_clear_bit
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_DBG_VCC,4,2                    ; @DBG_VCC
	.comm	_DBG_FLOW,4,2                   ; @DBG_FLOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"amb_close"

	.comm	_ATM_VF_READY,4,2               ; @ATM_VF_READY
	.comm	_ATM_NONE,8,3                   ; @ATM_NONE
	.comm	_SRB_MODIFY_VC_RATE,8,3         ; @SRB_MODIFY_VC_RATE
	.comm	_SRB_CLOSE_VC,8,3               ; @SRB_CLOSE_VC
	.comm	_SRB_MODIFY_VC_FLAGS,8,3        ; @SRB_MODIFY_VC_FLAGS
	.comm	_SRB_FLAGS_SHIFT,8,3            ; @SRB_FLAGS_SHIFT
	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
l_.str.1:                               ; @.str.1
	.asciz	"%s vcc=%p rxer[vci]=%p"

l_.str.2:                               ; @.str.2
	.asciz	"arghhh! we're going to die!"

	.comm	_rx_lats,8,3                    ; @rx_lats
	.comm	_ATM_VF_ADDR,4,2                ; @ATM_VF_ADDR
	.no_dead_strip	_amb_close
.subsections_via_symbols
