	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_device_set_debug_mode       ## -- Begin function hl_device_set_debug_mode
	.p2align	4, 0x90
_hl_device_set_debug_mode:              ## @hl_device_set_debug_mode
	.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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	testl	%r15d, %r15d
	je	LBB0_1
## %bb.5:
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_1:
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movq	16(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	movl	$0, (%rbx)
	jmp	LBB0_8
LBB0_7:
	movl	$1, (%rbx)
LBB0_8:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_2:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
LBB0_3:
	callq	_dev_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to disable debug mode because device was not in debug mode\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.1:                               ## @.str.1
	.asciz	"Failed to enable debug mode because device is already in debug mode\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_device_set_debug_mode       ; -- Begin function hl_device_set_debug_mode
	.p2align	2
_hl_device_set_debug_mode:              ; @hl_device_set_debug_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
	cbz	w21, LBB0_3
; %bb.1:
	cbz	w8, LBB0_5
; %bb.2:
	ldr	w0, [x20, #8]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_3:
	cbz	w8, LBB0_6
; %bb.4:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	mov	x0, x20
	blr	x8
	mov	w21, #0
	str	wzr, [x20]
	b	LBB0_8
LBB0_5:
	mov	w21, #0
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_8
LBB0_6:
	ldr	w0, [x20, #8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
LBB0_7:
	bl	_dev_err
Lloh4:
	adrp	x8, _EFAULT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to disable debug mode because device was not in debug mode\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.1:                               ; @.str.1
	.asciz	"Failed to enable debug mode because device is already in debug mode\n"

.subsections_via_symbols
