	.file	"783712.c"
	.intel_syntax noprefix
	.text
	.globl	full_mask
	.bss
	.align 32
	.type	full_mask, @object
	.size	full_mask, 128
full_mask:
	.zero	128
	.globl	timeout
	.section	.rodata
	.align 16
	.type	timeout, @object
	.size	timeout, 16
timeout:
	.quad	0
	.quad	10000000
	.globl	info
	.bss
	.align 32
	.type	info, @object
	.size	info, 128
info:
	.zero	128
	.section	.rodata
.LC0:
	.string	"the_stack_data/783712.c"
.LC1:
	.string	"read_res != 0"
.LC2:
	.string	"Resource %d acquired\n"
	.text
	.globl	resource_acquire
	.type	resource_acquire, @function
resource_acquire:
.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, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	jmp	.L2
.L4:
	lea	rdx, timeout[rip]
	lea	rsi, info[rip]
	lea	rdi, full_mask[rip]
	call	sigtimedwait@PLT
	test	eax, eax
	js	.L2
	mov	eax, -1
	jmp	.L6
.L2:
	lea	rax, -13[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	js	.L4
	cmp	DWORD PTR -12[rbp], 0
	jne	.L5
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 24
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	__assert_fail@PLT
.L5:
	movzx	eax, BYTE PTR -13[rbp]
	movsx	eax, al
	mov	edx, eax
	lea	rsi, .LC2[rip]
	mov	edi, 2
	mov	eax, 0
	call	dprintf@PLT
	movzx	eax, BYTE PTR -13[rbp]
	movsx	eax, al
.L6:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	resource_acquire, .-resource_acquire
	.section	.rodata
.LC3:
	.string	"Resource %d released\n"
	.text
	.globl	resource_release
	.type	resource_release, @function
resource_release:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, eax
	lea	rsi, .LC3[rip]
	mov	edi, 2
	mov	eax, 0
	call	dprintf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	resource_release, .-resource_release
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	esi, 3
	mov	edi, 0
	mov	eax, 0
	call	fcntl@PLT
	or	ah, 8
	mov	edx, eax
	mov	esi, 4
	mov	edi, 0
	mov	eax, 0
	call	fcntl@PLT
	lea	rdi, full_mask[rip]
	call	sigfillset@PLT
	mov	edx, 0
	lea	rsi, full_mask[rip]
	mov	edi, 0
	call	sigprocmask@PLT
	jmp	.L10
.L13:
	mov	eax, 0
	call	resource_acquire
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	js	.L15
	mov	edi, 1
	call	sleep@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	resource_release
.L10:
	lea	rdx, timeout[rip]
	lea	rsi, info[rip]
	lea	rdi, full_mask[rip]
	call	sigtimedwait@PLT
	test	eax, eax
	js	.L13
	jmp	.L12
.L15:
	nop
.L12:
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.section	.rodata
	.align 16
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 17
__PRETTY_FUNCTION__.0:
	.string	"resource_acquire"
	.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	"783712.c"
	.text
	.comm	full_mask,128,4
	.global	timeout
	.section	.rodata
	.align	2
	.type	timeout, %object
	.size	timeout, 8
timeout:
	.word	0
	.word	10000000
	.comm	info,128,4
	.align	2
.LC0:
	.ascii	"the_stack_data/783712.c\000"
	.align	2
.LC1:
	.ascii	"read_res != 0\000"
	.align	2
.LC2:
	.ascii	"Resource %d acquired\012\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	resource_acquire
	.syntax unified
	.arm
	.fpu softvfp
	.type	resource_acquire, %function
resource_acquire:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	b	.L2
.L4:
	ldr	r2, .L8+4
	ldr	r1, .L8+8
	ldr	r0, .L8+12
	bl	sigtimedwait
	mov	r3, r0
	cmp	r3, #0
	blt	.L2
	mvn	r3, #0
	b	.L6
.L2:
	sub	r3, fp, #13
	mov	r2, #1
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L4
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L8+16
	mov	r2, #24
	ldr	r1, .L8+20
	ldr	r0, .L8+24
	bl	__assert_fail
.L5:
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r1, .L8+28
	mov	r0, #2
	bl	dprintf
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
.L6:
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC3
	.word	timeout
	.word	info
	.word	full_mask
	.word	__PRETTY_FUNCTION__.5821
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	resource_acquire, .-resource_acquire
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Resource %d released\012\000"
	.text
	.align	2
	.global	resource_release
	.syntax unified
	.arm
	.fpu softvfp
	.type	resource_release, %function
resource_release:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r1, .L11
	mov	r0, #2
	bl	dprintf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC4
	.size	resource_release, .-resource_release
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r1, #3
	mov	r0, #0
	bl	fcntl
	mov	r3, r0
	orr	r3, r3, #2048
	mov	r2, r3
	mov	r1, #4
	mov	r0, #0
	bl	fcntl
	ldr	r0, .L20
	bl	sigfillset
	mov	r2, #0
	ldr	r1, .L20
	mov	r0, #0
	bl	sigprocmask
	b	.L14
.L17:
	bl	resource_acquire
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	blt	.L19
	mov	r0, #1
	bl	sleep
	ldr	r0, [fp, #-8]
	bl	resource_release
.L14:
	ldr	r2, .L20+4
	ldr	r1, .L20+8
	ldr	r0, .L20
	bl	sigtimedwait
	mov	r3, r0
	cmp	r3, #0
	blt	.L17
	b	.L16
.L19:
	nop
.L16:
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	full_mask
	.word	timeout
	.word	info
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.5821, %object
	.size	__PRETTY_FUNCTION__.5821, 17
__PRETTY_FUNCTION__.5821:
	.ascii	"resource_acquire\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
