	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reset_device
_reset_device:                          ## @reset_device
	.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
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	leal	-1(%rbx), %esi
	movl	(%r14), %ecx
	movl	4(%r14), %r8d
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	callq	_snprintf
	movq	8(%r14), %rsi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	movl	%eax, %ebx
	movq	_USBDEVFS_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_2
## %bb.3:
	leaq	L_str(%rip), %rdi
	callq	_puts
	jmp	LBB0_4
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.4(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_6
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_printf
LBB0_4:
	movl	%ebx, %edi
	callq	_close
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	leaq	-24(%rbp), %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/bus/usb/%03d/%03d"

L_.str.1:                               ## @.str.1
	.asciz	"Resetting %s ... "

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_USBDEVFS_RESET,4,2             ## @USBDEVFS_RESET
L_.str.2:                               ## @.str.2
	.asciz	"failed [%s]\n"

	.comm	_errno,4,2                      ## @errno
L_.str.4:                               ## @.str.4
	.asciz	"can't open [%s]\n"

L_str:                                  ## @str
	.asciz	"ok"

	.no_dead_strip	_reset_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reset_device
_reset_device:                          ; @reset_device
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x8, _PATH_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PATH_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x10, x10, #0x1fffffff0
	sub	x20, x9, x10
	mov	sp, x20
	sub	w1, w8, #1
	ldp	w3, w4, [x0]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_snprintf
	ldr	x8, [x19, #8]
	str	x8, [sp, #-16]!
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	add	sp, sp, #16
Lloh12:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_open
	tbnz	w0, #31, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh15:
	adrp	x8, _USBDEVFS_RESET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _USBDEVFS_RESET@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_ioctl
	tbnz	x0, #63, LBB0_4
; %bb.2:
Lloh18:
	adrp	x0, l_str@PAGE
Lloh19:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	b	LBB0_5
LBB0_3:
Lloh20:
	adrp	x8, _errno@GOTPAGE
Lloh21:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_strerror
	str	x0, [sp, #-16]!
Lloh23:
	adrp	x0, l_.str.4@PAGE
Lloh24:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
	add	sp, sp, #16
	b	LBB0_6
LBB0_4:
Lloh25:
	adrp	x8, _errno@GOTPAGE
Lloh26:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	bl	_strerror
	str	x0, [sp, #-16]!
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
	add	sp, sp, #16
LBB0_5:
	mov	x0, x19
	bl	_close
LBB0_6:
	ldur	x8, [x29, #-24]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	sub	sp, x29, #16
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/bus/usb/%03d/%03d"

l_.str.1:                               ; @.str.1
	.asciz	"Resetting %s ... "

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_USBDEVFS_RESET,4,2             ; @USBDEVFS_RESET
l_.str.2:                               ; @.str.2
	.asciz	"failed [%s]\n"

	.comm	_errno,4,2                      ; @errno
l_.str.4:                               ; @.str.4
	.asciz	"can't open [%s]\n"

l_str:                                  ; @str
	.asciz	"ok"

	.no_dead_strip	_reset_device
.subsections_via_symbols
