	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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, %r15
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdx
	callq	_getopt
	xorl	%r12d, %r12d
	cmpl	$-1, %eax
	jne	LBB0_1
LBB0_8:
	movq	_optind@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$8192, %edi                     ## imm = 0x2000
	callq	_malloc
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_10:
	xorl	%eax, %eax
	callq	_caph_limit_stdin
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	callq	_caph_limit_stderr
	cmpl	$-1, %eax
	jne	LBB0_13
LBB0_12:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_err
LBB0_13:
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_add
	movq	(%r15,%rbx,8), %rdi
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	testq	%rdi, %rdi
	jne	LBB0_14
LBB0_21:
	xorl	%eax, %eax
	callq	_caph_enter
	testq	%rax, %rax
	jns	LBB0_23
## %bb.22:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	callq	_err
	.p2align	4, 0x90
LBB0_23:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_33 Depth 2
                                        ##       Child Loop BB0_29 Depth 3
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_read
	movl	%eax, %r13d
	testl	%eax, %eax
	jle	LBB0_24
## %bb.27:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	_head@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	jmp	LBB0_33
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_33 Depth=2
	movq	(%r15), %rsi
	leaq	L_.str.4(%rip), %rdi
	callq	_warn
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_32:                                ##   in Loop: Header=BB0_33 Depth=2
	movq	16(%r15), %r15
LBB0_33:                                ##   Parent Loop BB0_23 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_29 Depth 3
	testq	%r15, %r15
	je	LBB0_23
## %bb.28:                              ##   in Loop: Header=BB0_33 Depth=2
	movl	%r13d, %ebx
	movq	%r14, %r12
	.p2align	4, 0x90
LBB0_29:                                ##   Parent Loop BB0_23 Depth=1
                                        ##     Parent Loop BB0_33 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	8(%r15), %edi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_write
	cmpl	$-1, %eax
	je	LBB0_30
## %bb.31:                              ##   in Loop: Header=BB0_29 Depth=3
	movslq	%eax, %rcx
	addq	%rcx, %r12
	subl	%eax, %ebx
	jne	LBB0_29
	jmp	LBB0_32
LBB0_24:
	testl	%r13d, %r13d
	jns	LBB0_26
## %bb.25:
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_26:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_exit
LBB0_1:
	leaq	L_.str(%rip), %r14
	movq	_SIG_IGN@GOTPCREL(%rip), %r13
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_usage
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_getopt
	cmpl	$-1, %eax
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpb	$97, %al
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movsbl	%al, %eax
	cmpl	$105, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_SIGINT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r13), %esi
	callq	_signal
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %r12d
	jmp	LBB0_7
LBB0_14:
	leaq	(%r15,%rbx,8), %rbx
	addq	$8, %rbx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	_O_APPEND@GOTPCREL(%rip), %r13
	movq	_DEFFILEMODE@GOTPCREL(%rip), %r15
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=1
	orl	(%rax), %esi
	movl	(%r15), %edx
	callq	_open
	movq	-8(%rbx), %rsi
	testl	%eax, %eax
	js	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	%eax, %edi
	callq	_add
LBB0_20:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	(%rbx), %rdi
	addq	$8, %rbx
	testq	%rdi, %rdi
	je	LBB0_21
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r13, %rax
	testl	%r12d, %r12d
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	_O_TRUNC@GOTPCREL(%rip), %rax
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_15 Depth=1
	leaq	L_.str.4(%rip), %rdi
	callq	_warn
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ai"

	.comm	_SIGINT,4,2                     ## @SIGINT
	.comm	_SIG_IGN,4,2                    ## @SIG_IGN
	.comm	_optind,8,3                     ## @optind
L_.str.1:                               ## @.str.1
	.asciz	"malloc"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
L_.str.2:                               ## @.str.2
	.asciz	"unable to limit stdio"

	.comm	_STDOUT_FILENO,4,2              ## @STDOUT_FILENO
L_.str.3:                               ## @.str.3
	.asciz	"stdout"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_APPEND,4,2                   ## @O_APPEND
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.comm	_DEFFILEMODE,4,2                ## @DEFFILEMODE
L_.str.4:                               ## @.str.4
	.asciz	"%s"

L_.str.5:                               ## @.str.5
	.asciz	"unable to enter capability mode"

	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
	.comm	_head,8,3                       ## @head
L_.str.6:                               ## @.str.6
	.asciz	"read"

	.comm	_BSIZE,4,2                      ## @BSIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	bl	_getopt
	cmn	w0, #1
	b.ne	LBB0_9
; %bb.1:
	mov	w22, #0
LBB0_2:
Lloh2:
	adrp	x8, _optind@GOTPAGE
Lloh3:
	ldr	x8, [x8, _optind@GOTPAGEOFF]
Lloh4:
	ldr	x23, [x8]
	mov	w0, #8192
	bl	_malloc
	mov	x19, x0
	cbnz	x0, LBB0_4
; %bb.3:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_4:
	bl	_caph_limit_stdin
Lloh7:
	adrp	x20, _EXIT_FAILURE@GOTPAGE
Lloh8:
	ldr	x20, [x20, _EXIT_FAILURE@GOTPAGEOFF]
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.5:
	bl	_caph_limit_stderr
	cmn	w0, #1
	b.ne	LBB0_7
LBB0_6:
	ldr	w0, [x20]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_err
LBB0_7:
Lloh11:
	adrp	x8, _STDOUT_FILENO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _STDOUT_FILENO@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_add
	ldr	x0, [x21, x23, lsl #3]
	cbnz	x0, LBB0_16
; %bb.8:
	mov	w20, #0
	b	LBB0_20
LBB0_9:
	mov	w22, #0
Lloh16:
	adrp	x23, _SIGINT@GOTPAGE
Lloh17:
	ldr	x23, [x23, _SIGINT@GOTPAGEOFF]
Lloh18:
	adrp	x24, _SIG_IGN@GOTPAGE
Lloh19:
	ldr	x24, [x24, _SIG_IGN@GOTPAGEOFF]
Lloh20:
	adrp	x20, l_.str@PAGE
Lloh21:
	add	x20, x20, l_.str@PAGEOFF
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	bl	_usage
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_getopt
	cmn	w0, #1
	b.eq	LBB0_2
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	and	w8, w0, #0xff
	cmp	w8, #97
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	sxtb	w8, w0
	cmp	w8, #105
	b.ne	LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w0, [x23]
	ldr	w1, [x24]
	bl	_signal
	b	LBB0_11
LBB0_15:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w22, #1
	b	LBB0_11
LBB0_16:
	mov	w20, #0
	add	x8, x21, x23, lsl #3
	add	x24, x8, #8
Lloh22:
	adrp	x25, _O_WRONLY@GOTPAGE
Lloh23:
	ldr	x25, [x25, _O_WRONLY@GOTPAGEOFF]
Lloh24:
	adrp	x26, _O_CREAT@GOTPAGE
Lloh25:
	ldr	x26, [x26, _O_CREAT@GOTPAGEOFF]
Lloh26:
	adrp	x27, _O_TRUNC@GOTPAGE
Lloh27:
	ldr	x27, [x27, _O_TRUNC@GOTPAGEOFF]
Lloh28:
	adrp	x28, _O_APPEND@GOTPAGE
Lloh29:
	ldr	x28, [x28, _O_APPEND@GOTPAGEOFF]
Lloh30:
	adrp	x23, _DEFFILEMODE@GOTPAGE
Lloh31:
	ldr	x23, [x23, _DEFFILEMODE@GOTPAGEOFF]
Lloh32:
	adrp	x21, l_.str.4@PAGE
Lloh33:
	add	x21, x21, l_.str.4@PAGEOFF
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	bl	_add
	ldr	x0, [x24], #8
	cbz	x0, LBB0_20
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w8, w9, w8
	cmp	w22, #0
	csel	x9, x27, x28, eq
	ldr	w9, [x9]
	orr	w1, w8, w9
	ldr	w2, [x23]
	bl	_open
	ldur	x1, [x24, #-8]
	tbz	w0, #31, LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	x0, x21
	bl	_warn
	mov	w20, #1
	ldr	x0, [x24], #8
	cbnz	x0, LBB0_18
LBB0_20:
	bl	_caph_enter
	tbz	x0, #63, LBB0_22
; %bb.21:
Lloh34:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
Lloh37:
	adrp	x1, l_.str.5@PAGE
Lloh38:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_err
LBB0_22:
Lloh39:
	adrp	x25, _STDIN_FILENO@GOTPAGE
Lloh40:
	ldr	x25, [x25, _STDIN_FILENO@GOTPAGEOFF]
	ldr	w0, [x25]
	mov	x1, x19
	mov	w2, #8192
	bl	_read
	mov	x21, x0
	cmp	w0, #1
	b.lt	LBB0_31
; %bb.23:
Lloh41:
	adrp	x26, _head@GOTPAGE
Lloh42:
	ldr	x26, [x26, _head@GOTPAGEOFF]
Lloh43:
	adrp	x22, l_.str.4@PAGE
Lloh44:
	add	x22, x22, l_.str.4@PAGEOFF
	b	LBB0_25
LBB0_24:                                ;   in Loop: Header=BB0_25 Depth=1
	ldr	w0, [x25]
	mov	x1, x19
	mov	w2, #8192
	bl	_read
	mov	x21, x0
	cmp	w0, #1
	b.lt	LBB0_31
LBB0_25:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_28 Depth 2
                                        ;       Child Loop BB0_29 Depth 3
	ldr	x27, [x26]
	cbnz	x27, LBB0_28
	b	LBB0_24
LBB0_26:                                ;   in Loop: Header=BB0_28 Depth=2
	ldr	x1, [x27]
	mov	x0, x22
	bl	_warn
	mov	w20, #1
LBB0_27:                                ;   in Loop: Header=BB0_28 Depth=2
	ldr	x27, [x27, #16]
	cbz	x27, LBB0_24
LBB0_28:                                ;   Parent Loop BB0_25 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_29 Depth 3
	mov	x23, x21
	mov	x24, x19
LBB0_29:                                ;   Parent Loop BB0_25 Depth=1
                                        ;     Parent Loop BB0_28 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w0, [x27, #8]
	mov	x1, x24
	mov	x2, x23
	bl	_write
	cmn	w0, #1
	b.eq	LBB0_26
; %bb.30:                               ;   in Loop: Header=BB0_29 Depth=3
	add	x24, x24, w0, sxtw
	subs	w23, w23, w0
	b.ne	LBB0_29
	b	LBB0_27
LBB0_31:
	tbz	w21, #31, LBB0_33
; %bb.32:
Lloh45:
	adrp	x1, l_.str.6@PAGE
Lloh46:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_33:
	mov	x0, x20
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpAdd	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ai"

	.comm	_SIGINT,4,2                     ; @SIGINT
	.comm	_SIG_IGN,4,2                    ; @SIG_IGN
	.comm	_optind,8,3                     ; @optind
l_.str.1:                               ; @.str.1
	.asciz	"malloc"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
l_.str.2:                               ; @.str.2
	.asciz	"unable to limit stdio"

	.comm	_STDOUT_FILENO,4,2              ; @STDOUT_FILENO
l_.str.3:                               ; @.str.3
	.asciz	"stdout"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_APPEND,4,2                   ; @O_APPEND
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.comm	_DEFFILEMODE,4,2                ; @DEFFILEMODE
l_.str.4:                               ; @.str.4
	.asciz	"%s"

l_.str.5:                               ; @.str.5
	.asciz	"unable to enter capability mode"

	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
	.comm	_head,8,3                       ; @head
l_.str.6:                               ; @.str.6
	.asciz	"read"

	.comm	_BSIZE,4,2                      ; @BSIZE
.subsections_via_symbols
