	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gigaset_shutdown               ## -- Begin function gigaset_shutdown
	.p2align	4, 0x90
_gigaset_shutdown:                      ## @gigaset_shutdown
	.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, %rbx
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_VALID_MINOR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.2:
	movl	$1, 4(%rbx)
	leaq	16(%rbx), %rsi
	movq	_EV_SHUTDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_gigaset_add_event
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	_DEBUG_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_gig_dbg
	movq	%rbx, %rdi
	callq	_gigaset_schedule_event
	movl	12(%rbx), %edi
	xorl	%esi, %esi
	cmpl	$0, 4(%rbx)
	sete	%sil
	callq	_wait_event
	movq	%rbx, %rdi
	callq	_cleanup_cs
	jmp	LBB0_4
LBB0_1:
	movl	$-1, %r15d
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VALID_MINOR,4,2                ## @VALID_MINOR
	.comm	_EV_SHUTDOWN,4,2                ## @EV_SHUTDOWN
	.comm	_DEBUG_CMD,4,2                  ## @DEBUG_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"scheduling SHUTDOWN"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gigaset_shutdown               ; -- Begin function gigaset_shutdown
	.p2align	2
_gigaset_shutdown:                      ; @gigaset_shutdown
	.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	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _VALID_MINOR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VALID_MINOR@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	mov	w8, #1
	str	w8, [x20, #4]
	add	x1, x20, #16
Lloh3:
	adrp	x8, _EV_SHUTDOWN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EV_SHUTDOWN@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x3, #0
	mov	w4, #0
	mov	x5, #0
	bl	_gigaset_add_event
	cbz	w0, LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _DEBUG_CMD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DEBUG_CMD@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_gig_dbg
	mov	x0, x20
	bl	_gigaset_schedule_event
	ldr	w0, [x20, #12]
	ldr	w8, [x20, #4]
	cmp	w8, #0
	cset	w1, eq
	bl	_wait_event
	mov	x0, x20
	bl	_cleanup_cs
LBB0_3:
	mov	w20, #0
	b	LBB0_5
LBB0_4:
	mov	w20, #-1
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_VALID_MINOR,4,2                ; @VALID_MINOR
	.comm	_EV_SHUTDOWN,4,2                ; @EV_SHUTDOWN
	.comm	_DEBUG_CMD,4,2                  ; @DEBUG_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"scheduling SHUTDOWN"

.subsections_via_symbols
