	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_cancel_transfer         ## -- Begin function libusb_cancel_transfer
	.p2align	4, 0x90
_libusb_cancel_transfer:                ## @libusb_cancel_transfer
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	testq	%r15, %r15
	je	LBB0_3
## %bb.4:
	movl	4(%rbx), %r12d
	movq	%r15, %rdi
	callq	_libusb_get_device
	movq	%rax, %r14
	movl	8(%rax), %edi
	movq	_LIBUSB_DEBUG_FUNCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_DPRINTF
	movl	8(%r14), %edi
	callq	_CTX_LOCK
	movq	%r15, %rdi
	movl	%r12d, %esi
	xorl	%edx, %edx
	callq	_libusb10_get_transfer
	movq	%rax, %r13
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	$1, %edx
	callq	_libusb10_get_transfer
	movq	-64(%rbx), %rdx
	movq	_LIBUSB_SUPER_XFER_ST_PEND@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_5
## %bb.7:
	addq	$-64, %rbx
	cmpq	$0, 8(%rbx)
	je	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	addq	$12, %rdi
	movq	_entry@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_TAILQ_REMOVE
	movq	$0, 8(%rbx)
	movq	_LIBUSB_TRANSFER_CANCELLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	xorl	%edi, %edi
	movq	%rbx, %rsi
	callq	_libusb10_complete_transfer
LBB0_14:
	movl	8(%r14), %edi
	callq	_libusb10_wakeup_event_loop
	jmp	LBB0_17
LBB0_1:
	movq	_LIBUSB_ERROR_INVALID_PARAM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_18
LBB0_3:
	movq	_LIBUSB_ERROR_NOT_FOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_18
LBB0_5:
	movq	_LIBUSB_TRANSFER_CANCELLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_6:
	movq	_LIBUSB_ERROR_NOT_FOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_17:
	movq	_LIBUSB_DEBUG_FUNCTION@GOTPCREL(%rip), %rbx
	movl	8(%r14), %edi
	callq	_CTX_UNLOCK
	movl	8(%r14), %edi
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdx
	callq	_DPRINTF
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	testq	%r13, %r13
	je	LBB0_6
## %bb.10:
	testq	%rax, %rax
	je	LBB0_6
## %bb.11:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_libusb20_tr_get_priv_sc1
	cmpq	%rbx, %rax
	je	LBB0_12
## %bb.15:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_libusb20_tr_get_priv_sc1
	cmpq	%rbx, %rax
	jne	LBB0_6
LBB0_12:
	movq	_LIBUSB_TRANSFER_CANCELLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_libusb10_complete_transfer
	cmpq	$0, (%r14)
	je	LBB0_16
## %bb.13:
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_libusb20_tr_set_priv_sc1
	jmp	LBB0_14
LBB0_16:
	movq	%r13, %rdi
	callq	_libusb20_tr_stop
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_libusb10_submit_transfer_sub
	xorl	%r15d, %r15d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ## @LIBUSB_ERROR_INVALID_PARAM
	.comm	_LIBUSB_ERROR_NOT_FOUND,4,2     ## @LIBUSB_ERROR_NOT_FOUND
	.comm	_LIBUSB_DEBUG_FUNCTION,4,2      ## @LIBUSB_DEBUG_FUNCTION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"libusb_cancel_transfer enter"

	.comm	_LIBUSB_SUPER_XFER_ST_PEND,8,3  ## @LIBUSB_SUPER_XFER_ST_PEND
	.comm	_LIBUSB_TRANSFER_CANCELLED,4,2  ## @LIBUSB_TRANSFER_CANCELLED
	.comm	_entry,4,2                      ## @entry
L_.str.1:                               ## @.str.1
	.asciz	"libusb_cancel_transfer leave"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libusb_cancel_transfer         ; -- Begin function libusb_cancel_transfer
	.p2align	2
_libusb_cancel_transfer:                ; @libusb_cancel_transfer
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	x0, LBB0_6
; %bb.1:
	mov	x24, x0
	ldr	x20, [x0, #8]
	cbz	x20, LBB0_7
; %bb.2:
	ldr	w21, [x24, #4]
	mov	x0, x20
	bl	_libusb_get_device
	mov	x19, x0
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x26, _LIBUSB_DEBUG_FUNCTION@GOTPAGE
Lloh1:
	ldr	x26, [x26, _LIBUSB_DEBUG_FUNCTION@GOTPAGEOFF]
	ldr	w1, [x26]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	bl	_DPRINTF
	ldr	w0, [x19, #8]
	bl	_CTX_LOCK
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_libusb10_get_transfer
	mov	x25, x0
	mov	x0, x20
	mov	x1, x21
	mov	w2, #1
	bl	_libusb10_get_transfer
	mov	x22, x24
	ldr	x8, [x22, #-64]!
Lloh4:
	adrp	x9, _LIBUSB_SUPER_XFER_ST_PEND@GOTPAGE
Lloh5:
	ldr	x9, [x9, _LIBUSB_SUPER_XFER_ST_PEND@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_12
; %bb.4:
	add	x0, x19, #12
Lloh7:
	adrp	x8, _entry@GOTPAGE
Lloh8:
	ldr	x8, [x8, _entry@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x1, x22
	bl	_TAILQ_REMOVE
	str	xzr, [x22, #8]
Lloh10:
	adrp	x8, _LIBUSB_TRANSFER_CANCELLED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LIBUSB_TRANSFER_CANCELLED@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, #0
	mov	x1, x22
	bl	_libusb10_complete_transfer
LBB0_5:
	ldr	w0, [x19, #8]
	bl	_libusb10_wakeup_event_loop
	mov	w20, #0
	b	LBB0_10
LBB0_6:
Lloh13:
	adrp	x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LIBUSB_ERROR_INVALID_PARAM@GOTPAGEOFF]
Lloh15:
	ldr	w20, [x8]
	b	LBB0_11
LBB0_7:
Lloh16:
	adrp	x8, _LIBUSB_ERROR_NOT_FOUND@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LIBUSB_ERROR_NOT_FOUND@GOTPAGEOFF]
Lloh18:
	ldr	w20, [x8]
	b	LBB0_11
LBB0_8:
Lloh19:
	adrp	x8, _LIBUSB_TRANSFER_CANCELLED@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LIBUSB_TRANSFER_CANCELLED@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x24]
LBB0_9:
Lloh22:
	adrp	x8, _LIBUSB_ERROR_NOT_FOUND@GOTPAGE
Lloh23:
	ldr	x8, [x8, _LIBUSB_ERROR_NOT_FOUND@GOTPAGEOFF]
Lloh24:
	ldr	w20, [x8]
LBB0_10:
	ldr	w0, [x19, #8]
	bl	_CTX_UNLOCK
	ldr	w0, [x19, #8]
	ldr	w1, [x26]
Lloh25:
	adrp	x2, l_.str.1@PAGE
Lloh26:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_DPRINTF
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	cbz	x25, LBB0_9
; %bb.13:
	mov	x23, x0
	cbz	x0, LBB0_9
; %bb.14:
	mov	x0, x25
	bl	_libusb20_tr_get_priv_sc1
	cmp	x0, x22
	b.eq	LBB0_18
; %bb.15:
	mov	x0, x23
	bl	_libusb20_tr_get_priv_sc1
	cmp	x0, x22
	b.ne	LBB0_9
; %bb.16:
Lloh27:
	adrp	x8, _LIBUSB_TRANSFER_CANCELLED@GOTPAGE
Lloh28:
	ldr	x8, [x8, _LIBUSB_TRANSFER_CANCELLED@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, x22
	bl	_libusb10_complete_transfer
	ldr	x8, [x19]
	cbz	x8, LBB0_22
; %bb.17:
	mov	x0, x23
	b	LBB0_20
LBB0_18:
Lloh30:
	adrp	x8, _LIBUSB_TRANSFER_CANCELLED@GOTPAGE
Lloh31:
	ldr	x8, [x8, _LIBUSB_TRANSFER_CANCELLED@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	mov	x0, x25
	mov	x1, x22
	bl	_libusb10_complete_transfer
	ldr	x8, [x19]
	cbz	x8, LBB0_21
; %bb.19:
	mov	x0, x25
LBB0_20:
	mov	x1, #0
	bl	_libusb20_tr_set_priv_sc1
	b	LBB0_5
LBB0_21:
	mov	x0, x25
	b	LBB0_23
LBB0_22:
	mov	x0, x23
LBB0_23:
	bl	_libusb20_tr_stop
	mov	x0, x20
	mov	x1, x21
	bl	_libusb10_submit_transfer_sub
	mov	w20, #0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_LIBUSB_ERROR_INVALID_PARAM,4,2 ; @LIBUSB_ERROR_INVALID_PARAM
	.comm	_LIBUSB_ERROR_NOT_FOUND,4,2     ; @LIBUSB_ERROR_NOT_FOUND
	.comm	_LIBUSB_DEBUG_FUNCTION,4,2      ; @LIBUSB_DEBUG_FUNCTION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"libusb_cancel_transfer enter"

	.comm	_LIBUSB_SUPER_XFER_ST_PEND,8,3  ; @LIBUSB_SUPER_XFER_ST_PEND
	.comm	_LIBUSB_TRANSFER_CANCELLED,4,2  ; @LIBUSB_TRANSFER_CANCELLED
	.comm	_entry,4,2                      ; @entry
l_.str.1:                               ; @.str.1
	.asciz	"libusb_cancel_transfer leave"

.subsections_via_symbols
