	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function if_lock
_if_lock:                               ## @if_lock
	.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
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	(%rsi), %r12d
	movq	_DEBUG_IF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	48(%r15), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_gig_dbg
	cmpl	$2, %r12d
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_2:
	testl	%r12d, %r12d
	js	LBB0_3
## %bb.4:
	jne	LBB0_8
## %bb.5:
	movq	(%r15), %rax
	movq	_MS_LOCKED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.6:
	cmpq	$0, 40(%r15)
	je	LBB0_8
## %bb.7:
	movq	32(%r15), %rax
	movq	_TIOCM_DTR@GOTPCREL(%rip), %r13
	movq	_TIOCM_RTS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	orl	(%r13), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	*16(%rax)
	movq	32(%r15), %rax
	movq	_B115200@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r15, %rdi
	callq	*8(%rax)
	movq	32(%r15), %rax
	movq	_CS8@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r15, %rdi
	callq	*(%rax)
	movl	(%rbx), %eax
	orl	(%r13), %eax
	movl	%eax, 8(%r15)
LBB0_8:
	movl	$1, 12(%r15)
	leaq	24(%r15), %rsi
	movq	_EV_IF_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	movl	%r12d, %r8d
	xorl	%r9d, %r9d
	callq	_gigaset_add_event
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movq	_DEBUG_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_gig_dbg
	movq	%r15, %rdi
	callq	_gigaset_schedule_event
	movl	20(%r15), %edi
	xorl	%esi, %esi
	cmpl	$0, 12(%r15)
	sete	%sil
	callq	_wait_event
	movl	16(%r15), %eax
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movl	%eax, (%r14)
	jmp	LBB0_13
LBB0_3:
	movq	(%r15), %rax
	movq	_MS_LOCKED@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	movl	%edx, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_9:
	movl	$0, 12(%r15)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_11:
	movl	%eax, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEBUG_IF,4,2                   ## @DEBUG_IF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%u: if_lock (%d)"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MS_LOCKED,8,3                  ## @MS_LOCKED
	.comm	_TIOCM_DTR,4,2                  ## @TIOCM_DTR
	.comm	_TIOCM_RTS,4,2                  ## @TIOCM_RTS
	.comm	_B115200,4,2                    ## @B115200
	.comm	_CS8,4,2                        ## @CS8
	.comm	_EV_IF_LOCK,4,2                 ## @EV_IF_LOCK
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DEBUG_CMD,4,2                  ## @DEBUG_CMD
L_.str.1:                               ## @.str.1
	.asciz	"scheduling IF_LOCK"

	.no_dead_strip	_if_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function if_lock
_if_lock:                               ; @if_lock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	w21, [x1]
Lloh0:
	adrp	x8, _DEBUG_IF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEBUG_IF@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w8, [x20, #48]
	stp	x8, x21, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_gig_dbg
	cmp	w21, #2
	b.lt	LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_3:
	tbnz	w21, #31, LBB0_11
; %bb.4:
	cbnz	w21, LBB0_8
; %bb.5:
	ldr	x8, [x20]
Lloh7:
	adrp	x9, _MS_LOCKED@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MS_LOCKED@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	x8, [x20, #32]
Lloh10:
	adrp	x22, _TIOCM_DTR@GOTPAGE
Lloh11:
	ldr	x22, [x22, _TIOCM_DTR@GOTPAGEOFF]
	ldr	x8, [x8, #16]
	ldr	w9, [x22]
Lloh12:
	adrp	x23, _TIOCM_RTS@GOTPAGE
Lloh13:
	ldr	x23, [x23, _TIOCM_RTS@GOTPAGEOFF]
	ldr	w10, [x23]
	orr	w2, w10, w9
	mov	x0, x20
	mov	w1, #0
	blr	x8
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #8]
Lloh14:
	adrp	x9, _B115200@GOTPAGE
Lloh15:
	ldr	x9, [x9, _B115200@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x9]
	mov	x0, x20
	blr	x8
	ldr	x8, [x20, #32]
	ldr	x8, [x8]
Lloh17:
	adrp	x9, _CS8@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CS8@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x9]
	mov	x0, x20
	blr	x8
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w8, w9, w8
	str	w8, [x20, #8]
LBB0_8:
	mov	w8, #1
	str	w8, [x20, #12]
	add	x1, x20, #24
Lloh20:
	adrp	x8, _EV_IF_LOCK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EV_IF_LOCK@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x3, #0
	mov	x4, x21
	mov	x5, #0
	bl	_gigaset_add_event
	cbz	w0, LBB0_13
; %bb.9:
Lloh23:
	adrp	x8, _DEBUG_CMD@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DEBUG_CMD@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_gig_dbg
	mov	x0, x20
	bl	_gigaset_schedule_event
	ldr	w0, [x20, #20]
	ldr	w8, [x20, #12]
	cmp	w8, #0
	cset	w1, eq
	bl	_wait_event
	ldr	w0, [x20, #16]
	tbnz	w0, #31, LBB0_12
; %bb.10:
	str	w0, [x19]
	mov	w0, #0
	b	LBB0_12
LBB0_11:
	mov	w0, #0
	ldr	x8, [x20]
Lloh28:
	adrp	x9, _MS_LOCKED@GOTPAGE
Lloh29:
	ldr	x9, [x9, _MS_LOCKED@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w8, eq
	str	w8, [x19]
LBB0_12:
	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
	add	sp, sp, #80
	ret
LBB0_13:
	str	wzr, [x20, #12]
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_DEBUG_IF,4,2                   ; @DEBUG_IF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%u: if_lock (%d)"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MS_LOCKED,8,3                  ; @MS_LOCKED
	.comm	_TIOCM_DTR,4,2                  ; @TIOCM_DTR
	.comm	_TIOCM_RTS,4,2                  ; @TIOCM_RTS
	.comm	_B115200,4,2                    ; @B115200
	.comm	_CS8,4,2                        ; @CS8
	.comm	_EV_IF_LOCK,4,2                 ; @EV_IF_LOCK
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DEBUG_CMD,4,2                  ; @DEBUG_CMD
l_.str.1:                               ; @.str.1
	.asciz	"scheduling IF_LOCK"

	.no_dead_strip	_if_lock
.subsections_via_symbols
