	.file	"613729.c"
	.intel_syntax noprefix
	.text
	.globl	tcgetsid
	.type	tcgetsid, @function
tcgetsid:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR tiocgsid_does_not_work.0[rip]
	test	eax, eax
	jne	.L2
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -20[rbp], eax
	lea	rdx, -24[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 21545
	mov	edi, eax
	mov	eax, 0
	call	__ioctl@PLT
	test	eax, eax
	jns	.L3
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 22
	jne	.L4
	mov	DWORD PTR tiocgsid_does_not_work.0[rip], 1
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	mov	eax, 0
	call	__set_errno@PLT
	jmp	.L2
.L4:
	mov	eax, -1
	jmp	.L7
.L3:
	mov	eax, DWORD PTR -24[rbp]
	jmp	.L7
.L2:
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	tcgetpgrp@PLT
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], -1
	jne	.L8
	mov	eax, -1
	jmp	.L7
.L8:
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	getsid@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L9
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 3
	jne	.L9
	mov	edi, 25
	mov	eax, 0
	call	__set_errno@PLT
.L9:
	mov	eax, DWORD PTR -12[rbp]
.L7:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	tcgetsid, .-tcgetsid
	.local	tiocgsid_does_not_work.0
	.comm	tiocgsid_does_not_work.0,4,4
	.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	"613729.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	tcgetsid
	.syntax unified
	.arm
	.fpu softvfp
	.type	tcgetsid, %function
tcgetsid:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L11+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	str	r3, [fp, #-20]
	sub	r3, fp, #24
	mov	r2, r3
	ldr	r1, .L11+8
	ldr	r0, [fp, #-32]
	bl	__ioctl
	mov	r3, r0
	cmp	r3, #0
	bge	.L3
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #22
	bne	.L4
	ldr	r3, .L11+4
	mov	r2, #1
	str	r2, [r3]
	ldr	r0, [fp, #-20]
	bl	__set_errno
	b	.L2
.L4:
	mvn	r3, #0
	b	.L7
.L3:
	ldr	r3, [fp, #-24]
	b	.L7
.L2:
	ldr	r0, [fp, #-32]
	bl	tcgetpgrp
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L8
	mvn	r3, #0
	b	.L7
.L8:
	ldr	r0, [fp, #-16]
	bl	getsid
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L9
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #3
	bne	.L9
	mov	r0, #25
	bl	__set_errno
.L9:
	ldr	r3, [fp, #-12]
.L7:
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC0
	.word	tiocgsid_does_not_work.5115
	.word	21545
	.size	tcgetsid, .-tcgetsid
	.local	tiocgsid_does_not_work.5115
	.comm	tiocgsid_does_not_work.5115,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
