	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$2, %edi
	jg	LBB0_2
## %bb.1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_10
LBB0_2:
	movq	%rsi, %r14
	movq	_errno@GOTPCREL(%rip), %r15
	movq	$0, (%r15)
	movq	8(%rsi), %rdi
	callq	_getpwnam
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, %rbx
	movl	4(%rax), %edi
	callq	_setgid
	testq	%rax, %rax
	jne	LBB0_12
## %bb.4:
	movl	4(%rbx), %esi
	movl	8(%rbx), %edi
	callq	_initgroups
	testq	%rax, %rax
	jne	LBB0_13
## %bb.5:
	movl	(%rbx), %edi
	callq	_setuid
	testq	%rax, %rax
	jne	LBB0_14
## %bb.6:
	addq	$16, %r14
	movq	(%r14), %rdi
	movq	%r14, %rsi
	callq	_execvp
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	(%r14), %r14
	movq	(%r15), %rdi
	callq	_strerror
	leaq	L_.str.6(%rip), %rsi
	movl	%ebx, %edi
	movq	%r14, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_7:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_8:
	cmpq	$0, (%r15)
	jne	LBB0_15
## %bb.9:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r14), %rdx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_10:
	movq	_EX_CONFIG@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.3(%rip), %rdi
	callq	_perror
	jmp	LBB0_7
LBB0_13:
	leaq	L_.str.4(%rip), %rdi
	callq	_perror
	jmp	LBB0_7
LBB0_14:
	leaq	L_.str.5(%rip), %rdi
	callq	_perror
	jmp	LBB0_7
LBB0_15:
	leaq	L_.str.2(%rip), %rdi
	callq	_perror
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no command (usage: setuidgid user cmd args...)\n"

	.comm	_EX_CONFIG,4,2                  ## @EX_CONFIG
	.comm	_errno,8,3                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"unknown user:%s\n"

L_.str.2:                               ## @.str.2
	.asciz	"getpwnam"

	.comm	_EX_OSERR,4,2                   ## @EX_OSERR
L_.str.3:                               ## @.str.3
	.asciz	"setgid failed"

L_.str.4:                               ## @.str.4
	.asciz	"initgroups failed"

L_.str.5:                               ## @.str.5
	.asciz	"setuid failed"

L_.str.6:                               ## @.str.6
	.asciz	"execvp failed to launch file:%s:%s\n"

.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:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	cmp	w0, #2
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _stderr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_2:
	mov	x19, x1
Lloh5:
	adrp	x21, _errno@GOTPAGE
Lloh6:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	str	xzr, [x21]
	ldr	x0, [x1, #8]
	bl	_getpwnam
	cbz	x0, LBB0_8
; %bb.3:
	mov	x20, x0
	ldr	w0, [x0, #4]
	bl	_setgid
	cbnz	x0, LBB0_12
; %bb.4:
	ldp	w1, w0, [x20, #4]
	bl	_initgroups
	cbnz	x0, LBB0_13
; %bb.5:
	ldr	w0, [x20]
	bl	_setuid
	cbnz	x0, LBB0_14
; %bb.6:
	ldr	x0, [x19, #16]!
	mov	x1, x19
	bl	_execvp
Lloh7:
	adrp	x8, _stderr@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh9:
	ldr	w20, [x8]
	ldr	x19, [x19]
	ldr	x0, [x21]
	bl	_strerror
	stp	x19, x0, [sp]
Lloh10:
	adrp	x1, l_.str.6@PAGE
Lloh11:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_fprintf
LBB0_7:
Lloh12:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
	ldr	x8, [x21]
	cbnz	x8, LBB0_15
; %bb.9:
Lloh14:
	adrp	x8, _stderr@GOTPAGE
Lloh15:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	str	x8, [sp]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_10:
	bl	_fprintf
Lloh19:
	adrp	x8, _EX_CONFIG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EX_CONFIG@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_12:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_perror
	b	LBB0_7
LBB0_13:
Lloh23:
	adrp	x0, l_.str.4@PAGE
Lloh24:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_perror
	b	LBB0_7
LBB0_14:
Lloh25:
	adrp	x0, l_.str.5@PAGE
Lloh26:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_perror
	b	LBB0_7
LBB0_15:
Lloh27:
	adrp	x0, l_.str.2@PAGE
Lloh28:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_perror
	b	LBB0_7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no command (usage: setuidgid user cmd args...)\n"

	.comm	_EX_CONFIG,4,2                  ; @EX_CONFIG
	.comm	_errno,8,3                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"unknown user:%s\n"

l_.str.2:                               ; @.str.2
	.asciz	"getpwnam"

	.comm	_EX_OSERR,4,2                   ; @EX_OSERR
l_.str.3:                               ; @.str.3
	.asciz	"setgid failed"

l_.str.4:                               ; @.str.4
	.asciz	"initgroups failed"

l_.str.5:                               ; @.str.5
	.asciz	"setuid failed"

l_.str.6:                               ; @.str.6
	.asciz	"execvp failed to launch file:%s:%s\n"

.subsections_via_symbols
