	.file	"857718.c"
	.intel_syntax noprefix
	.text
	.globl	mytiming
	.bss
	.align 32
	.type	mytiming, @object
	.size	mytiming, 144
mytiming:
	.zero	144
	.globl	mytimeval
	.align 16
	.type	mytimeval, @object
	.size	mytimeval, 16
mytimeval:
	.zero	16
	.globl	T1
	.align 8
	.type	T1, @object
	.size	T1, 8
T1:
	.zero	8
	.globl	T2
	.align 8
	.type	T2, @object
	.size	T2, 8
T2:
	.zero	8
	.globl	T3
	.align 8
	.type	T3, @object
	.size	T3, 8
T3:
	.zero	8
	.globl	counter1
	.align 8
	.type	counter1, @object
	.size	counter1, 8
counter1:
	.zero	8
	.globl	counter2
	.align 8
	.type	counter2, @object
	.size	counter2, 8
counter2:
	.zero	8
	.globl	counter3
	.align 8
	.type	counter3, @object
	.size	counter3, 8
counter3:
	.zero	8
	.globl	mutex
	.align 32
	.type	mutex, @object
	.size	mutex, 32
mutex:
	.zero	32
	.globl	value
	.align 8
	.type	value, @object
	.size	value, 8
value:
	.zero	8
	.globl	hundred
	.align 4
	.type	hundred, @object
	.size	hundred, 4
hundred:
	.zero	4
	.text
	.globl	update1
	.type	update1, @function
update1:
.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	QWORD PTR -8[rbp], rdi
	jmp	.L2
.L4:
	mov	rcx, QWORD PTR value[rip]
	mov	rax, rcx
	shr	rax, 2
	movabs	rdx, 2951479051793528259
	mul	rdx
	shr	rdx, 2
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	add	rax, rdx
	sal	rax, 2
	sub	rcx, rax
	mov	rdx, rcx
	test	rdx, rdx
	jne	.L3
	mov	rax, QWORD PTR counter1[rip]
	cmp	rax, 2499900
	ja	.L3
	lea	rdi, mutex[rip]
	call	sem_wait@PLT
	mov	rax, QWORD PTR value[rip]
	add	rax, 100
	mov	QWORD PTR value[rip], rax
	mov	rax, QWORD PTR counter1[rip]
	add	rax, 100
	mov	QWORD PTR counter1[rip], rax
	mov	eax, DWORD PTR hundred[rip]
	add	eax, 1
	mov	DWORD PTR hundred[rip], eax
	lea	rdi, mutex[rip]
	call	sem_post@PLT
.L3:
	mov	rax, QWORD PTR counter1[rip]
	cmp	rax, 2499999
	ja	.L2
	lea	rdi, mutex[rip]
	call	sem_wait@PLT
	mov	rax, QWORD PTR value[rip]
	add	rax, 1
	mov	QWORD PTR value[rip], rax
	mov	rax, QWORD PTR counter1[rip]
	add	rax, 1
	mov	QWORD PTR counter1[rip], rax
	lea	rdi, mutex[rip]
	call	sem_post@PLT
.L2:
	mov	rax, QWORD PTR counter1[rip]
	cmp	rax, 2499999
	jbe	.L4
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	update1, .-update1
	.globl	update2
	.type	update2, @function
update2:
.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	QWORD PTR -8[rbp], rdi
	jmp	.L7
.L8:
	lea	rdi, mutex[rip]
	call	sem_wait@PLT
	mov	rax, QWORD PTR value[rip]
	add	rax, 1
	mov	QWORD PTR value[rip], rax
	mov	rax, QWORD PTR counter2[rip]
	add	rax, 1
	mov	QWORD PTR counter2[rip], rax
	lea	rdi, mutex[rip]
	call	sem_post@PLT
.L7:
	mov	rax, QWORD PTR counter2[rip]
	cmp	rax, 2499999
	jbe	.L8
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	update2, .-update2
	.globl	update3
	.type	update3, @function
update3:
.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	QWORD PTR -8[rbp], rdi
	jmp	.L11
.L12:
	lea	rdi, mutex[rip]
	call	sem_wait@PLT
	mov	rax, QWORD PTR value[rip]
	add	rax, 1
	mov	QWORD PTR value[rip], rax
	mov	rax, QWORD PTR counter3[rip]
	add	rax, 1
	mov	QWORD PTR counter3[rip], rax
	lea	rdi, mutex[rip]
	call	sem_post@PLT
.L11:
	mov	rax, QWORD PTR counter3[rip]
	cmp	rax, 2499999
	jbe	.L12
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	update3, .-update3
	.section	.rodata
.LC0:
	.string	"\n Mutex Initialization Failed"
.LC1:
	.string	"\nThread1 creation failed"
.LC2:
	.string	"\nThread2 creation failed"
.LC3:
	.string	"\nThread3 creation failed"
	.align 8
.LC4:
	.string	"Thread1 Update_by_100 ***%d*** times\n"
.LC5:
	.string	"Thread1 contributed for: %d\n"
.LC6:
	.string	"Thread2 contributed for: %d\n"
.LC7:
	.string	"Thread3 contributed for: %d\n"
.LC8:
	.string	"Final Value: %d\n"
	.align 8
.LC9:
	.string	"Time used is sec: %d, usec %d\n"
	.align 8
.LC10:
	.string	"System Time used is sec: %d, usec %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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	edx, 1
	mov	esi, 0
	lea	rdi, mutex[rip]
	call	sem_init@PLT
	test	eax, eax
	je	.L15
	lea	rdi, .LC0[rip]
	call	puts@PLT
.L15:
	mov	ecx, 0
	lea	rdx, update1[rip]
	mov	esi, 0
	lea	rdi, T1[rip]
	call	pthread_create@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	je	.L16
	lea	rdi, .LC1[rip]
	call	puts@PLT
.L16:
	mov	ecx, 0
	lea	rdx, update2[rip]
	mov	esi, 0
	lea	rdi, T2[rip]
	call	pthread_create@PLT
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], 0
	je	.L17
	lea	rdi, .LC2[rip]
	call	puts@PLT
.L17:
	mov	ecx, 0
	lea	rdx, update3[rip]
	mov	esi, 0
	lea	rdi, T3[rip]
	call	pthread_create@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L18
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L18:
	mov	rax, QWORD PTR T1[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR T2[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR T3[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rdi, mutex[rip]
	call	sem_destroy@PLT
	mov	eax, DWORD PTR hundred[rip]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR counter1[rip]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR counter2[rip]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR counter3[rip]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR value[rip]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, mytiming[rip]
	mov	edi, 0
	call	getrusage@PLT
	mov	rdx, QWORD PTR mytiming[rip+8]
	mov	rax, QWORD PTR mytiming[rip]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR mytiming[rip+24]
	mov	rax, QWORD PTR mytiming[rip+16]
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"857718.c"
	.text
	.comm	mytiming,72,4
	.comm	mytimeval,8,4
	.comm	T1,4,4
	.comm	T2,4,4
	.comm	T3,4,4
	.global	counter1
	.bss
	.align	2
	.type	counter1, %object
	.size	counter1, 4
counter1:
	.space	4
	.global	counter2
	.align	2
	.type	counter2, %object
	.size	counter2, 4
counter2:
	.space	4
	.global	counter3
	.align	2
	.type	counter3, %object
	.size	counter3, 4
counter3:
	.space	4
	.comm	mutex,16,4
	.global	value
	.align	2
	.type	value, %object
	.size	value, 4
value:
	.space	4
	.global	hundred
	.align	2
	.type	hundred, %object
	.size	hundred, 4
hundred:
	.space	4
	.text
	.align	2
	.global	update1
	.syntax unified
	.arm
	.fpu softvfp
	.type	update1, %function
update1:
	@ 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]
	b	.L2
.L4:
	ldr	r3, .L6
	ldr	r1, [r3]
	ldr	r3, .L6+4
	umull	r2, r3, r1, r3
	lsr	r2, r3, #5
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	sub	r2, r1, r3
	cmp	r2, #0
	bne	.L3
	ldr	r3, .L6+8
	ldr	r3, [r3]
	ldr	r2, .L6+12
	cmp	r3, r2
	bhi	.L3
	ldr	r0, .L6+16
	bl	sem_wait
	ldr	r3, .L6
	ldr	r3, [r3]
	add	r3, r3, #100
	ldr	r2, .L6
	str	r3, [r2]
	ldr	r3, .L6+8
	ldr	r3, [r3]
	add	r3, r3, #100
	ldr	r2, .L6+8
	str	r3, [r2]
	ldr	r3, .L6+20
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L6+20
	str	r3, [r2]
	ldr	r0, .L6+16
	bl	sem_post
.L3:
	ldr	r3, .L6+8
	ldr	r3, [r3]
	ldr	r2, .L6+24
	cmp	r3, r2
	bhi	.L2
	ldr	r0, .L6+16
	bl	sem_wait
	ldr	r3, .L6
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L6
	str	r3, [r2]
	ldr	r3, .L6+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L6+8
	str	r3, [r2]
	ldr	r0, .L6+16
	bl	sem_post
.L2:
	ldr	r3, .L6+8
	ldr	r3, [r3]
	ldr	r2, .L6+24
	cmp	r3, r2
	bls	.L4
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	value
	.word	1374389535
	.word	counter1
	.word	2499900
	.word	mutex
	.word	hundred
	.word	2499999
	.size	update1, .-update1
	.align	2
	.global	update2
	.syntax unified
	.arm
	.fpu softvfp
	.type	update2, %function
update2:
	@ 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]
	b	.L9
.L10:
	ldr	r0, .L12
	bl	sem_wait
	ldr	r3, .L12+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L12+4
	str	r3, [r2]
	ldr	r3, .L12+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L12+8
	str	r3, [r2]
	ldr	r0, .L12
	bl	sem_post
.L9:
	ldr	r3, .L12+8
	ldr	r3, [r3]
	ldr	r2, .L12+12
	cmp	r3, r2
	bls	.L10
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	mutex
	.word	value
	.word	counter2
	.word	2499999
	.size	update2, .-update2
	.align	2
	.global	update3
	.syntax unified
	.arm
	.fpu softvfp
	.type	update3, %function
update3:
	@ 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]
	b	.L15
.L16:
	ldr	r0, .L18
	bl	sem_wait
	ldr	r3, .L18+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L18+4
	str	r3, [r2]
	ldr	r3, .L18+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L18+8
	str	r3, [r2]
	ldr	r0, .L18
	bl	sem_post
.L15:
	ldr	r3, .L18+8
	ldr	r3, [r3]
	ldr	r2, .L18+12
	cmp	r3, r2
	bls	.L16
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	mutex
	.word	value
	.word	counter3
	.word	2499999
	.size	update3, .-update3
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012 Mutex Initialization Failed\000"
	.align	2
.LC1:
	.ascii	"\012Thread1 creation failed\000"
	.align	2
.LC2:
	.ascii	"\012Thread2 creation failed\000"
	.align	2
.LC3:
	.ascii	"\012Thread3 creation failed\000"
	.align	2
.LC4:
	.ascii	"Thread1 Update_by_100 ***%d*** times\012\000"
	.align	2
.LC5:
	.ascii	"Thread1 contributed for: %d\012\000"
	.align	2
.LC6:
	.ascii	"Thread2 contributed for: %d\012\000"
	.align	2
.LC7:
	.ascii	"Thread3 contributed for: %d\012\000"
	.align	2
.LC8:
	.ascii	"Final Value: %d\012\000"
	.align	2
.LC9:
	.ascii	"Time used is sec: %d, usec %d\012\000"
	.align	2
.LC10:
	.ascii	"System Time used is sec: %d, usec %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, #1
	mov	r1, #0
	ldr	r0, .L25
	bl	sem_init
	mov	r3, r0
	cmp	r3, #0
	beq	.L21
	ldr	r0, .L25+4
	bl	puts
.L21:
	mov	r3, #0
	ldr	r2, .L25+8
	mov	r1, #0
	ldr	r0, .L25+12
	bl	pthread_create
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L22
	ldr	r0, .L25+16
	bl	puts
.L22:
	mov	r3, #0
	ldr	r2, .L25+20
	mov	r1, #0
	ldr	r0, .L25+24
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L23
	ldr	r0, .L25+28
	bl	puts
.L23:
	mov	r3, #0
	ldr	r2, .L25+32
	mov	r1, #0
	ldr	r0, .L25+36
	bl	pthread_create
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L24
	ldr	r0, .L25+40
	bl	puts
.L24:
	ldr	r3, .L25+12
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L25+24
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L25+36
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r0, .L25
	bl	sem_destroy
	ldr	r3, .L25+44
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L25+48
	bl	printf
	ldr	r3, .L25+52
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L25+56
	bl	printf
	ldr	r3, .L25+60
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L25+64
	bl	printf
	ldr	r3, .L25+68
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L25+72
	bl	printf
	ldr	r3, .L25+76
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L25+80
	bl	printf
	ldr	r1, .L25+84
	mov	r0, #0
	bl	getrusage
	ldr	r3, .L25+84
	ldr	r3, [r3]
	ldr	r2, .L25+84
	ldr	r2, [r2, #4]
	mov	r1, r3
	ldr	r0, .L25+88
	bl	printf
	ldr	r3, .L25+84
	ldr	r3, [r3, #8]
	ldr	r2, .L25+84
	ldr	r2, [r2, #12]
	mov	r1, r3
	ldr	r0, .L25+92
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	mutex
	.word	.LC0
	.word	update1
	.word	T1
	.word	.LC1
	.word	update2
	.word	T2
	.word	.LC2
	.word	update3
	.word	T3
	.word	.LC3
	.word	hundred
	.word	.LC4
	.word	counter1
	.word	.LC5
	.word	counter2
	.word	.LC6
	.word	counter3
	.word	.LC7
	.word	value
	.word	.LC8
	.word	mytiming
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
