	.file	"292215.c"
	.intel_syntax noprefix
	.text
	.globl	client_request
	.bss
	.align 32
	.type	client_request, @object
	.size	client_request, 32
client_request:
	.zero	32
	.globl	server_response
	.align 32
	.type	server_response, @object
	.size	server_response, 32
server_response:
	.zero	32
	.globl	clients_me
	.align 32
	.type	clients_me, @object
	.size	clients_me, 40
clients_me:
	.zero	40
	.globl	finished_barrier_me
	.align 32
	.type	finished_barrier_me, @object
	.size	finished_barrier_me, 40
finished_barrier_me:
	.zero	40
	.globl	val
	.align 4
	.type	val, @object
	.size	val, 4
val:
	.zero	4
	.globl	n_finished
	.align 4
	.type	n_finished, @object
	.size	n_finished, 4
n_finished:
	.zero	4
	.section	.rodata
.LC0:
	.string	"1"
	.align 8
.LC1:
	.string	"Error creating client thread 1\n"
.LC2:
	.string	"2"
	.align 8
.LC3:
	.string	"Error creating client thread 2\n"
	.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 0
	mov	esi, 0
	lea	rdi, client_request[rip]
	call	sem_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, server_response[rip]
	call	sem_init@PLT
	mov	esi, 0
	lea	rdi, clients_me[rip]
	call	pthread_mutex_init@PLT
	mov	esi, 0
	lea	rdi, finished_barrier_me[rip]
	call	pthread_mutex_init@PLT
	lea	rax, -24[rbp]
	lea	rcx, .LC0[rip]
	lea	rdx, client_thread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 31
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L5
.L2:
	lea	rax, -16[rbp]
	lea	rcx, .LC2[rip]
	lea	rdx, client_thread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L4
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 31
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L5
.L4:
	mov	eax, 0
	call	server
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rdi, clients_me[rip]
	call	pthread_mutex_destroy@PLT
	lea	rdi, finished_barrier_me[rip]
	call	pthread_mutex_destroy@PLT
	lea	rdi, server_response[rip]
	call	sem_destroy@PLT
	lea	rdi, client_request[rip]
	call	sem_destroy@PLT
	mov	eax, 0
.L5:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.string	"Server processed %d requests\n."
	.text
	.globl	server
	.type	server, @function
server:
.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], 0
.L10:
	lea	rdi, client_request[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR n_finished[rip]
	cmp	eax, 2
	jne	.L8
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L8:
	mov	eax, DWORD PTR val[rip]
	add	eax, eax
	mov	DWORD PTR val[rip], eax
	lea	rdi, server_response[rip]
	call	sem_post@PLT
	add	DWORD PTR -4[rbp], 1
	jmp	.L10
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	server, .-server
	.section	.rodata
.LC5:
	.string	"fv1.b"
.LC6:
	.string	"fv2.b"
	.align 8
.LC7:
	.string	"Wrong parameter to client thread\n"
.LC8:
	.string	"error opening file"
.LC9:
	.string	"client %d read value %d\n"
.LC10:
	.string	"client %d new value %d\n"
	.text
	.globl	client_thread
	.type	client_thread, @function
client_thread:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -25[rbp], al
	cmp	BYTE PTR -25[rbp], 49
	jne	.L13
	lea	rax, .LC5[rip]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L14
.L13:
	cmp	BYTE PTR -25[rbp], 50
	jne	.L15
	lea	rax, .LC6[rip]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L14
.L15:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 33
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L14:
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	jne	.L17
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 2
	call	exit@PLT
.L18:
	mov	edx, DWORD PTR -24[rbp]
	movsx	eax, BYTE PTR -25[rbp]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, clients_me[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR val[rip], eax
	lea	rdi, client_request[rip]
	call	sem_post@PLT
	lea	rdi, server_response[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR val[rip]
	mov	DWORD PTR -24[rbp], eax
	lea	rdi, clients_me[rip]
	call	pthread_mutex_unlock@PLT
	mov	edx, DWORD PTR -24[rbp]
	movsx	eax, BYTE PTR -25[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
.L17:
	lea	rcx, -24[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, 4
	je	.L18
	lea	rdi, finished_barrier_me[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR n_finished[rip]
	add	eax, 1
	mov	DWORD PTR n_finished[rip], eax
	mov	DWORD PTR -24[rbp], eax
	lea	rdi, finished_barrier_me[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, 2
	jne	.L19
	lea	rdi, client_request[rip]
	call	sem_post@PLT
.L19:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	client_thread, .-client_thread
	.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	"292215.c"
	.text
	.comm	client_request,16,4
	.comm	server_response,16,4
	.comm	clients_me,24,4
	.comm	finished_barrier_me,24,4
	.comm	val,4,4
	.comm	n_finished,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"1\000"
	.align	2
.LC1:
	.ascii	"Error creating client thread 1\012\000"
	.align	2
.LC2:
	.ascii	"2\000"
	.align	2
.LC3:
	.ascii	"Error creating client thread 2\012\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 = 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]
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L7+4
	bl	sem_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L7+8
	bl	sem_init
	mov	r1, #0
	ldr	r0, .L7+12
	bl	pthread_mutex_init
	mov	r1, #0
	ldr	r0, .L7+16
	bl	pthread_mutex_init
	sub	r0, fp, #16
	ldr	r3, .L7+20
	ldr	r2, .L7+24
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L2
	ldr	r3, .L7+28
	ldr	r3, [r3]
	mov	r2, #31
	mov	r1, #1
	ldr	r0, .L7+32
	bl	fwrite
	mov	r3, #1
	b	.L5
.L2:
	sub	r0, fp, #12
	ldr	r3, .L7+36
	ldr	r2, .L7+24
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
	ldr	r3, .L7+28
	ldr	r3, [r3]
	mov	r2, #31
	mov	r1, #1
	ldr	r0, .L7+40
	bl	fwrite
	mov	r3, #1
	b	.L5
.L4:
	bl	server
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-12]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r0, .L7+12
	bl	pthread_mutex_destroy
	ldr	r0, .L7+16
	bl	pthread_mutex_destroy
	ldr	r0, .L7+8
	bl	sem_destroy
	ldr	r0, .L7+4
	bl	sem_destroy
	mov	r3, #0
.L5:
	ldr	r2, .L7
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC4
	.word	client_request
	.word	server_response
	.word	clients_me
	.word	finished_barrier_me
	.word	.LC0
	.word	client_thread
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Server processed %d requests\012.\000"
	.text
	.align	2
	.global	server
	.syntax unified
	.arm
	.fpu softvfp
	.type	server, %function
server:
	@ 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	r3, #0
	str	r3, [fp, #-8]
.L12:
	ldr	r0, .L14
	bl	sem_wait
	ldr	r3, .L14+4
	ldr	r3, [r3]
	cmp	r3, #2
	bne	.L10
	ldr	r1, [fp, #-8]
	ldr	r0, .L14+8
	bl	printf
	b	.L13
.L10:
	ldr	r3, .L14+12
	ldr	r3, [r3]
	lsl	r3, r3, #1
	ldr	r2, .L14+12
	str	r3, [r2]
	ldr	r0, .L14+16
	bl	sem_post
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	b	.L12
.L13:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	client_request
	.word	n_finished
	.word	.LC5
	.word	val
	.word	server_response
	.size	server, .-server
	.section	.rodata
	.align	2
.LC6:
	.ascii	"fv1.b\000"
	.align	2
.LC7:
	.ascii	"fv2.b\000"
	.align	2
.LC8:
	.ascii	"Wrong parameter to client thread\012\000"
	.align	2
.LC9:
	.ascii	"error opening file\000"
	.align	2
.LC10:
	.ascii	"client %d read value %d\012\000"
	.align	2
.LC11:
	.ascii	"client %d new value %d\012\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	client_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	client_thread, %function
client_thread:
	@ 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, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-32]
	ldrb	r3, [r3]
	strb	r3, [fp, #-21]
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #49
	bne	.L17
	ldr	r3, .L26+4
	str	r3, [fp, #-16]
	b	.L18
.L17:
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #50
	bne	.L19
	ldr	r3, .L26+8
	str	r3, [fp, #-16]
	b	.L18
.L19:
	ldr	r3, .L26+12
	ldr	r3, [r3]
	mov	r2, #33
	mov	r1, #1
	ldr	r0, .L26+16
	bl	fwrite
	mov	r0, #1
	bl	exit
.L18:
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L21
	ldr	r0, .L26+20
	bl	perror
	mov	r0, #2
	bl	exit
.L22:
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	ldr	r2, [fp, #-20]
	mov	r1, r3
	ldr	r0, .L26+24
	bl	printf
	ldr	r0, .L26+28
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-20]
	ldr	r2, .L26+32
	str	r3, [r2]
	ldr	r0, .L26+36
	bl	sem_post
	ldr	r0, .L26+40
	bl	sem_wait
	ldr	r3, .L26+32
	ldr	r3, [r3]
	str	r3, [fp, #-20]
	ldr	r0, .L26+28
	bl	pthread_mutex_unlock
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	ldr	r2, [fp, #-20]
	mov	r1, r3
	ldr	r0, .L26+44
	bl	printf
.L21:
	sub	r3, fp, #20
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	read
	mov	r3, r0
	cmp	r3, #4
	beq	.L22
	ldr	r0, .L26+48
	bl	pthread_mutex_lock
	ldr	r3, .L26+52
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L26+52
	str	r3, [r2]
	str	r3, [fp, #-20]
	ldr	r0, .L26+48
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-20]
	cmp	r3, #2
	bne	.L23
	ldr	r0, .L26+36
	bl	sem_post
.L23:
	mov	r3, #0
	ldr	r2, .L26
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC12
	.word	.LC6
	.word	.LC7
	.word	stderr
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	clients_me
	.word	val
	.word	client_request
	.word	server_response
	.word	.LC11
	.word	finished_barrier_me
	.word	n_finished
	.size	client_thread, .-client_thread
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
