	.file	"235338.c"
	.intel_syntax noprefix
	.text
	.globl	chopsticks
	.bss
	.align 32
	.type	chopsticks, @object
	.size	chopsticks, 160
chopsticks:
	.zero	160
	.globl	mutex1
	.align 32
	.type	mutex1, @object
	.size	mutex1, 32
mutex1:
	.zero	32
	.globl	mutex2
	.align 32
	.type	mutex2, @object
	.size	mutex2, 32
mutex2:
	.zero	32
	.globl	state
	.type	state, @object
	.size	state, 5
state:
	.zero	5
	.globl	whenToStart
	.data
	.align 4
	.type	whenToStart, @object
	.size	whenToStart, 4
whenToStart:
	.long	1
	.section	.rodata
.LC0:
	.string	"P%d: hunger\n"
.LC1:
	.string	"P%d:picking up %d,%d\n"
.LC2:
	.string	"P%d:consume\n"
.LC3:
	.string	"P%d: putting down %d,%d\n"
	.text
	.globl	dinerDoSomething
	.type	dinerDoSomething, @function
dinerDoSomething:
.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
	nop
.L2:
	mov	eax, DWORD PTR whenToStart[rip]
	test	eax, eax
	jne	.L2
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR -12[rbp], eax
	mov	DWORD PTR -24[rbp], 0
	mov	DWORD PTR -20[rbp], 0
	mov	DWORD PTR -16[rbp], 0
	jmp	.L3
.L6:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, state[rip]
	mov	BYTE PTR [rax+rdx], 1
	lea	rdi, mutex1[rip]
	call	sem_wait@PLT
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, chopsticks[rip]
	add	rdx, rax
	lea	rax, -24[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	sem_getvalue@PLT
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, chopsticks[rip]
	add	rdx, rax
	lea	rax, -20[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	sem_getvalue@PLT
.L4:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, 1
	jne	.L5
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, 1
	jne	.L5
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	edx, DWORD PTR -12[rbp]
	mov	esi, DWORD PTR -12[rbp]
	mov	ecx, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, mutex1[rip]
	call	sem_post@PLT
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, state[rip]
	mov	BYTE PTR [rax+rdx], 2
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, mutex2[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	edx, DWORD PTR -12[rbp]
	mov	esi, DWORD PTR -12[rbp]
	mov	ecx, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_post@PLT
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_post@PLT
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, state[rip]
	mov	BYTE PTR [rax+rdx], 0
	lea	rdi, mutex2[rip]
	call	sem_post@PLT
	add	DWORD PTR -16[rbp], 1
.L3:
	cmp	DWORD PTR -16[rbp], 0
	jle	.L6
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	dinerDoSomething, .-dinerDoSomething
	.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
	sub	rsp, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 1
	mov	esi, 0
	lea	rdi, mutex1[rip]
	call	sem_init@PLT
	mov	edx, 1
	mov	esi, 0
	lea	rdi, mutex2[rip]
	call	sem_init@PLT
	mov	DWORD PTR -60[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, chopsticks[rip]
	add	rax, rdx
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	sem_init@PLT
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, state[rip]
	mov	BYTE PTR [rax+rdx], 0
	add	DWORD PTR -60[rbp], 1
.L10:
	cmp	DWORD PTR -60[rbp], 4
	jle	.L11
	mov	DWORD PTR -56[rbp], 0
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	mov	rdx, rax
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, -48[rbp]
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, dinerDoSomething[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -56[rbp], 1
.L12:
	cmp	DWORD PTR -56[rbp], 4
	jle	.L13
	mov	DWORD PTR whenToStart[rip], 0
	mov	DWORD PTR -52[rbp], 0
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	mov	rax, QWORD PTR -48[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -52[rbp], 1
.L14:
	cmp	DWORD PTR -52[rbp], 4
	jle	.L15
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	"235338.c"
	.text
	.comm	chopsticks,80,4
	.comm	mutex1,16,4
	.comm	mutex2,16,4
	.comm	state,5,4
	.global	whenToStart
	.data
	.align	2
	.type	whenToStart, %object
	.size	whenToStart, 4
whenToStart:
	.word	1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"P%d: hunger\012\000"
	.align	2
.LC1:
	.ascii	"P%d:picking up %d,%d\012\000"
	.align	2
.LC2:
	.ascii	"P%d:consume\012\000"
	.align	2
.LC3:
	.ascii	"P%d: putting down %d,%d\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	dinerDoSomething
	.syntax unified
	.arm
	.fpu softvfp
	.type	dinerDoSomething, %function
dinerDoSomething:
	@ 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, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	nop
.L2:
	ldr	r3, .L9+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L3
.L6:
	ldr	r1, [fp, #-12]
	ldr	r0, .L9+8
	bl	printf
	ldr	r2, .L9+12
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #1
	strb	r2, [r3]
	ldr	r0, .L9+16
	bl	sem_wait
	b	.L4
.L5:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	ldr	r2, .L9+20
	add	r3, r3, r2
	sub	r2, fp, #24
	mov	r1, r2
	mov	r0, r3
	bl	sem_getvalue
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	ldr	r3, .L9+24
	smull	r1, r3, r2, r3
	asr	r1, r3, #1
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	sub	r1, r2, r3
	mov	r3, r1
	lsl	r3, r3, #4
	ldr	r2, .L9+20
	add	r3, r3, r2
	sub	r2, fp, #20
	mov	r1, r2
	mov	r0, r3
	bl	sem_getvalue
.L4:
	ldr	r3, [fp, #-24]
	cmp	r3, #1
	bne	.L5
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	bne	.L5
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	ldr	r2, .L9+20
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	ldr	r3, .L9+24
	smull	r1, r3, r2, r3
	asr	r1, r3, #1
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	sub	r1, r2, r3
	mov	r3, r1
	lsl	r3, r3, #4
	ldr	r2, .L9+20
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	ldr	r3, .L9+24
	smull	r1, r3, r2, r3
	asr	r1, r3, #1
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	sub	r1, r2, r3
	mov	r3, r1
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, .L9+28
	bl	printf
	ldr	r0, .L9+16
	bl	sem_post
	ldr	r2, .L9+12
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #2
	strb	r2, [r3]
	ldr	r1, [fp, #-12]
	ldr	r0, .L9+32
	bl	printf
	ldr	r0, .L9+36
	bl	sem_wait
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	ldr	r3, .L9+24
	smull	r1, r3, r2, r3
	asr	r1, r3, #1
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	sub	r1, r2, r3
	mov	r3, r1
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, .L9+40
	bl	printf
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	ldr	r2, .L9+20
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	ldr	r3, .L9+24
	smull	r1, r3, r2, r3
	asr	r1, r3, #1
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	sub	r1, r2, r3
	mov	r3, r1
	lsl	r3, r3, #4
	ldr	r2, .L9+20
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	ldr	r2, .L9+12
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r0, .L9+36
	bl	sem_post
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L3:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	ble	.L6
	mov	r3, #0
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC4
	.word	whenToStart
	.word	.LC0
	.word	state
	.word	mutex1
	.word	chopsticks
	.word	1717986919
	.word	.LC1
	.word	.LC2
	.word	mutex2
	.word	.LC3
	.size	dinerDoSomething, .-dinerDoSomething
	.section	.rodata
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L20+4
	bl	sem_init
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L20+8
	bl	sem_init
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L12
.L13:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #4
	ldr	r2, .L20+12
	add	r3, r3, r2
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	sem_init
	ldr	r2, .L20+16
	ldr	r3, [fp, #-40]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L12:
	ldr	r3, [fp, #-40]
	cmp	r3, #4
	ble	.L13
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L14
.L15:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	sub	r2, fp, #28
	add	r0, r2, r3
	ldr	r3, [fp, #-36]
	ldr	r2, .L20+20
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L14:
	ldr	r3, [fp, #-36]
	cmp	r3, #4
	ble	.L15
	ldr	r3, .L20+24
	mov	r2, #0
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L16
.L17:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-24]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L16:
	ldr	r3, [fp, #-32]
	cmp	r3, #4
	ble	.L17
	mov	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC5
	.word	mutex1
	.word	mutex2
	.word	chopsticks
	.word	state
	.word	dinerDoSomething
	.word	whenToStart
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
