	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grcan_open
_grcan_open:                            ## @grcan_open
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %r15
	movl	60(%rax), %edx
	movl	64(%rax), %esi
	movq	%r14, %rdi
	callq	_grcan_allocate_dma_buffers
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
	jmp	LBB0_15
LBB0_2:
	movl	68(%r15), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	$1, %esi
	callq	_kcalloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	68(%r15), %edi
	movl	%edi, 48(%r15)
	movq	%rax, 40(%r15)
	movl	(%rbx), %edx
	movl	$1, %esi
	callq	_kcalloc
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r14, %rdi
	callq	_open_candev
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.7:
	movl	(%r14), %ecx
	movl	4(%r14), %edi
	movq	_grcan_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IRQF_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %r8
	callq	_request_irq
	testl	%eax, %eax
	je	LBB0_8
## %bb.11:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_close_candev
LBB0_12:
	movq	16(%r15), %rdi
	callq	_kfree
	jmp	LBB0_13
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movq	8(%r15), %rdi
	callq	_kfree
LBB0_14:
	movq	%r14, %rdi
	callq	_grcan_free_dma_buffers
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	24(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	addq	$56, %rdi
	callq	_napi_enable
	movq	%r14, %rdi
	callq	_grcan_start
	movq	_CAN_CTRLMODE_LISTENONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 32(%r15)
	jne	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_netif_start_queue
LBB0_10:
	movq	$0, (%r15)
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not allocate DMA buffers\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_grcan_interrupt,4,2            ## @grcan_interrupt
	.comm	_IRQF_SHARED,4,2                ## @IRQF_SHARED
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ## @CAN_CTRLMODE_LISTENONLY
	.no_dead_strip	_grcan_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grcan_open
_grcan_open:                            ; @grcan_open
	.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
	mov	x19, x0
	bl	_netdev_priv
	mov	x20, x0
	ldp	w2, w1, [x0, #60]
	mov	x0, x19
	bl	_grcan_allocate_dma_buffers
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
	b	LBB0_12
LBB0_2:
	ldr	w0, [x20, #68]
Lloh2:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	w1, #1
	bl	_kcalloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w8, [x20, #68]
	str	w8, [x20, #48]
	str	x0, [x20, #40]
	ldr	w2, [x21]
	mov	x0, x8
	mov	w1, #1
	bl	_kcalloc
	str	x0, [x20, #16]
	cbz	x0, LBB0_9
; %bb.4:
	mov	x0, x19
	bl	_open_candev
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.5:
Lloh4:
	adrp	x8, _grcan_interrupt@GOTPAGE
Lloh5:
	ldr	x8, [x8, _grcan_interrupt@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _IRQF_SHARED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IRQF_SHARED@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	ldp	w3, w0, [x19]
	mov	x4, x19
	bl	_request_irq
	cbz	w0, LBB0_13
; %bb.6:
	mov	x21, x0
	mov	x0, x19
	bl	_close_candev
LBB0_7:
	ldr	x0, [x20, #16]
	bl	_kfree
	b	LBB0_10
LBB0_8:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_9:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	ldr	x0, [x20, #8]
	bl	_kfree
LBB0_11:
	mov	x0, x19
	bl	_grcan_free_dma_buffers
LBB0_12:
	mov	x0, x21
	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
LBB0_13:
	add	x21, x20, #24
	mov	x0, x21
	bl	_spin_lock_irqsave
	add	x0, x20, #56
	bl	_napi_enable
	mov	x0, x19
	bl	_grcan_start
	ldr	w8, [x20, #32]
Lloh16:
	adrp	x9, _CAN_CTRLMODE_LISTENONLY@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CAN_CTRLMODE_LISTENONLY@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_netif_start_queue
LBB0_15:
	str	xzr, [x20]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	w21, #0
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not allocate DMA buffers\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_grcan_interrupt,4,2            ; @grcan_interrupt
	.comm	_IRQF_SHARED,4,2                ; @IRQF_SHARED
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ; @CAN_CTRLMODE_LISTENONLY
	.no_dead_strip	_grcan_open
.subsections_via_symbols
