	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adb_open
_adb_open:                              ## @adb_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	%rsi, %r15
	movq	%rdi, %rbx
	movq	_adb_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_iminor
	testq	%rax, %rax
	jg	LBB0_2
## %bb.1:
	movq	_adb_controller@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.4:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r14
	movq	%rax, (%r15)
	leaq	20(%rax), %rdi
	callq	_spin_lock_init
	leaq	16(%r14), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_atomic_set
	movq	$0, 8(%r14)
	movq	%r14, %rdi
	addq	$4, %rdi
	callq	_init_waitqueue_head
	movl	$1, (%r14)
	jmp	LBB0_7
LBB0_2:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movq	_adb_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_adb_mutex,4,2                  ## @adb_mutex
	.comm	_adb_controller,8,3             ## @adb_controller
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_adb_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adb_open
_adb_open:                              ; @adb_open
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x0, _adb_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _adb_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, x20
	bl	_iminor
	cmp	x0, #0
	b.gt	LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _adb_controller@GOTPAGE
Lloh3:
	ldr	x8, [x8, _adb_controller@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.2:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x20, x0
	str	x0, [x19]
	add	x0, x0, #20
	bl	_spin_lock_init
	add	x0, x20, #16
	mov	w1, #0
	bl	_atomic_set
	str	xzr, [x20, #8]
	add	x0, x20, #4
	bl	_init_waitqueue_head
	mov	w19, #0
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_7
LBB0_4:
Lloh8:
	adrp	x8, _ENXIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_7:
Lloh12:
	adrp	x0, _adb_mutex@GOTPAGE
Lloh13:
	ldr	x0, [x0, _adb_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_adb_mutex,4,2                  ; @adb_mutex
	.comm	_adb_controller,8,3             ; @adb_controller
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_adb_open
.subsections_via_symbols
