	.file	"34512133.c"
	.intel_syntax noprefix
	.text
	.globl	beers_lock
	.bss
	.align 32
	.type	beers_lock, @object
	.size	beers_lock, 40
beers_lock:
	.zero	40
	.section	.rodata
.LC0:
	.string	"%s, %s\n"
	.text
	.globl	error
	.type	error, @function
error:
.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
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	error, .-error
	.globl	beers
	.data
	.align 4
	.type	beers, @object
	.size	beers, 4
beers:
	.long	2000000
	.section	.rodata
.LC1:
	.string	"beers = %i \n"
	.text
	.globl	drink_lots
	.type	drink_lots, @function
drink_lots:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	lea	rdi, beers_lock[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L3
.L4:
	mov	eax, DWORD PTR beers[rip]
	sub	eax, 1
	mov	DWORD PTR beers[rip], eax
	add	DWORD PTR -4[rbp], 1
.L3:
	cmp	DWORD PTR -4[rbp], 99999
	jle	.L4
	lea	rdi, beers_lock[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR beers[rip]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	drink_lots, .-drink_lots
	.section	.rodata
	.align 8
.LC2:
	.string	"%i bottles of beer on the wall\n%i bottles of beer\n"
.LC3:
	.string	"Can't create thread"
.LC4:
	.string	"cant join thread"
	.align 8
.LC5:
	.string	"There are now %i bottels of beer on the wall\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, 192
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, DWORD PTR beers[rip]
	mov	eax, DWORD PTR beers[rip]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -188[rbp], 0
	jmp	.L7
.L9:
	lea	rdx, -176[rbp]
	mov	eax, DWORD PTR -188[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	ecx, 0
	lea	rdx, drink_lots[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L8
	lea	rdi, .LC3[rip]
	call	error
.L8:
	add	DWORD PTR -188[rbp], 1
.L7:
	cmp	DWORD PTR -188[rbp], 19
	jle	.L9
	mov	DWORD PTR -188[rbp], 0
	jmp	.L10
.L12:
	mov	eax, DWORD PTR -188[rbp]
	cdqe
	mov	rax, QWORD PTR -176[rbp+rax*8]
	lea	rdx, -184[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	je	.L11
	lea	rdi, .LC4[rip]
	call	error
.L11:
	add	DWORD PTR -188[rbp], 1
.L10:
	cmp	DWORD PTR -188[rbp], 19
	jle	.L12
	mov	eax, DWORD PTR beers[rip]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"34512133.c"
	.text
	.global	beers_lock
	.bss
	.align	2
	.type	beers_lock, %object
	.size	beers_lock, 24
beers_lock:
	.space	24
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%s, %s\012\000"
	.text
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	str	r0, [fp, #-16]
	ldr	r3, .L2
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, [fp, #-16]
	ldr	r1, .L2+4
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	.align	2
.L2:
	.word	stderr
	.word	.LC0
	.size	error, .-error
	.global	beers
	.data
	.align	2
	.type	beers, %object
	.size	beers, 4
beers:
	.word	2000000
	.section	.rodata
	.align	2
.LC1:
	.ascii	"beers = %i \012\000"
	.text
	.align	2
	.global	drink_lots
	.syntax unified
	.arm
	.fpu softvfp
	.type	drink_lots, %function
drink_lots:
	@ 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	r0, .L8
	bl	pthread_mutex_lock
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L5
.L6:
	ldr	r3, .L8+4
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L8+4
	str	r3, [r2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L5:
	ldr	r3, [fp, #-8]
	ldr	r2, .L8+8
	cmp	r3, r2
	blt	.L6
	ldr	r0, .L8
	bl	pthread_mutex_unlock
	ldr	r3, .L8+4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L8+12
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	beers_lock
	.word	beers
	.word	100000
	.word	.LC1
	.size	drink_lots, .-drink_lots
	.section	.rodata
	.align	2
.LC2:
	.ascii	"%i bottles of beer on the wall\012%i bottles of bee"
	.ascii	"r\012\000"
	.align	2
.LC3:
	.ascii	"Can't create thread\000"
	.align	2
.LC4:
	.ascii	"cant join thread\000"
	.align	2
.LC5:
	.ascii	"There are now %i bottels of beer on the wall\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 = 96
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #96
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L19+4
	ldr	r3, [r3]
	ldr	r2, .L19+4
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L19+8
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-92]
	b	.L11
.L13:
	sub	r2, fp, #88
	ldr	r3, [fp, #-92]
	lsl	r3, r3, #2
	add	r0, r2, r3
	mov	r3, #0
	ldr	r2, .L19+12
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L12
	ldr	r0, .L19+16
	bl	error
.L12:
	ldr	r3, [fp, #-92]
	add	r3, r3, #1
	str	r3, [fp, #-92]
.L11:
	ldr	r3, [fp, #-92]
	cmp	r3, #19
	ble	.L13
	mov	r3, #0
	str	r3, [fp, #-92]
	b	.L14
.L16:
	ldr	r3, [fp, #-92]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-84]
	sub	r2, fp, #96
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	beq	.L15
	ldr	r0, .L19+20
	bl	error
.L15:
	ldr	r3, [fp, #-92]
	add	r3, r3, #1
	str	r3, [fp, #-92]
.L14:
	ldr	r3, [fp, #-92]
	cmp	r3, #19
	ble	.L16
	ldr	r3, .L19+4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L19+24
	bl	printf
	mov	r3, #0
	ldr	r2, .L19
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC6
	.word	beers
	.word	.LC2
	.word	drink_lots
	.word	.LC3
	.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
