	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_rx_first
_open_rx_first:                         ## @open_rx_first
	.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
	movq	%rdi, %r14
	movl	$49235, %edi                    ## imm = 0xC053
	callq	_inb_p
	movzwl	%ax, %esi
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_DPRINTK
	movl	24(%r14), %edi
	callq	_ZATM_DEV
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_ZATM_VCC
	movq	%rax, %rbx
	movw	$0, (%rax)
	movq	8(%r14), %rax
	movq	_ATM_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.1:
	movq	(%r14), %rax
	movq	_ATM_AAL5@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.2:
	movl	16(%r14), %eax
	cmpl	$65465, %eax                    ## imm = 0xFFB9
	jl	LBB0_4
## %bb.3:
	movl	$65464, 16(%r14)                ## imm = 0xFFB8
	movl	$65464, %eax                    ## imm = 0xFFB8
LBB0_4:
	movslq	%eax, %rdi
	movq	_ATM_AAL5_TRAILER@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	movq	_ATM_CELL_PAYLOAD@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_DIV_ROUND_UP
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	imull	(%r12), %edi
	callq	_pool_index
	jmp	LBB0_6
LBB0_5:
	movq	_ZATM_AAL0_POOL@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_6:
	movw	%ax, 2(%rbx)
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	_uPD98401_OPEN_CHAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_CMR@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_zout
	movl	(%r13), %edi
	callq	_zin
	movl	%eax, %ebx
	movq	_CER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_zin
	movzwl	%ax, %edx
	movzwl	%bx, %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_DPRINTK
	movl	(%r13), %edi
	callq	_zin
	movq	_uPD98401_CHAN_ADDR@GOTPCREL(%rip), %rcx
	andw	(%rcx), %ax
	movzwl	%ax, %r13d
	movq	_uPD98401_CHAN_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %r13
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_DPRINTK
	testq	%r13, %r13
	je	LBB0_7
## %bb.8:
	movl	24(%r14), %edi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movzwl	2(%rbx), %esi
	callq	_use_pool
	movzwl	2(%rbx), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DPRINTK
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movzwl	2(%rbx), %esi
	movq	_uPD98401_RXVC_POOL_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	movq	_VC_SIZE@GOTPCREL(%rip), %rbx
	movzwl	(%rbx), %eax
	imull	%r13d, %eax
	shrl	$2, %eax
	movzwl	%ax, %edx
	movq	%r15, %rdi
	callq	_zpokel
	movq	_uPD98401_RXVC_OD@GOTPCREL(%rip), %rax
	movq	(%r14), %rdx
	movl	$0, %ecx
	movq	_ATM_AAL5@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_10
## %bb.9:
	movq	_uPD98401_RXVC_AR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_10:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	orl	(%rax), %esi
	orl	%ecx, %esi
	movzwl	(%rbx), %eax
	imull	%r13d, %eax
	shrl	$2, %eax
	incl	%eax
	movzwl	%ax, %edx
	movq	%r15, %rdi
	callq	_zpokel
	movzwl	(%rbx), %eax
	imull	%r13d, %eax
	shrl	$2, %eax
	addl	$2, %eax
	movzwl	%ax, %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_zpokel
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movw	%r13w, (%rax)
	movq	8(%r15), %rax
	movq	%r14, (%rax,%r13,8)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_11
LBB0_7:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_11:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open_rx_first (0x%x)\n"

	.comm	_ATM_NONE,8,3                   ## @ATM_NONE
	.comm	_ATM_AAL5,8,3                   ## @ATM_AAL5
	.comm	_ATM_AAL5_TRAILER,8,3           ## @ATM_AAL5_TRAILER
	.comm	_ATM_CELL_PAYLOAD,4,2           ## @ATM_CELL_PAYLOAD
	.comm	_ZATM_AAL0_POOL,2,1             ## @ZATM_AAL0_POOL
	.comm	_EMSGSIZE,4,2                   ## @EMSGSIZE
	.comm	_zwait,4,2                      ## @zwait
	.comm	_uPD98401_OPEN_CHAN,4,2         ## @uPD98401_OPEN_CHAN
	.comm	_CMR,4,2                        ## @CMR
L_.str.1:                               ## @.str.1
	.asciz	"0x%x 0x%x\n"

	.comm	_CER,4,2                        ## @CER
	.comm	_uPD98401_CHAN_ADDR,2,1         ## @uPD98401_CHAN_ADDR
	.comm	_uPD98401_CHAN_ADDR_SHIFT,2,1   ## @uPD98401_CHAN_ADDR_SHIFT
L_.str.2:                               ## @.str.2
	.asciz	"chan is %d\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.3:                               ## @.str.3
	.asciz	"pool %d\n"

	.comm	_uPD98401_RXVC_POOL_SHIFT,4,2   ## @uPD98401_RXVC_POOL_SHIFT
	.comm	_VC_SIZE,2,1                    ## @VC_SIZE
	.comm	_uPD98401_RXVC_OD,4,2           ## @uPD98401_RXVC_OD
	.comm	_uPD98401_RXVC_AR,4,2           ## @uPD98401_RXVC_AR
	.no_dead_strip	_open_rx_first
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_rx_first
_open_rx_first:                         ; @open_rx_first
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	mov	w0, #49235
	bl	_inb_p
	mov	x1, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINTK
	ldr	w0, [x19, #24]
	bl	_ZATM_DEV
	mov	x20, x0
	mov	x0, x19
	bl	_ZATM_VCC
	mov	x21, x0
	mov	w0, #0
	strh	wzr, [x21]
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _ATM_NONE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ATM_NONE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_9
; %bb.1:
	ldr	x8, [x19]
Lloh5:
	adrp	x24, _ATM_AAL5@GOTPAGE
Lloh6:
	ldr	x24, [x24, _ATM_AAL5@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	ldr	w8, [x19, #16]
	mov	w9, #65465
	cmp	w8, w9
	b.lt	LBB0_4
; %bb.3:
	mov	w8, #65464
	str	w8, [x19, #16]
LBB0_4:
Lloh7:
	adrp	x9, _ATM_AAL5_TRAILER@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ATM_AAL5_TRAILER@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	add	x0, x9, w8, sxtw
Lloh10:
	adrp	x23, _ATM_CELL_PAYLOAD@GOTPAGE
Lloh11:
	ldr	x23, [x23, _ATM_CELL_PAYLOAD@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_DIV_ROUND_UP
	mov	x22, x0
	ldr	w8, [x23]
	mul	w0, w8, w0
	bl	_pool_index
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x8, _ZATM_AAL0_POOL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ZATM_AAL0_POOL@GOTPAGEOFF]
	ldrh	w0, [x8]
	mov	w22, #1
LBB0_6:
	strh	w0, [x21, #2]
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh14:
	adrp	x8, _uPD98401_OPEN_CHAN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _uPD98401_OPEN_CHAN@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x25, _CMR@GOTPAGE
Lloh18:
	ldr	x25, [x25, _CMR@GOTPAGEOFF]
	ldr	w1, [x25]
	bl	_zout
	ldr	w0, [x25]
	bl	_zin
	mov	x23, x0
Lloh19:
	adrp	x8, _CER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CER@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_zin
	mov	w8, w0
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	bl	_DPRINTK
	ldr	w0, [x25]
	bl	_zin
Lloh24:
	adrp	x8, _uPD98401_CHAN_ADDR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _uPD98401_CHAN_ADDR@GOTPAGEOFF]
	ldrh	w8, [x8]
	and	w8, w8, w0
Lloh26:
	adrp	x9, _uPD98401_CHAN_ADDR_SHIFT@GOTPAGE
Lloh27:
	ldr	x9, [x9, _uPD98401_CHAN_ADDR_SHIFT@GOTPAGEOFF]
	ldrh	w9, [x9]
	lsr	x23, x8, x9
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x23
	bl	_DPRINTK
	cbz	w23, LBB0_8
; %bb.7:
	ldr	w0, [x19, #24]
	ldrh	w1, [x21, #2]
	bl	_use_pool
	ldrh	w1, [x21, #2]
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DPRINTK
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldrh	w8, [x21, #2]
Lloh32:
	adrp	x9, _uPD98401_RXVC_POOL_SHIFT@GOTPAGE
Lloh33:
	ldr	x9, [x9, _uPD98401_RXVC_POOL_SHIFT@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	lsl	w1, w8, w9
Lloh35:
	adrp	x25, _VC_SIZE@GOTPAGE
Lloh36:
	ldr	x25, [x25, _VC_SIZE@GOTPAGEOFF]
	ldrh	w8, [x25]
	mul	w8, w23, w8
	ubfx	w2, w8, #2, #16
	mov	x0, x20
	bl	_zpokel
Lloh37:
	adrp	x8, _uPD98401_RXVC_OD@GOTPAGE
Lloh38:
	ldr	x8, [x8, _uPD98401_RXVC_OD@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	ldr	x9, [x19]
	ldr	x10, [x24]
Lloh40:
	adrp	x11, _uPD98401_RXVC_AR@GOTPAGE
Lloh41:
	ldr	x11, [x11, _uPD98401_RXVC_AR@GOTPAGEOFF]
Lloh42:
	ldr	w11, [x11]
	cmp	x9, x10
	csel	w9, w11, wzr, eq
	orr	w8, w8, w22
	orr	w1, w8, w9
	ldrh	w8, [x25]
	mul	w8, w23, w8
	lsr	w8, w8, #2
	add	w8, w8, #1
	and	w2, w8, #0xffff
	mov	x0, x20
	bl	_zpokel
	ldrh	w8, [x25]
	mul	w8, w23, w8
	lsr	w8, w8, #2
	add	w8, w8, #2
	and	w2, w8, #0xffff
	mov	x0, x20
	mov	w1, #0
	bl	_zpokel
	strh	w23, [x21]
	ldr	x8, [x20, #8]
	str	x19, [x8, x23, lsl #3]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh43:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh44:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open_rx_first (0x%x)\n"

	.comm	_ATM_NONE,8,3                   ; @ATM_NONE
	.comm	_ATM_AAL5,8,3                   ; @ATM_AAL5
	.comm	_ATM_AAL5_TRAILER,8,3           ; @ATM_AAL5_TRAILER
	.comm	_ATM_CELL_PAYLOAD,4,2           ; @ATM_CELL_PAYLOAD
	.comm	_ZATM_AAL0_POOL,2,1             ; @ZATM_AAL0_POOL
	.comm	_EMSGSIZE,4,2                   ; @EMSGSIZE
	.comm	_zwait,4,2                      ; @zwait
	.comm	_uPD98401_OPEN_CHAN,4,2         ; @uPD98401_OPEN_CHAN
	.comm	_CMR,4,2                        ; @CMR
l_.str.1:                               ; @.str.1
	.asciz	"0x%x 0x%x\n"

	.comm	_CER,4,2                        ; @CER
	.comm	_uPD98401_CHAN_ADDR,2,1         ; @uPD98401_CHAN_ADDR
	.comm	_uPD98401_CHAN_ADDR_SHIFT,2,1   ; @uPD98401_CHAN_ADDR_SHIFT
l_.str.2:                               ; @.str.2
	.asciz	"chan is %d\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.3:                               ; @.str.3
	.asciz	"pool %d\n"

	.comm	_uPD98401_RXVC_POOL_SHIFT,4,2   ; @uPD98401_RXVC_POOL_SHIFT
	.comm	_VC_SIZE,2,1                    ; @VC_SIZE
	.comm	_uPD98401_RXVC_OD,4,2           ; @uPD98401_RXVC_OD
	.comm	_uPD98401_RXVC_AR,4,2           ; @uPD98401_RXVC_AR
	.no_dead_strip	_open_rx_first
.subsections_via_symbols
