	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_fcntl                     ## -- Begin function test_fcntl
	.p2align	4, 0x90
_test_fcntl:                            ## @test_fcntl
	.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	$168, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PASSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -200(%rbp)                ## 4-byte Spill
	movq	_CAP_READ@GOTPCREL(%rip), %rcx
	movq	_CAP_FCNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	orl	(%rcx), %ebx
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_open
	movl	%eax, -196(%rbp)                ## 4-byte Spill
	movq	_PF_LOCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, -204(%rbp)                ## 4-byte Spill
	movq	_SHM_ANON@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$384, %edx                      ## imm = 0x180
	callq	_shm_open
	movl	%eax, %r13d
	xorl	%edi, %edi
	callq	_REQUIRE
	xorl	%edi, %edi
	callq	_REQUIRE
	xorl	%edi, %edi
	callq	_REQUIRE
	xorl	%edi, %edi
	movl	%ebx, %esi
	callq	_cap_new
	movl	%eax, %r12d
	xorl	%edi, %edi
	movl	%ebx, %esi
	callq	_cap_new
	movl	%eax, %r14d
	xorl	%edi, %edi
	movl	%ebx, %esi
	callq	_cap_new
	movl	%eax, %ebx
	xorl	%edi, %edi
	callq	_REQUIRE
	xorl	%edi, %edi
	callq	_REQUIRE
	xorl	%edi, %edi
	callq	_REQUIRE
	leaq	L_.str(%rip), %rax
	movq	%rax, -192(%rbp)
	movl	-196(%rbp), %eax                ## 4-byte Reload
	movl	%eax, -184(%rbp)
	movq	$0, -180(%rbp)
	leaq	L_.str.4(%rip), %rax
	movq	%rax, -168(%rbp)
	movl	%r12d, -160(%rbp)
	movq	$0, -156(%rbp)
	leaq	L_.str.2(%rip), %rax
	movq	%rax, -144(%rbp)
	movl	-204(%rbp), %eax                ## 4-byte Reload
	movl	%eax, -136(%rbp)
	movq	$0, -132(%rbp)
	leaq	L_.str.5(%rip), %rax
	movq	%rax, -120(%rbp)
	movl	%r14d, -112(%rbp)
	movq	$0, -108(%rbp)
	leaq	L_.str.3(%rip), %rax
	movq	%rax, -96(%rbp)
	movl	%r13d, -88(%rbp)
	movq	$0, -84(%rbp)
	leaq	L_.str.6(%rip), %rax
	movq	%rax, -72(%rbp)
	movl	%ebx, -64(%rbp)
	movq	$0, -60(%rbp)
	xorl	%eax, %eax
	callq	_cap_enter
	movl	%eax, %edi
	callq	_REQUIRE
	movq	_fcntl@GOTPCREL(%rip), %r12
	movl	$0, -196(%rbp)                  ## 4-byte Folded Spill
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_F_GETFL@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r12, %rdi
	movl	%ebx, %esi
	xorl	%ecx, %ecx
	callq	_CHECK_SYSCALL_SUCCEEDS
	movq	_CAP_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_cap_new
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_REQUIRE
	movl	(%r13), %esi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r13), %edx
	movq	%r12, %rdi
	movl	%r14d, %esi
	xorl	%ecx, %ecx
	callq	_CHECK_NOTCAPABLE
	cmpq	$120, %r15
	jne	LBB0_7
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.7(%rip), %rdi
	movl	-196(%rbp), %esi                ## 4-byte Reload
	callq	_FAIL
	cmpq	$120, %r15
	je	LBB0_3
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	-156(%rbp,%r15), %ebx
	movl	-152(%rbp,%r15), %eax
	movl	%eax, -196(%rbp)                ## 4-byte Spill
	addq	$24, %r15
	movq	_fcntl@GOTPCREL(%rip), %r12
	jmp	LBB0_1
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.4:
	movl	-200(%rbp), %eax                ## 4-byte Reload
	addq	$168, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PASSED,4,2                     ## @PASSED
	.comm	_CAP_READ,4,2                   ## @CAP_READ
	.comm	_CAP_FCNTL,4,2                  ## @CAP_FCNTL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"file"

L_.str.1:                               ## @.str.1
	.asciz	"/etc/passwd"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
L_.str.2:                               ## @.str.2
	.asciz	"socket"

	.comm	_PF_LOCAL,4,2                   ## @PF_LOCAL
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
L_.str.3:                               ## @.str.3
	.asciz	"SHM"

	.comm	_SHM_ANON,4,2                   ## @SHM_ANON
	.comm	_O_RDWR,4,2                     ## @O_RDWR
L_.str.4:                               ## @.str.4
	.asciz	"file cap"

L_.str.5:                               ## @.str.5
	.asciz	"socket cap"

L_.str.6:                               ## @.str.6
	.asciz	"SHM cap"

	.comm	_F_GETFL,4,2                    ## @F_GETFL
L_.str.7:                               ## @.str.7
	.asciz	"Error calling fcntl('%s', F_GETFL)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_fcntl                     ; -- Begin function test_fcntl
	.p2align	2
_test_fcntl:                            ; @test_fcntl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #256
	.cfi_def_cfa_offset 256
	stp	x28, x27, [sp, #160]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #176]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #192]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #208]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #224]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #240]            ; 16-byte Folded Spill
	add	x29, sp, #240
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _PASSED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PASSED@GOTPAGEOFF]
	stur	x8, [x29, #-96]
Lloh5:
	ldr	w19, [x9]
Lloh6:
	adrp	x26, _CAP_READ@GOTPAGE
Lloh7:
	ldr	x26, [x26, _CAP_READ@GOTPAGEOFF]
Lloh8:
	adrp	x8, _CAP_FCNTL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CAP_FCNTL@GOTPAGEOFF]
	ldr	w9, [x26]
Lloh10:
	ldr	w8, [x8]
	orr	w23, w8, w9
Lloh11:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_open
	mov	x20, x0
Lloh16:
	adrp	x8, _PF_LOCAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PF_LOCAL@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
Lloh19:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	mov	x21, x0
Lloh22:
	adrp	x8, _SHM_ANON@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SHM_ANON@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	w2, #384
	bl	_shm_open
	mov	x22, x0
	mov	w0, #0
	bl	_REQUIRE
	mov	w0, #0
	bl	_REQUIRE
	mov	w0, #0
	bl	_REQUIRE
	mov	w0, #0
	mov	x1, x23
	bl	_cap_new
	mov	x24, x0
	mov	w0, #0
	mov	x1, x23
	bl	_cap_new
	mov	x25, x0
	mov	w0, #0
	mov	x1, x23
	bl	_cap_new
	mov	x23, x0
	mov	w0, #0
	bl	_REQUIRE
	mov	w0, #0
	bl	_REQUIRE
	mov	w0, #0
	bl	_REQUIRE
Lloh28:
	adrp	x8, l_.str@PAGE
Lloh29:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [sp]
	str	w20, [sp, #8]
	movi.2d	v0, #0000000000000000
Lloh30:
	adrp	x8, l_.str.4@PAGE
Lloh31:
	add	x8, x8, l_.str.4@PAGEOFF
	stur	d0, [sp, #12]
	str	x8, [sp, #24]
	str	w24, [sp, #32]
	stur	d0, [sp, #36]
Lloh32:
	adrp	x8, l_.str.2@PAGE
Lloh33:
	add	x8, x8, l_.str.2@PAGEOFF
	str	x8, [sp, #48]
	str	w21, [sp, #56]
	stur	d0, [sp, #60]
Lloh34:
	adrp	x8, l_.str.5@PAGE
Lloh35:
	add	x8, x8, l_.str.5@PAGEOFF
	str	x8, [sp, #72]
	str	w25, [sp, #80]
	stur	d0, [sp, #84]
Lloh36:
	adrp	x8, l_.str.3@PAGE
Lloh37:
	add	x8, x8, l_.str.3@PAGEOFF
	str	x8, [sp, #96]
	str	w22, [sp, #104]
	stur	d0, [sp, #108]
Lloh38:
	adrp	x8, l_.str.6@PAGE
Lloh39:
	add	x8, x8, l_.str.6@PAGEOFF
	str	x8, [sp, #120]
	str	w23, [sp, #128]
	stur	d0, [sp, #132]
	bl	_cap_enter
	bl	_REQUIRE
	mov	x25, #0
	mov	w22, #0
	mov	w23, #0
Lloh40:
	adrp	x27, _F_GETFL@GOTPAGE
Lloh41:
	ldr	x27, [x27, _F_GETFL@GOTPAGEOFF]
Lloh42:
	adrp	x20, _fcntl@GOTPAGE
Lloh43:
	ldr	x20, [x20, _fcntl@GOTPAGEOFF]
	mov	x28, sp
Lloh44:
	adrp	x21, l_.str.7@PAGE
Lloh45:
	add	x21, x21, l_.str.7@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x27]
	mov	x0, x20
	mov	x1, x23
	mov	w3, #0
	bl	_CHECK_SYSCALL_SUCCEEDS
	ldr	w1, [x26]
	mov	x0, x23
	bl	_cap_new
	mov	x24, x0
	bl	_REQUIRE
	ldr	w1, [x27]
	mov	x0, x23
	mov	w2, #0
	bl	_fcntl
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w2, [x27]
	mov	x0, x20
	mov	x1, x24
	mov	w3, #0
	bl	_CHECK_NOTCAPABLE
	cmp	x25, #120
	b.ne	LBB0_4
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_FAIL
	cmp	x25, #120
	b.eq	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	add	x8, x28, x25
	ldp	w23, w22, [x8, #36]
	add	x25, x25, #24
	b	LBB0_1
LBB0_5:
	ldur	x8, [x29, #-96]
Lloh46:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh47:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh48:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x19
	ldp	x29, x30, [sp, #240]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #224]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #208]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #192]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #176]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #160]            ; 16-byte Folded Reload
	add	sp, sp, #256
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_PASSED,4,2                     ; @PASSED
	.comm	_CAP_READ,4,2                   ; @CAP_READ
	.comm	_CAP_FCNTL,4,2                  ; @CAP_FCNTL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"file"

l_.str.1:                               ; @.str.1
	.asciz	"/etc/passwd"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
l_.str.2:                               ; @.str.2
	.asciz	"socket"

	.comm	_PF_LOCAL,4,2                   ; @PF_LOCAL
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
l_.str.3:                               ; @.str.3
	.asciz	"SHM"

	.comm	_SHM_ANON,4,2                   ; @SHM_ANON
	.comm	_O_RDWR,4,2                     ; @O_RDWR
l_.str.4:                               ; @.str.4
	.asciz	"file cap"

l_.str.5:                               ; @.str.5
	.asciz	"socket cap"

l_.str.6:                               ; @.str.6
	.asciz	"SHM cap"

	.comm	_F_GETFL,4,2                    ; @F_GETFL
l_.str.7:                               ; @.str.7
	.asciz	"Error calling fcntl('%s', F_GETFL)"

.subsections_via_symbols
