	.file	"14199046.c"
	.intel_syntax noprefix
	.text
	.local	buf
	.comm	buf,6,2
	.section	.rodata
.LC0:
	.string	"Podnoszenie semafora"
	.text
	.globl	podnies
	.type	podnies, @function
podnies:
.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	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	eax, DWORD PTR -8[rbp]
	mov	WORD PTR buf[rip], ax
	mov	WORD PTR buf[rip+2], 1
	mov	WORD PTR buf[rip+4], 0
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, 1
	lea	rsi, buf[rip]
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L3
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	podnies, .-podnies
	.section	.rodata
.LC1:
	.string	"Opuszczenie semafora"
	.text
	.globl	opusc
	.type	opusc, @function
opusc:
.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	DWORD PTR -8[rbp], esi
	mov	eax, DWORD PTR -8[rbp]
	mov	WORD PTR buf[rip], ax
	mov	WORD PTR buf[rip+2], -1
	mov	WORD PTR buf[rip+4], 0
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, 1
	lea	rsi, buf[rip]
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	opusc, .-opusc
	.section	.rodata
.LC2:
	.string	"Utworzenie tablicy semaforow"
.LC3:
	.string	"Nadanie wartosci semaforowi 0"
.LC4:
	.string	"Nadanie wartosci semaforowi 1"
	.align 8
.LC5:
	.string	"Utworzenie segmentu pamieci wspoldzielonej"
	.align 8
.LC6:
	.string	"Przylaczenie segmentu pamieci wspoldzielonej"
.LC7:
	.string	"Zapis warto\305\233ci %d\n"
	.text
	.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, 32
	mov	edx, 896
	mov	esi, 2
	mov	edi, 45281
	call	semget@PLT
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], -1
	jne	.L8
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	eax, DWORD PTR -16[rbp]
	mov	ecx, 10
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L9
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR -16[rbp]
	mov	ecx, 0
	mov	edx, 16
	mov	esi, 1
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L10
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	edx, 896
	mov	esi, 40
	mov	edi, 45281
	call	shmget@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L11
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	eax, DWORD PTR -12[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L12
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, 0
	mov	edi, eax
	call	opusc
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	ecx, DWORD PTR -20[rbp]
	movsx	rax, ecx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, ecx
	sar	esi, 31
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	movsx	rax, edx
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, 1
	mov	edi, eax
	call	podnies
	add	DWORD PTR -20[rbp], 1
.L13:
	cmp	DWORD PTR -20[rbp], 9999
	jle	.L14
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"14199046.c"
	.text
	.local	buf
	.comm	buf,6,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Podnoszenie semafora\000"
	.text
	.align	2
	.global	podnies
	.syntax unified
	.arm
	.fpu softvfp
	.type	podnies, %function
podnies:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldr	r2, .L4
	strh	r3, [r2]	@ movhi
	ldr	r3, .L4
	mov	r2, #1
	strh	r2, [r3, #2]	@ movhi
	ldr	r3, .L4
	mov	r2, #0
	strh	r2, [r3, #4]	@ movhi
	mov	r2, #1
	ldr	r1, .L4
	ldr	r0, [fp, #-8]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L4+4
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	buf
	.word	.LC0
	.size	podnies, .-podnies
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Opuszczenie semafora\000"
	.text
	.align	2
	.global	opusc
	.syntax unified
	.arm
	.fpu softvfp
	.type	opusc, %function
opusc:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldr	r2, .L9
	strh	r3, [r2]	@ movhi
	ldr	r3, .L9
	mvn	r2, #0
	strh	r2, [r3, #2]	@ movhi
	ldr	r3, .L9
	mov	r2, #0
	strh	r2, [r3, #4]	@ movhi
	mov	r2, #1
	ldr	r1, .L9
	ldr	r0, [fp, #-8]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L9+4
	bl	perror
	mov	r0, #1
	bl	exit
.L8:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	buf
	.word	.LC1
	.size	opusc, .-opusc
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Utworzenie tablicy semaforow\000"
	.align	2
.LC3:
	.ascii	"Nadanie wartosci semaforowi 0\000"
	.align	2
.LC4:
	.ascii	"Nadanie wartosci semaforowi 1\000"
	.align	2
.LC5:
	.ascii	"Utworzenie segmentu pamieci wspoldzielonej\000"
	.align	2
.LC6:
	.ascii	"Przylaczenie segmentu pamieci wspoldzielonej\000"
	.align	2
.LC7:
	.ascii	"Zapis warto\305\233ci %d\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	mov	r2, #896
	mov	r1, #2
	ldr	r0, .L20
	bl	semget
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L12
	ldr	r0, .L20+4
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	mov	r3, #10
	mov	r2, #16
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L13
	ldr	r0, .L20+8
	bl	perror
	mov	r0, #1
	bl	exit
.L13:
	mov	r3, #0
	mov	r2, #16
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L14
	ldr	r0, .L20+12
	bl	perror
	mov	r0, #1
	bl	exit
.L14:
	mov	r2, #896
	mov	r1, #40
	ldr	r0, .L20
	bl	shmget
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L15
	ldr	r0, .L20+16
	bl	perror
	mov	r0, #1
	bl	exit
.L15:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	shmat
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L16
	ldr	r0, .L20+20
	bl	perror
	mov	r0, #1
	bl	exit
.L16:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L17
.L18:
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	opusc
	ldr	r1, [fp, #-20]
	ldr	r0, .L20+24
	bl	printf
	ldr	r2, [fp, #-20]
	ldr	r3, .L20+28
	smull	r1, r3, r2, r3
	asr	r1, r3, #2
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #1
	sub	r1, r2, r3
	mov	r3, r1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	podnies
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L17:
	ldr	r3, [fp, #-20]
	ldr	r2, .L20+32
	cmp	r3, r2
	ble	.L18
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	45281
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	1717986919
	.word	9999
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
