	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at91_setup_mailboxes
_at91_setup_mailboxes:                  ## @at91_setup_mailboxes
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_netdev_priv
	movq	%rax, %r15
	movl	24(%rax), %edi
	callq	_at91_can_id_to_reg_mid
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_get_mb_rx_first
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	movq	_AT91_MB_MODE_DISABLED@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_set_mb_mode
	movl	%ebx, %edi
	callq	_AT91_MID
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%r14d, %edx
	callq	_at91_write
	movl	%ebx, %edi
	callq	_AT91_MCR
	movq	%r15, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_at91_write
	incl	%ebx
	movq	%r15, %rdi
	callq	_get_mb_rx_first
	cmpl	%eax, %ebx
	jb	LBB0_2
LBB0_3:
	movq	%r15, %rdi
	callq	_get_mb_rx_first
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_get_mb_rx_last
	cmpl	%eax, %ebx
	jae	LBB0_6
## %bb.4:
	movq	_AT91_MB_MODE_RX@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_set_mb_mode
	incl	%ebx
	movq	%r15, %rdi
	callq	_get_mb_rx_last
	cmpl	%eax, %ebx
	jb	LBB0_5
LBB0_6:
	movq	%r15, %rdi
	callq	_get_mb_rx_last
	movq	_AT91_MB_MODE_RX_OVRWR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_set_mb_mode
	movq	%r15, %rdi
	callq	_get_mb_rx_first
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_get_mb_rx_last
	cmpl	%eax, %ebx
	ja	LBB0_9
## %bb.7:
	movq	_AT91_MID_MIDE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_AT91_MAM
	movq	%r15, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_at91_write
	movl	%ebx, %edi
	callq	_AT91_MID
	movl	(%r14), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_at91_write
	incl	%ebx
	movq	%r15, %rdi
	callq	_get_mb_rx_last
	cmpl	%eax, %ebx
	jbe	LBB0_8
LBB0_9:
	movq	%r15, %rdi
	callq	_get_mb_tx_first
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_get_mb_tx_last
	cmpl	%eax, %ebx
	ja	LBB0_12
## %bb.10:
	movq	_AT91_MB_MODE_TX@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%ecx, %ecx
	callq	_set_mb_mode_prio
	incl	%ebx
	movq	%r15, %rdi
	callq	_get_mb_tx_last
	cmpl	%eax, %ebx
	jbe	LBB0_11
LBB0_12:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r15)
	movq	%r15, %rdi
	callq	_get_mb_rx_first
	movl	%eax, (%r15)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AT91_MB_MODE_DISABLED,4,2      ## @AT91_MB_MODE_DISABLED
	.comm	_AT91_MB_MODE_RX,4,2            ## @AT91_MB_MODE_RX
	.comm	_AT91_MB_MODE_RX_OVRWR,4,2      ## @AT91_MB_MODE_RX_OVRWR
	.comm	_AT91_MID_MIDE,4,2              ## @AT91_MID_MIDE
	.comm	_AT91_MB_MODE_TX,4,2            ## @AT91_MB_MODE_TX
	.no_dead_strip	_at91_setup_mailboxes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at91_setup_mailboxes
_at91_setup_mailboxes:                  ; @at91_setup_mailboxes
	.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
	bl	_netdev_priv
	mov	x19, x0
	ldr	w0, [x0, #24]
	bl	_at91_can_id_to_reg_mid
	mov	x20, x0
	mov	x0, x19
	bl	_get_mb_rx_first
	cbz	w0, LBB0_3
; %bb.1:
	mov	w21, #0
Lloh0:
	adrp	x22, _AT91_MB_MODE_DISABLED@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AT91_MB_MODE_DISABLED@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x21
	bl	_set_mb_mode
	mov	x0, x21
	bl	_AT91_MID
	mov	x1, x0
	mov	x0, x19
	mov	x2, x20
	bl	_at91_write
	mov	x0, x21
	bl	_AT91_MCR
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_at91_write
	add	w21, w21, #1
	mov	x0, x19
	bl	_get_mb_rx_first
	cmp	w21, w0
	b.lo	LBB0_2
LBB0_3:
	mov	x0, x19
	bl	_get_mb_rx_first
	mov	x20, x0
	mov	x0, x19
	bl	_get_mb_rx_last
	cmp	w20, w0
	b.hs	LBB0_6
; %bb.4:
Lloh2:
	adrp	x21, _AT91_MB_MODE_RX@GOTPAGE
Lloh3:
	ldr	x21, [x21, _AT91_MB_MODE_RX@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_set_mb_mode
	add	w20, w20, #1
	mov	x0, x19
	bl	_get_mb_rx_last
	cmp	w20, w0
	b.lo	LBB0_5
LBB0_6:
	mov	x0, x19
	bl	_get_mb_rx_last
	mov	x1, x0
Lloh4:
	adrp	x8, _AT91_MB_MODE_RX_OVRWR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AT91_MB_MODE_RX_OVRWR@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_set_mb_mode
	mov	x0, x19
	bl	_get_mb_rx_first
	mov	x20, x0
	mov	x0, x19
	bl	_get_mb_rx_last
	cmp	w20, w0
	b.hi	LBB0_9
; %bb.7:
Lloh7:
	adrp	x21, _AT91_MID_MIDE@GOTPAGE
Lloh8:
	ldr	x21, [x21, _AT91_MID_MIDE@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_AT91_MAM
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_at91_write
	mov	x0, x20
	bl	_AT91_MID
	mov	x1, x0
	ldr	w2, [x21]
	mov	x0, x19
	bl	_at91_write
	add	w20, w20, #1
	mov	x0, x19
	bl	_get_mb_rx_last
	cmp	w20, w0
	b.ls	LBB0_8
LBB0_9:
	mov	x0, x19
	bl	_get_mb_tx_first
	mov	x20, x0
	mov	x0, x19
	bl	_get_mb_tx_last
	cmp	w20, w0
	b.hi	LBB0_12
; %bb.10:
Lloh9:
	adrp	x21, _AT91_MB_MODE_TX@GOTPAGE
Lloh10:
	ldr	x21, [x21, _AT91_MB_MODE_TX@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x20
	mov	w3, #0
	bl	_set_mb_mode_prio
	add	w20, w20, #1
	mov	x0, x19
	bl	_get_mb_tx_last
	cmp	w20, w0
	b.ls	LBB0_11
LBB0_12:
	stp	xzr, xzr, [x19, #8]
	mov	x0, x19
	bl	_get_mb_rx_first
	str	w0, [x19]
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AT91_MB_MODE_DISABLED,4,2      ; @AT91_MB_MODE_DISABLED
	.comm	_AT91_MB_MODE_RX,4,2            ; @AT91_MB_MODE_RX
	.comm	_AT91_MB_MODE_RX_OVRWR,4,2      ; @AT91_MB_MODE_RX_OVRWR
	.comm	_AT91_MID_MIDE,4,2              ; @AT91_MID_MIDE
	.comm	_AT91_MB_MODE_TX,4,2            ; @AT91_MB_MODE_TX
	.no_dead_strip	_at91_setup_mailboxes
.subsections_via_symbols
