	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kalmia_send_init_packet
_kalmia_send_init_packet:               ## @kalmia_send_init_packet
	.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
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movl	(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_dbg
	movl	4(%r12), %r14d
	movl	%r14d, %edi
	movl	$2, %esi
	callq	_usb_sndbulkpipe
	movq	_KALMIA_USB_TIMEOUT@GOTPCREL(%rip), %r15
	movl	(%r15), %r9d
	leaq	-44(%rbp), %r8
	movl	%r14d, %edi
	movl	%eax, %esi
	movq	%rbx, %rdx
	movl	%r13d, %ecx
	callq	_usb_bulk_msg
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %ebx
	movl	(%r12), %edi
	movl	-44(%rbp), %ecx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movq	%r15, %rbx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	-44(%rbp), %edx
	movl	(%r12), %edi
	cmpl	%r13d, %edx
	jne	LBB0_4
## %bb.5:
	leaq	L_.str.3(%rip), %rsi
	callq	_netdev_dbg
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_netdev_err
LBB0_6:
	movq	%rbx, %r13
	movl	4(%r12), %ebx
	movl	%ebx, %edi
	movl	$129, %esi
	callq	_usb_rcvbulkpipe
	movl	(%r13), %r9d
	leaq	-44(%rbp), %r8
	movl	%ebx, %edi
	movl	%eax, %esi
	movq	%r15, %rdx
	movl	%r14d, %ecx
	callq	_usb_bulk_msg
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movl	(%r12), %edi
	movl	-44(%rbp), %ecx
	leaq	L_.str.4(%rip), %rsi
LBB0_2:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_netdev_err
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	-44(%rbp), %edx
	xorl	%ebx, %ebx
	cmpl	%r14d, %edx
	je	LBB0_10
## %bb.9:
	movl	(%r12), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_netdev_err
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Sending init packet"

	.comm	_KALMIA_USB_TIMEOUT,4,2         ## @KALMIA_USB_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"Error sending init packet. Status %i, length %i\n"

L_.str.2:                               ## @.str.2
	.asciz	"Did not send all of init packet. Bytes sent: %i"

L_.str.3:                               ## @.str.3
	.asciz	"Successfully sent init packet."

L_.str.4:                               ## @.str.4
	.asciz	"Error receiving init result. Status %i, length %i\n"

L_.str.5:                               ## @.str.5
	.asciz	"Unexpected init result length: %i\n"

	.no_dead_strip	_kalmia_send_init_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kalmia_send_init_packet
_kalmia_send_init_packet:               ; @kalmia_send_init_packet
	.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	x20, x4
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_dbg
	ldr	w24, [x19, #4]
	mov	x0, x24
	mov	w1, #2
	bl	_usb_sndbulkpipe
	mov	x1, x0
Lloh2:
	adrp	x25, _KALMIA_USB_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x25, [x25, _KALMIA_USB_TIMEOUT@GOTPAGEOFF]
	ldr	w5, [x25]
	add	x4, sp, #12
	mov	x0, x24
	mov	x2, x22
	mov	x3, x23
	bl	_usb_bulk_msg
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	w0, [x19]
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_2:
	ldr	w2, [sp, #12]
	ldr	w0, [x19]
	cmp	w2, w23
	b.ne	LBB0_4
; %bb.3:
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_netdev_dbg
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_netdev_err
LBB0_5:
	ldr	w22, [x19, #4]
	mov	x0, x22
	mov	w1, #129
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	ldr	w5, [x25]
	add	x4, sp, #12
	mov	x0, x22
	mov	x2, x21
	mov	x3, x20
	bl	_usb_bulk_msg
	cbz	w0, LBB0_9
; %bb.6:
	mov	x22, x0
	ldr	w0, [x19]
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_7:
	mov	x2, x22
	bl	_netdev_err
LBB0_8:
	mov	x0, x22
	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
LBB0_9:
	ldr	w2, [sp, #12]
	cmp	w2, w20
	b.eq	LBB0_11
; %bb.10:
	ldr	w0, [x19]
Lloh12:
	adrp	x1, l_.str.5@PAGE
Lloh13:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_netdev_err
LBB0_11:
	mov	w22, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Sending init packet"

	.comm	_KALMIA_USB_TIMEOUT,4,2         ; @KALMIA_USB_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"Error sending init packet. Status %i, length %i\n"

l_.str.2:                               ; @.str.2
	.asciz	"Did not send all of init packet. Bytes sent: %i"

l_.str.3:                               ; @.str.3
	.asciz	"Successfully sent init packet."

l_.str.4:                               ; @.str.4
	.asciz	"Error receiving init result. Status %i, length %i\n"

l_.str.5:                               ; @.str.5
	.asciz	"Unexpected init result length: %i\n"

	.no_dead_strip	_kalmia_send_init_packet
.subsections_via_symbols
