	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_waiter                         ## -- Begin function waiter
	.p2align	4, 0x90
_waiter:                                ## @waiter
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_semkey@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_semget
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	movq	$0, -24(%rbp)
	movl	$-1, -40(%rbp)
	movq	_SEM_UNDO@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%rax, -32(%rbp)
	leaq	-40(%rbp), %rsi
	movl	%ebx, %edi
	movl	$1, %edx
	callq	_semop
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_4:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$1, %edi
	callq	_sleep
	movq	$0, -24(%rbp)
	movl	$1, -40(%rbp)
	movq	(%r14), %rax
	movq	%rax, -32(%rbp)
	leaq	-40(%rbp), %rsi
	movl	%ebx, %edi
	movl	$1, %edx
	callq	_semop
	cmpl	$-1, %eax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_6:
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_semkey,4,2                     ## @semkey
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"waiter: semget"

	.comm	_SEM_UNDO,8,3                   ## @SEM_UNDO
L_.str.1:                               ## @.str.1
	.asciz	"waiter: semop -1"

L_.str.3:                               ## @.str.3
	.asciz	"waiter: semop +1"

L_str:                                  ## @str
	.asciz	"WOO!  GOT THE SEMAPHORE!"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_waiter                         ; -- Begin function waiter
	.p2align	2
_waiter:                                ; @waiter
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
Lloh0:
	adrp	x8, _semkey@GOTPAGE
Lloh1:
	ldr	x8, [x8, _semkey@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w1, #1
	mov	w2, #0
	bl	_semget
	mov	x19, x0
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	mov	w8, #-1
	str	w8, [sp, #8]
Lloh5:
	adrp	x20, _SEM_UNDO@GOTPAGE
Lloh6:
	ldr	x20, [x20, _SEM_UNDO@GOTPAGEOFF]
	ldr	x8, [x20]
	stp	x8, xzr, [sp, #16]
	mov	w21, #1
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_semop
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_4:
Lloh9:
	adrp	x0, l_str@PAGE
Lloh10:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #1
	bl	_sleep
	str	w21, [sp, #8]
	ldr	x8, [x20]
	stp	x8, xzr, [sp, #16]
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_semop
	cmn	w0, #1
	b.ne	LBB0_6
; %bb.5:
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_6:
	mov	w0, #0
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_semkey,4,2                     ; @semkey
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"waiter: semget"

	.comm	_SEM_UNDO,8,3                   ; @SEM_UNDO
l_.str.1:                               ; @.str.1
	.asciz	"waiter: semop -1"

l_.str.3:                               ; @.str.3
	.asciz	"waiter: semop +1"

l_str:                                  ; @str
	.asciz	"WOO!  GOT THE SEMAPHORE!"

.subsections_via_symbols
