	.file	"432485.c"
	.intel_syntax noprefix
	.text
	.data
	.align 32
	.type	id, @object
	.size	id, 55
id:
	.string	"@(#)$Id: t_setgid.c,v 1.6 2001/09/23 03:35:41 ca Exp $"
	.section	.rodata
	.align 8
.LC0:
	.string	"%s (should be %d/%d): r/egid=%d/%d\n"
	.text
	.type	printgids, @function
printgids:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -24
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	call	getegid@PLT
	mov	ebx, eax
	call	getgid@PLT
	mov	esi, eax
	mov	ecx, DWORD PTR -32[rbp]
	mov	edx, DWORD PTR -28[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	r9d, ebx
	mov	r8d, esi
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	printgids, .-printgids
	.section	.rodata
.LC1:
	.string	"initial gids"
	.align 8
.LC2:
	.string	"SETUP ERROR: re-run set-group-ID guest"
.LC3:
	.string	"failure"
.LC4:
	.string	"ok"
.LC5:
	.string	"setgid(%d)=%d %s\n"
.LC6:
	.string	"after setgid()"
.LC7:
	.string	"MAYDAY!  Wrong effective gid"
.LC8:
	.string	"MAYDAY!  Wrong real gid"
	.align 8
.LC9:
	.string	"MAYDAY!  setgid(0) succeeded (should have failed)"
	.align 8
.LC10:
	.string	"setgid(0) failed (this is correct)"
.LC11:
	.string	"after setgid(0)"
.LC12:
	.string	"setgid"
	.align 8
.LC13:
	.string	"\nThis system cannot use %s to set the real gid to the effective gid\nand clear the saved gid.\n"
	.align 8
.LC14:
	.string	"\nIt is possible to use setgid on this system"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -16[rbp], 0
	call	getgid@PLT
	mov	DWORD PTR -12[rbp], eax
	call	getegid@PLT
	mov	DWORD PTR -8[rbp], eax
	mov	edx, DWORD PTR -8[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printgids
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -12[rbp]
	jne	.L3
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	setgid@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L4
	lea	rax, .LC3[rip]
	jmp	.L5
.L4:
	lea	rax, .LC4[rip]
.L5:
	mov	esi, DWORD PTR -8[rbp]
	mov	edx, DWORD PTR -4[rbp]
	mov	rcx, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, DWORD PTR -8[rbp]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printgids
	call	getegid@PLT
	cmp	DWORD PTR -8[rbp], eax
	je	.L6
	add	DWORD PTR -16[rbp], 1
	lea	rdi, .LC7[rip]
	call	puts@PLT
.L6:
	call	getgid@PLT
	cmp	DWORD PTR -8[rbp], eax
	je	.L7
	add	DWORD PTR -16[rbp], 1
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L7:
	mov	edi, 0
	call	setgid@PLT
	test	eax, eax
	jne	.L8
	add	DWORD PTR -16[rbp], 1
	lea	rdi, .LC9[rip]
	call	puts@PLT
	jmp	.L9
.L8:
	lea	rdi, .LC10[rip]
	call	puts@PLT
.L9:
	mov	edx, DWORD PTR -8[rbp]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printgids
	call	getegid@PLT
	cmp	DWORD PTR -8[rbp], eax
	je	.L10
	add	DWORD PTR -16[rbp], 1
	lea	rdi, .LC7[rip]
	call	puts@PLT
.L10:
	call	getgid@PLT
	cmp	DWORD PTR -8[rbp], eax
	je	.L11
	add	DWORD PTR -16[rbp], 1
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L11:
	mov	edi, 10
	call	putchar@PLT
	cmp	DWORD PTR -16[rbp], 0
	jle	.L12
	lea	rsi, .LC12[rip]
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	lea	rdi, .LC14[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"432485.c"
	.text
	.data
	.align	2
	.type	id, %object
	.size	id, 55
id:
	.ascii	"@(#)$Id: t_setgid.c,v 1.6 2001/09/23 03:35:41 ca Ex"
	.ascii	"p $\000"
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%s (should be %d/%d): r/egid=%d/%d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	printgids, %function
printgids:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r4, [fp, #-28]
	ldr	r5, [fp, #-32]
	bl	getgid
	mov	r3, r0
	mov	r6, r3
	bl	getegid
	mov	r3, r0
	str	r3, [sp, #4]
	str	r6, [sp]
	mov	r3, r5
	mov	r2, r4
	ldr	r1, [fp, #-24]
	ldr	r0, .L2
	bl	printf
	nop
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.size	printgids, .-printgids
	.section	.rodata
	.align	2
.LC1:
	.ascii	"initial gids\000"
	.align	2
.LC2:
	.ascii	"SETUP ERROR: re-run set-group-ID guest\000"
	.align	2
.LC3:
	.ascii	"failure\000"
	.align	2
.LC4:
	.ascii	"ok\000"
	.align	2
.LC5:
	.ascii	"setgid(%d)=%d %s\012\000"
	.align	2
.LC6:
	.ascii	"after setgid()\000"
	.align	2
.LC7:
	.ascii	"MAYDAY!  Wrong effective gid\000"
	.align	2
.LC8:
	.ascii	"MAYDAY!  Wrong real gid\000"
	.align	2
.LC9:
	.ascii	"MAYDAY!  setgid(0) succeeded (should have failed)\000"
	.align	2
.LC10:
	.ascii	"setgid(0) failed (this is correct)\000"
	.align	2
.LC11:
	.ascii	"after setgid(0)\000"
	.align	2
.LC12:
	.ascii	"setgid\000"
	.align	2
.LC13:
	.ascii	"\012This system cannot use %s to set the real gid t"
	.ascii	"o the effective gid\012and clear the saved gid.\012"
	.ascii	"\000"
	.align	2
.LC14:
	.ascii	"\012It is possible to use setgid on this system\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-20]
	bl	getgid
	str	r0, [fp, #-16]
	bl	getegid
	str	r0, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-16]
	ldr	r0, .L15
	bl	printgids
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	bne	.L5
	ldr	r0, .L15+4
	bl	puts
	mov	r0, #1
	bl	exit
.L5:
	ldr	r0, [fp, #-12]
	bl	setgid
	str	r0, [fp, #-8]
	ldr	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L6
	ldr	r3, .L15+8
	b	.L7
.L6:
	ldr	r3, .L15+12
.L7:
	ldr	r2, [fp, #-8]
	ldr	r0, .L15+16
	bl	printf
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, .L15+20
	bl	printgids
	bl	getegid
	mov	r2, r0
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	beq	.L8
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r0, .L15+24
	bl	puts
.L8:
	bl	getgid
	mov	r2, r0
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	beq	.L9
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r0, .L15+28
	bl	puts
.L9:
	mov	r0, #0
	bl	setgid
	mov	r3, r0
	cmp	r3, #0
	bne	.L10
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r0, .L15+32
	bl	puts
	b	.L11
.L10:
	ldr	r0, .L15+36
	bl	puts
.L11:
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, .L15+40
	bl	printgids
	bl	getegid
	mov	r2, r0
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	beq	.L12
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r0, .L15+24
	bl	puts
.L12:
	bl	getgid
	mov	r2, r0
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	beq	.L13
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r0, .L15+28
	bl	puts
.L13:
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	ble	.L14
	ldr	r1, .L15+44
	ldr	r0, .L15+48
	bl	printf
	mov	r0, #1
	bl	exit
.L14:
	ldr	r0, .L15+52
	bl	puts
	mov	r0, #0
	bl	exit
.L16:
	.align	2
.L15:
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
