	.file	"372192.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Valeur courante : %d, dans %u\n"
.LC1:
	.string	"Je suis le vainqueur (%u).\n"
	.text
	.globl	count
	.type	count, @function
count:
.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	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]
	mov	QWORD PTR -24[rbp], rax
	call	pthread_self@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	edi, 0
	call	time@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	eax, edx
	mov	DWORD PTR -28[rbp], eax
.L5:
	lea	rax, -28[rbp]
	mov	rdi, rax
	call	rand_r@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1431655766
	shr	rdx, 32
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	ecx, edx
	add	ecx, ecx
	add	ecx, edx
	sub	eax, ecx
	mov	edx, eax
	mov	eax, edx
	mov	edi, eax
	call	sleep@PLT
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 48[rax]
	cmp	edx, eax
	je	.L2
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	rdx, QWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 48[rax]
	cmp	edx, eax
	jne	.L3
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	mov	edi, 0
	call	pthread_exit@PLT
.L3:
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	jmp	.L5
	.cfi_endproc
.LFE6:
	.size	count, .-count
	.section	.rodata
	.align 8
.LC2:
	.string	"Something went wrong while reserving a mutex...\n"
	.align 8
.LC3:
	.string	"Something went wrong with POSIX thread creation...\n"
	.align 8
.LC4:
	.string	"Something went wront while joining threads...\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
	add	rsp, -128
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -64[rbp], 0
	mov	DWORD PTR -16[rbp], 10
	lea	rax, -64[rbp]
	add	rax, 8
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	test	eax, eax
	je	.L8
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 48
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	DWORD PTR -108[rbp], 0
	jmp	.L9
.L11:
	lea	rdx, -96[rbp]
	mov	eax, DWORD PTR -108[rbp]
	cdqe
	sal	rax, 3
	lea	rdi, [rdx+rax]
	lea	rax, -64[rbp]
	mov	rcx, rax
	lea	rdx, count[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -100[rbp], eax
	cmp	DWORD PTR -100[rbp], 0
	je	.L10
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 51
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	add	DWORD PTR -108[rbp], 1
.L9:
	cmp	DWORD PTR -108[rbp], 3
	jle	.L11
	mov	DWORD PTR -108[rbp], 0
	jmp	.L12
.L14:
	mov	eax, DWORD PTR -108[rbp]
	cdqe
	mov	rax, QWORD PTR -96[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -104[rbp], eax
	cmp	DWORD PTR -104[rbp], 0
	je	.L13
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 46
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	add	DWORD PTR -108[rbp], 1
.L12:
	cmp	DWORD PTR -108[rbp], 3
	jle	.L14
	mov	edi, 0
	call	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	"372192.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Valeur courante : %d, dans %u\012\000"
	.align	2
.LC1:
	.ascii	"Je suis le vainqueur (%u).\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	count
	.syntax unified
	.arm
	.fpu softvfp
	.type	count, %function
count:
	@ 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]
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
	bl	pthread_self
	str	r0, [fp, #-12]
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-20]
.L5:
	sub	r3, fp, #20
	mov	r0, r3
	bl	rand_r
	mov	r2, r0
	ldr	r3, .L7+4
	smull	r0, r1, r3, r2
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #1
	add	r3, r3, r1
	sub	r1, r2, r3
	mov	r3, r1
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-16]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-16]
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #28]
	cmp	r2, r3
	beq	.L2
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	mov	r1, r3
	ldr	r0, .L7+8
	bl	printf
	ldr	r3, [fp, #-16]
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #28]
	cmp	r2, r3
	bne	.L3
	ldr	r1, [fp, #-12]
	ldr	r0, .L7+12
	bl	printf
	b	.L3
.L2:
	ldr	r3, [fp, #-16]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	mov	r0, #0
	bl	pthread_exit
.L3:
	ldr	r3, [fp, #-16]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_unlock
	b	.L5
.L8:
	.align	2
.L7:
	.word	.LC2
	.word	1431655766
	.word	.LC0
	.word	.LC1
	.size	count, .-count
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Something went wrong while reserving a mutex...\012"
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"Something went wrong with POSIX thread creation...\012"
	.ascii	"\000"
	.align	2
.LC5:
	.ascii	"Something went wront while joining threads...\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-40]
	mov	r3, #10
	str	r3, [fp, #-12]
	sub	r3, fp, #40
	add	r3, r3, #4
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	ldr	r3, .L18+4
	ldr	r3, [r3]
	mov	r2, #48
	mov	r1, #1
	ldr	r0, .L18+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L10:
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L11
.L13:
	sub	r2, fp, #56
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #2
	add	r0, r2, r3
	sub	r3, fp, #40
	ldr	r2, .L18+12
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	beq	.L12
	ldr	r3, .L18+4
	ldr	r3, [r3]
	mov	r2, #51
	mov	r1, #1
	ldr	r0, .L18+16
	bl	fwrite
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L11:
	ldr	r3, [fp, #-68]
	cmp	r3, #3
	ble	.L13
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L14
.L16:
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-52]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	beq	.L15
	ldr	r3, .L18+4
	ldr	r3, [r3]
	mov	r2, #46
	mov	r1, #1
	ldr	r0, .L18+20
	bl	fwrite
	mov	r0, #1
	bl	exit
.L15:
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L14:
	ldr	r3, [fp, #-68]
	cmp	r3, #3
	ble	.L16
	mov	r0, #0
	bl	exit
.L19:
	.align	2
.L18:
	.word	.LC6
	.word	stderr
	.word	.LC3
	.word	count
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
