	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_event_loop                     ## -- Begin function event_loop
	.p2align	4, 0x90
_event_loop:                            ## @event_loop
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	-52(%rbp), %r14
	movq	%r14, %rdi
	callq	_FD_ZERO
	movq	_apmctl_fd@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	%r14, %rsi
	callq	_FD_SET
	movl	(%rbx), %ebx
	movq	_signal_fd@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_FD_SET
	movq	(%r15), %rax
	movl	(%rax), %r13d
	cmpl	%r13d, %ebx
	cmovgl	%ebx, %r13d
	xorl	%eax, %eax
	testl	%r13d, %r13d
	cmovlel	%eax, %r13d
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movq	_enque_signal@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	leaq	-60(%rbp), %rdi
	callq	_sigfillset
	movq	_SA_RESTART@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	_SIGHUP@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_sigaction
	movq	_SIGCHLD@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_sigaction
	movq	_SIGTERM@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_sigaction
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_sigemptyset
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sigaddset
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_sigaddset
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_sigaddset
	movq	_SIG_SETMASK@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_sigprocmask
	incl	%r13d
	leaq	-68(%rbp), %r14
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_check_battery
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_BATT_CHK_INTV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movq	$0, -88(%rbp)
	movq	%r14, %rdi
	leaq	-52(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	movl	(%r12), %edi
	leaq	-48(%rbp), %rsi
	xorl	%edx, %edx
	callq	_sigprocmask
	movl	%r13d, %edi
	movq	%r14, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	leaq	-88(%rbp), %r8
	callq	_select
	testl	%eax, %eax
	js	LBB0_2
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, %r15d
	movl	(%r12), %edi
	leaq	-44(%rbp), %rsi
	xorl	%edx, %edx
	callq	_sigprocmask
	testl	%r15d, %r15d
	movq	_signal_fd@GOTPCREL(%rip), %rbx
	jne	LBB0_5
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINTR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$1, %edi
	leaq	L_.str(%rip), %rsi
	callq	_err
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r12), %edi
	leaq	-44(%rbp), %rsi
	xorl	%edx, %edx
	callq	_sigprocmask
	movq	_signal_fd@GOTPCREL(%rip), %rbx
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rbx), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_FD_ISSET
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_proc_signal
	testq	%rax, %rax
	js	LBB0_11
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_apmctl_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_FD_ISSET
	testq	%rax, %rax
	je	LBB0_1
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_apmctl_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_proc_apmevent
	jmp	LBB0_1
LBB0_11:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_apmctl_fd,4,2                  ## @apmctl_fd
	.comm	_signal_fd,8,3                  ## @signal_fd
	.comm	_enque_signal,4,2               ## @enque_signal
	.comm	_SA_RESTART,4,2                 ## @SA_RESTART
	.comm	_SIGHUP,4,2                     ## @SIGHUP
	.comm	_SIGCHLD,4,2                    ## @SIGCHLD
	.comm	_SIGTERM,4,2                    ## @SIGTERM
	.comm	_SIG_SETMASK,4,2                ## @SIG_SETMASK
	.comm	_BATT_CHK_INTV,4,2              ## @BATT_CHK_INTV
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"select"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_event_loop                     ; -- Begin function event_loop
	.p2align	2
_event_loop:                            ; @event_loop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	add	x0, sp, #28
	bl	_FD_ZERO
Lloh0:
	adrp	x22, _apmctl_fd@GOTPAGE
Lloh1:
	ldr	x22, [x22, _apmctl_fd@GOTPAGEOFF]
	ldr	w0, [x22]
	add	x1, sp, #28
	bl	_FD_SET
	ldr	w19, [x22]
Lloh2:
	adrp	x23, _signal_fd@GOTPAGE
Lloh3:
	ldr	x23, [x23, _signal_fd@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	w0, [x8]
	add	x1, sp, #28
	bl	_FD_SET
	ldr	x8, [x23]
	ldr	w8, [x8]
	cmp	w19, w8
	csel	w8, w19, w8, gt
	cmp	w8, #0
	csel	w19, w8, wzr, gt
	add	x20, sp, #32
	add	x0, sp, #32
	mov	w1, #0
	mov	w2, #12
	bl	_memset
Lloh4:
	adrp	x8, _enque_signal@GOTPAGE
Lloh5:
	ldr	x8, [x8, _enque_signal@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	orr	x0, x20, #0x4
	bl	_sigfillset
Lloh7:
	adrp	x8, _SA_RESTART@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SA_RESTART@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [sp, #32]
Lloh10:
	adrp	x20, _SIGHUP@GOTPAGE
Lloh11:
	ldr	x20, [x20, _SIGHUP@GOTPAGEOFF]
	ldr	w0, [x20]
	add	x1, sp, #32
	mov	x2, #0
	bl	_sigaction
Lloh12:
	adrp	x21, _SIGCHLD@GOTPAGE
Lloh13:
	ldr	x21, [x21, _SIGCHLD@GOTPAGEOFF]
	ldr	w0, [x21]
	add	x1, sp, #32
	mov	x2, #0
	bl	_sigaction
Lloh14:
	adrp	x24, _SIGTERM@GOTPAGE
Lloh15:
	ldr	x24, [x24, _SIGTERM@GOTPAGEOFF]
	ldr	w0, [x24]
	add	x1, sp, #32
	mov	x2, #0
	bl	_sigaction
	add	x0, sp, #24
	bl	_sigemptyset
	ldr	w1, [x20]
	add	x0, sp, #24
	bl	_sigaddset
	ldr	w1, [x21]
	add	x0, sp, #24
	bl	_sigaddset
	ldr	w1, [x24]
	add	x0, sp, #24
	bl	_sigaddset
Lloh16:
	adrp	x24, _SIG_SETMASK@GOTPAGE
Lloh17:
	ldr	x24, [x24, _SIG_SETMASK@GOTPAGEOFF]
	ldr	w0, [x24]
	add	x1, sp, #24
	add	x2, sp, #20
	bl	_sigprocmask
	add	w19, w19, #1
Lloh18:
	adrp	x25, _BATT_CHK_INTV@GOTPAGE
Lloh19:
	ldr	x25, [x25, _BATT_CHK_INTV@GOTPAGEOFF]
Lloh20:
	adrp	x26, _errno@GOTPAGE
Lloh21:
	ldr	x26, [x26, _errno@GOTPAGEOFF]
Lloh22:
	adrp	x27, _EINTR@GOTPAGE
Lloh23:
	ldr	x27, [x27, _EINTR@GOTPAGEOFF]
Lloh24:
	adrp	x20, l_.str@PAGE
Lloh25:
	add	x20, x20, l_.str@PAGEOFF
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	bl	_check_battery
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	str	w8, [sp, #8]
	str	xzr, [sp]
	add	x0, sp, #16
	add	x1, sp, #28
	mov	w2, #4
	bl	_memcpy
	ldr	w0, [x24]
	add	x1, sp, #20
	mov	x2, #0
	bl	_sigprocmask
	add	x1, sp, #16
	mov	x4, sp
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	bl	_select
	tbnz	w0, #31, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x21, x0
	ldr	w0, [x24]
	add	x1, sp, #24
	mov	x2, #0
	bl	_sigprocmask
	cbnz	w21, LBB0_7
	b	LBB0_1
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x26]
	ldr	x9, [x27]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
	mov	x1, x20
	bl	_err
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x24]
	add	x1, sp, #24
	mov	x2, #0
	bl	_sigprocmask
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x23]
	ldr	w0, [x8]
	add	x1, sp, #16
	bl	_FD_ISSET
	cbz	x0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x23]
	ldr	w0, [x8]
	bl	_proc_signal
	tbnz	x0, #63, LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x22]
	add	x1, sp, #16
	bl	_FD_ISSET
	cbz	x0, LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x22]
	bl	_proc_apmevent
	b	LBB0_2
LBB0_11:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_apmctl_fd,4,2                  ; @apmctl_fd
	.comm	_signal_fd,8,3                  ; @signal_fd
	.comm	_enque_signal,4,2               ; @enque_signal
	.comm	_SA_RESTART,4,2                 ; @SA_RESTART
	.comm	_SIGHUP,4,2                     ; @SIGHUP
	.comm	_SIGCHLD,4,2                    ; @SIGCHLD
	.comm	_SIGTERM,4,2                    ; @SIGTERM
	.comm	_SIG_SETMASK,4,2                ; @SIG_SETMASK
	.comm	_BATT_CHK_INTV,4,2              ; @BATT_CHK_INTV
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"select"

.subsections_via_symbols
