	.file	"206859.c"
	.intel_syntax noprefix
	.text
	.globl	contador
	.bss
	.align 8
	.type	contador, @object
	.size	contador, 8
contador:
	.zero	8
	.globl	mymutex
	.align 32
	.type	mymutex, @object
	.size	mymutex, 40
mymutex:
	.zero	40
	.globl	done
	.data
	.type	done, @object
	.size	done, 1
done:
	.byte	1
	.section	.rodata
	.align 8
.LC0:
	.string	"Valor final do contador: %ld, finalizado na thread %ld\n"
	.text
	.globl	inc
	.type	inc, @function
inc:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L2
.L5:
	lea	rdi, mymutex[rip]
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR contador[rip]
	cmp	rax, 1000000
	jne	.L3
	movzx	eax, BYTE PTR done[rip]
	test	al, al
	je	.L4
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR contador[rip]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	BYTE PTR done[rip], 0
.L4:
	lea	rdi, mymutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L3:
	mov	rax, QWORD PTR contador[rip]
	add	rax, 1
	mov	QWORD PTR contador[rip], rax
	lea	rdi, mymutex[rip]
	call	pthread_mutex_unlock@PLT
.L2:
	movzx	eax, BYTE PTR done[rip]
	test	al, al
	jne	.L5
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE6:
	.size	inc, .-inc
	.section	.rodata
.LC1:
	.string	"%ld"
	.align 8
.LC2:
	.string	"ERRO; c\303\263digo de retorno \303\251 %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	add	rsp, -128
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	lea	rax, -88[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rax, QWORD PTR -88[rbp]
	lea	rdx, -1[rax]
	mov	QWORD PTR -72[rbp], rdx
	mov	rdx, rax
	mov	QWORD PTR -144[rbp], rdx
	mov	QWORD PTR -136[rbp], 0
	mov	rdx, rax
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], 0
	lea	rdx, 0[0+rax*8]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L7:
	cmp	rsp, rdx
	je	.L8
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L7
.L8:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L9
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L9:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -64[rbp], rax
	mov	rax, QWORD PTR -88[rbp]
	lea	rdx, -1[rax]
	mov	QWORD PTR -56[rbp], rdx
	mov	rdx, rax
	mov	r14, rdx
	mov	r15d, 0
	mov	rdx, rax
	mov	r12, rdx
	mov	r13d, 0
	lea	rdx, 0[0+rax*8]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L10:
	cmp	rsp, rdx
	je	.L11
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L10
.L11:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L12
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L12:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -48[rbp], rax
	mov	DWORD PTR -96[rbp], 0
	jmp	.L13
.L15:
	mov	edi, 8
	call	malloc@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR -48[rbp]
	mov	edx, DWORD PTR -96[rbp]
	movsx	rdx, edx
	mov	QWORD PTR [rax+rdx*8], rcx
	mov	rax, QWORD PTR -48[rbp]
	mov	edx, DWORD PTR -96[rbp]
	movsx	rdx, edx
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	edx, DWORD PTR -96[rbp]
	movsx	rdx, edx
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -48[rbp]
	mov	edx, DWORD PTR -96[rbp]
	movsx	rdx, edx
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	edx, DWORD PTR -96[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*8]
	mov	rdx, QWORD PTR -64[rbp]
	lea	rdi, [rcx+rdx]
	mov	rcx, rax
	lea	rdx, inc[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -92[rbp], eax
	cmp	DWORD PTR -92[rbp], 0
	je	.L14
	mov	eax, DWORD PTR -92[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, -1
	call	exit@PLT
.L14:
	add	DWORD PTR -96[rbp], 1
.L13:
	mov	eax, DWORD PTR -96[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -88[rbp]
	cmp	rdx, rax
	jl	.L15
	mov	DWORD PTR -100[rbp], 0
	jmp	.L16
.L17:
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -100[rbp]
	movsx	rdx, edx
	mov	rax, QWORD PTR [rax+rdx*8]
	lea	rdx, -80[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -100[rbp], 1
.L16:
	mov	eax, DWORD PTR -100[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -88[rbp]
	cmp	rdx, rax
	jl	.L17
	lea	rdi, mymutex[rip]
	call	pthread_mutex_destroy@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE7:
	.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	"206859.c"
	.text
	.global	contador
	.bss
	.align	2
	.type	contador, %object
	.size	contador, 4
contador:
	.space	4
	.global	mymutex
	.align	2
	.type	mymutex, %object
	.size	mymutex, 24
mymutex:
	.space	24
	.global	done
	.data
	.type	done, %object
	.size	done, 1
done:
	.byte	1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Valor final do contador: %ld, finalizado na thread "
	.ascii	"%ld\012\000"
	.text
	.align	2
	.global	inc
	.syntax unified
	.arm
	.fpu softvfp
	.type	inc, %function
inc:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	b	.L2
.L5:
	ldr	r0, .L6
	bl	pthread_mutex_lock
	ldr	r3, .L6+4
	ldr	r3, [r3]
	ldr	r2, .L6+8
	cmp	r3, r2
	bne	.L3
	ldr	r3, .L6+12
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L4
	ldr	r3, .L6+4
	ldr	r1, [r3]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r0, .L6+16
	bl	printf
	ldr	r3, .L6+12
	mov	r2, #0
	strb	r2, [r3]
.L4:
	ldr	r0, .L6
	bl	pthread_mutex_unlock
	mov	r0, #0
	bl	pthread_exit
.L3:
	ldr	r3, .L6+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L6+4
	str	r3, [r2]
	ldr	r0, .L6
	bl	pthread_mutex_unlock
.L2:
	ldr	r3, .L6+12
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L5
	mov	r0, #0
	bl	pthread_exit
.L7:
	.align	2
.L6:
	.word	mymutex
	.word	contador
	.word	1000000
	.word	done
	.word	.LC0
	.size	inc, .-inc
	.section	.rodata
	.align	2
.LC1:
	.ascii	"%ld\000"
	.align	2
.LC2:
	.ascii	"ERRO; c\303\263digo de retorno \303\251 %d\012\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #44
	mov	r1, r3
	ldr	r0, .L15+4
	bl	__isoc99_scanf
	ldr	ip, [fp, #-44]
	sub	r3, ip, #1
	str	r3, [fp, #-36]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-24]
	ldr	ip, [fp, #-44]
	sub	r3, ip, #1
	str	r3, [fp, #-20]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L9
.L11:
	mov	r0, #4
	bl	malloc
	mov	r3, r0
	mov	r1, r3
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-28]
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-28]
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-28]
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r0, r2, r3
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-28]
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, .L15+8
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L10
	ldr	r1, [fp, #-12]
	ldr	r0, .L15+12
	bl	printf
	mvn	r0, #0
	bl	exit
.L10:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L9:
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L11
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L12
.L13:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-32]
	ldr	r3, [r3, r2, lsl #2]
	sub	r2, fp, #40
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L12:
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L13
	ldr	r0, .L15+16
	bl	pthread_mutex_destroy
	mov	r0, #0
	bl	pthread_exit
.L16:
	.align	2
.L15:
	.word	.LC3
	.word	.LC1
	.word	inc
	.word	.LC2
	.word	mymutex
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
