	.file	"140419.c"
	.intel_syntax noprefix
	.text
	.globl	p
	.data
	.align 2
	.type	p, @object
	.size	p, 6
p:
	.value	0
	.value	-1
	.value	4096
	.globl	v
	.align 2
	.type	v, @object
	.size	v, 6
v:
	.value	0
	.value	1
	.value	4096
	.section	.rodata
.LC0:
	.string	"semget error"
.LC1:
	.string	"semop error"
.LC2:
	.string	"r"
.LC3:
	.string	"program.txt"
.LC4:
	.string	"SEmopm 2 error"
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -52[rbp], 0
	cmp	DWORD PTR -52[rbp], 0
	jns	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	DWORD PTR -48[rbp], 1
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 1
	lea	rsi, p[rip]
	mov	edi, eax
	call	semop@PLT
	test	eax, eax
	jns	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	lea	rsi, .LC2[rip]
	lea	rdi, .LC3[rip]
	call	fopen@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -53[rbp], al
	jmp	.L4
.L5:
	movsx	eax, BYTE PTR -53[rbp]
	mov	edi, eax
	call	putchar@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -53[rbp], al
	mov	edi, 1
	call	sleep@PLT
.L4:
	cmp	BYTE PTR -53[rbp], -1
	jne	.L5
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 1
	lea	rsi, v[rip]
	mov	edi, eax
	call	semop@PLT
	test	eax, eax
	jns	.L6
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"140419.c"
	.text
	.global	p
	.data
	.align	2
	.type	p, %object
	.size	p, 6
p:
	.short	0
	.short	-1
	.short	4096
	.global	v
	.align	2
	.type	v, %object
	.size	v, 6
v:
	.short	0
	.short	1
	.short	4096
	.section	.rodata
	.align	2
.LC0:
	.ascii	"semget error\000"
	.align	2
.LC1:
	.ascii	"semop error\000"
	.align	2
.LC2:
	.ascii	"r\000"
	.align	2
.LC3:
	.ascii	"program.txt\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r3, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L6+4
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	mov	r3, #1
	str	r3, [fp, #-40]
	mov	r2, #1
	ldr	r1, .L6+8
	ldr	r0, [fp, #-36]
	bl	semop
	mov	r3, r0
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L6+12
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	ldr	r1, .L6+16
	ldr	r0, .L6+20
	bl	fopen
	str	r0, [fp, #-32]
	ldr	r0, [fp, #-32]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-41]
.L4:
	ldrb	r3, [fp, #-41]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r0, [fp, #-32]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-41]
	mov	r0, #1
	bl	sleep
	b	.L4
.L7:
	.align	2
.L6:
	.word	.LC4
	.word	.LC0
	.word	p
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
