	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setoptionbyindex
_setoptionbyindex:                      ## @setoptionbyindex
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	_optval@GOTPCREL(%rip), %r15
	movslq	%edi, %r14
	testl	%esi, %esi
	jne	LBB0_7
## %bb.1:
	leaq	(,%r14,8), %rax
	addq	(%r15), %rax
	cmpq	_privileged@GOTPCREL(%rip), %rax
	jne	LBB0_7
## %bb.2:
	movq	_privileged@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.3:
	xorl	%eax, %eax
	callq	_getgid
	movl	%eax, %edi
	callq	_setgid
	cmpl	$-1, %eax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_error
LBB0_5:
	xorl	%eax, %eax
	callq	_getuid
	movl	%eax, %edi
	callq	_setuid
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_error
LBB0_7:
	movslq	%ebx, %rcx
	movq	(%r15), %rax
	movq	%rcx, (%rax,%r14,8)
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.8:
	leaq	(%rax,%r14,8), %rax
	cmpq	_Vflag@GOTPCREL(%rip), %rax
	je	LBB0_9
## %bb.10:
	cmpq	_Eflag@GOTPCREL(%rip), %rax
	jne	LBB0_13
## %bb.11:
	movq	_Vflag@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_9:
	movq	_Eflag@GOTPCREL(%rip), %rax
LBB0_12:
	movq	$0, (%rax)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_optval,8,3                     ## @optval
	.comm	_privileged,8,3                 ## @privileged
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setgid"

L_.str.1:                               ## @.str.1
	.asciz	"setuid"

	.comm	_Vflag,8,3                      ## @Vflag
	.comm	_Eflag,8,3                      ## @Eflag
	.no_dead_strip	_setoptionbyindex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setoptionbyindex
_setoptionbyindex:                      ; @setoptionbyindex
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x20, _optval@GOTPAGE
Lloh1:
	ldr	x20, [x20, _optval@GOTPAGEOFF]
	sxtw	x21, w0
	cbnz	w1, LBB0_6
; %bb.1:
	ldr	x8, [x20]
	add	x8, x8, w0, sxtw #3
Lloh2:
	adrp	x9, _privileged@GOTPAGE
Lloh3:
	ldr	x9, [x9, _privileged@GOTPAGEOFF]
	ldr	x10, [x9]
	cmp	x8, x9
	ccmp	x10, #0, #4, eq
	b.eq	LBB0_6
; %bb.2:
	bl	_getgid
	bl	_setgid
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_4:
	bl	_getuid
	bl	_setuid
	cmn	w0, #1
	b.ne	LBB0_6
; %bb.5:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
LBB0_6:
	sxtw	x8, w19
	ldr	x9, [x20]
	add	x9, x9, x21, lsl #3
	str	x8, [x9]
	cbz	w19, LBB0_11
; %bb.7:
Lloh8:
	adrp	x8, _Eflag@GOTPAGE
Lloh9:
	ldr	x8, [x8, _Eflag@GOTPAGEOFF]
Lloh10:
	adrp	x10, _Vflag@GOTPAGE
Lloh11:
	ldr	x10, [x10, _Vflag@GOTPAGEOFF]
	cmp	x9, x10
	b.eq	LBB0_10
; %bb.8:
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.9:
Lloh12:
	adrp	x8, _Vflag@GOTPAGE
Lloh13:
	ldr	x8, [x8, _Vflag@GOTPAGEOFF]
LBB0_10:
	str	xzr, [x8]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_optval,8,3                     ; @optval
	.comm	_privileged,8,3                 ; @privileged
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setgid"

l_.str.1:                               ; @.str.1
	.asciz	"setuid"

	.comm	_Vflag,8,3                      ; @Vflag
	.comm	_Eflag,8,3                      ; @Eflag
	.no_dead_strip	_setoptionbyindex
.subsections_via_symbols
