	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_modem
_write_modem:                           ## @write_modem
	.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
	movq	%rdi, %r15
	movq	(%rdi), %rdi
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.1:
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	LBB0_8
## %bb.2:
	movq	8(%r15), %r14
	movq	_MAX_MODEM_BUF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	(%r14), %edx
	movl	%ebx, %ecx
	subl	%edx, %ecx
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	addl	4(%r14), %edx
	leal	-1(%rbx), %eax
	andl	%edx, %eax
	subl	%eax, %ebx
	movl	%ecx, %r12d
	subl	%ebx, %r12d
	jle	LBB0_3
## %bb.4:
	movslq	%eax, %rsi
	addq	16(%r14), %rsi
	movl	%ebx, %edx
	callq	_skb_copy_from_linear_data
	movq	(%r15), %rdi
	movl	%ebx, %esi
	callq	_skb_pull
	addl	%ebx, (%r14)
	movq	(%r15), %rdi
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_3:
	xorl	%ebx, %ebx
	movl	%ecx, %r12d
LBB0_5:
	movslq	%eax, %rsi
	addq	16(%r14), %rsi
	movl	%r12d, %edx
	callq	_skb_copy_from_linear_data
	movq	(%r15), %rdi
	movl	%r12d, %esi
	callq	_skb_pull
	addl	%r12d, %ebx
	addl	%r12d, (%r14)
	je	LBB0_8
## %bb.6:
	movl	8(%r14), %eax
	movq	_UART_IER_THRI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	jne	LBB0_8
## %bb.7:
	orl	%eax, %edx
	movl	%edx, 8(%r14)
	movq	_UART_IER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_serial_outp
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_MODEM_BUF,4,2              ## @MAX_MODEM_BUF
	.comm	_UART_IER_THRI,4,2              ## @UART_IER_THRI
	.comm	_UART_IER,4,2                   ## @UART_IER
	.no_dead_strip	_write_modem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_modem
_write_modem:                           ; @write_modem
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	ldr	x0, [x0]
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
Lloh0:
	adrp	x9, _MAX_MODEM_BUF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX_MODEM_BUF@GOTPAGEOFF]
	ldr	x19, [x20, #8]
Lloh2:
	ldr	w9, [x9]
	ldp	w10, w11, [x19]
	sub	w12, w9, w10
	cmp	w8, w12
	csel	w22, w8, w12, lt
	sub	w8, w9, #1
	add	w10, w11, w10
	and	w8, w10, w8
	sub	w21, w9, w8
	subs	w23, w22, w21
	b.le	LBB0_5
; %bb.3:
	ldr	x9, [x19, #16]
	add	x1, x9, w8, sxtw
	mov	x2, x21
	bl	_skb_copy_from_linear_data
	ldr	x0, [x20]
	mov	x1, x21
	bl	_skb_pull
	mov	w8, #0
	ldr	w9, [x19]
	add	w9, w9, w21
	str	w9, [x19]
	ldr	x0, [x20]
	mov	x22, x23
	b	LBB0_6
LBB0_4:
	mov	w20, #0
	b	LBB0_9
LBB0_5:
	mov	w21, #0
LBB0_6:
	ldr	x9, [x19, #16]
	add	x1, x9, w8, sxtw
	mov	x2, x22
	bl	_skb_copy_from_linear_data
	ldr	x0, [x20]
	mov	x1, x22
	bl	_skb_pull
	ldr	w8, [x19]
	add	w20, w22, w21
	adds	w8, w8, w22
	str	w8, [x19]
	b.eq	LBB0_9
; %bb.7:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _UART_IER_THRI@GOTPAGE
Lloh4:
	ldr	x9, [x9, _UART_IER_THRI@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_9
; %bb.8:
	orr	w2, w9, w8
	str	w2, [x19, #8]
Lloh6:
	adrp	x8, _UART_IER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _UART_IER@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_serial_outp
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_MODEM_BUF,4,2              ; @MAX_MODEM_BUF
	.comm	_UART_IER_THRI,4,2              ; @UART_IER_THRI
	.comm	_UART_IER,4,2                   ; @UART_IER
	.no_dead_strip	_write_modem
.subsections_via_symbols
