	.file	"65181.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"PAMEI_DIR"
.LC1:
	.string	"could not stat '%s'"
.LC2:
	.string	"%s/%s"
.LC3:
	.string	"path is too long"
.LC4:
	.string	"open failed '%s'"
.LC5:
	.string	"resource is locked"
.LC6:
	.string	"flock failed"
.LC7:
	.string	"fork failed"
.LC8:
	.string	"could not exec '%s'"
.LC9:
	.string	"waitpid failed"
	.text
	.globl	main
	.type	main, @function
main:
.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, 240
	mov	DWORD PTR -228[rbp], edi
	mov	QWORD PTR -240[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -228[rbp], 2
	jg	.L2
	call	emit_help
.L2:
	lea	rdi, .LC0[rip]
	call	getenv@PLT
	mov	rdi, rax
	call	texpand
	mov	QWORD PTR -184[rbp], rax
	lea	rdx, -160[rbp]
	mov	rax, QWORD PTR -184[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	cmp	eax, -1
	jne	.L3
	mov	rax, QWORD PTR -184[rbp]
	mov	rdx, rax
	lea	rsi, .LC1[rip]
	mov	edi, 74
	mov	eax, 0
	call	err@PLT
.L3:
	mov	rax, QWORD PTR -240[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -176[rbp], rax
	mov	rax, QWORD PTR -176[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	QWORD PTR -168[rbp], rax
	mov	DWORD PTR -212[rbp], 0
	jmp	.L4
.L6:
	mov	eax, DWORD PTR -212[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -176[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	jne	.L5
	mov	eax, DWORD PTR -212[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -176[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 95
.L5:
	add	DWORD PTR -212[rbp], 1
.L4:
	mov	eax, DWORD PTR -212[rbp]
	cdqe
	cmp	QWORD PTR -168[rbp], rax
	ja	.L6
	mov	rcx, QWORD PTR -176[rbp]
	mov	rdx, QWORD PTR -184[rbp]
	lea	rax, -192[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	asprintf@PLT
	mov	DWORD PTR -204[rbp], eax
	cmp	DWORD PTR -204[rbp], 4095
	jle	.L7
	lea	rsi, .LC3[rip]
	mov	edi, 74
	mov	eax, 0
	call	err@PLT
.L7:
	mov	rax, QWORD PTR -184[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -192[rbp]
	mov	edx, 438
	mov	esi, 64
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -200[rbp], eax
	cmp	DWORD PTR -200[rbp], -1
	jne	.L8
	mov	rax, QWORD PTR -192[rbp]
	mov	rdx, rax
	lea	rsi, .LC4[rip]
	mov	edi, 74
	mov	eax, 0
	call	err@PLT
.L8:
	mov	eax, DWORD PTR -200[rbp]
	mov	esi, 6
	mov	edi, eax
	mov	eax, 0
	call	flock@PLT
	cmp	eax, -1
	jne	.L9
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	jne	.L10
	lea	rsi, .LC5[rip]
	mov	edi, 2
	mov	eax, 0
	call	errx@PLT
.L10:
	lea	rsi, .LC6[rip]
	mov	edi, 74
	mov	eax, 0
	call	err@PLT
.L9:
	call	fork@PLT
	mov	DWORD PTR -196[rbp], eax
	cmp	DWORD PTR -196[rbp], -1
	jne	.L11
	lea	rsi, .LC7[rip]
	mov	edi, 71
	mov	eax, 0
	call	err@PLT
.L11:
	cmp	DWORD PTR -196[rbp], 0
	jne	.L12
	mov	eax, DWORD PTR -200[rbp]
	mov	edi, eax
	call	close@PLT
	add	QWORD PTR -240[rbp], 16
	mov	rax, QWORD PTR -240[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -240[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	mov	rax, QWORD PTR -240[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, rax
	lea	rsi, .LC8[rip]
	mov	edi, 71
	mov	eax, 0
	call	err@PLT
.L12:
	mov	DWORD PTR -208[rbp], 0
	lea	rcx, -216[rbp]
	mov	eax, DWORD PTR -196[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	cmp	eax, -1
	jne	.L13
	lea	rsi, .LC9[rip]
	mov	edi, 71
	mov	eax, 0
	call	err@PLT
.L13:
	mov	eax, DWORD PTR -216[rbp]
	test	eax, eax
	je	.L14
	mov	DWORD PTR -208[rbp], 1
.L14:
	mov	eax, DWORD PTR -208[rbp]
	mov	edi, eax
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC10:
	.string	"Usage: pamei label command [args ..]\n"
	.text
	.globl	emit_help
	.type	emit_help, @function
emit_help:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 37
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	edi, 64
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	emit_help, .-emit_help
	.section	.rodata
.LC11:
	.string	"~/var/cache/pamei"
.LC12:
	.string	"HOME"
.LC13:
	.string	"cannot find HOME directory"
.LC14:
	.string	"%s%s"
.LC15:
	.string	"cannot lookup user %s"
.LC16:
	.string	""
	.text
	.globl	texpand
	.type	texpand, @function
texpand:
.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, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	QWORD PTR -56[rbp], 0
	je	.L18
	mov	rax, QWORD PTR -56[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L19
.L18:
	lea	rdi, .LC11[rip]
	call	texpand
	jmp	.L20
.L19:
	mov	rax, QWORD PTR -56[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 126
	jne	.L21
	mov	rax, QWORD PTR -56[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	je	.L22
	mov	rax, QWORD PTR -56[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L23
.L22:
	lea	rdi, .LC12[rip]
	call	getenv@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L24
	call	getuid@PLT
	mov	edi, eax
	call	getpwuid@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L25
	lea	rsi, .LC13[rip]
	mov	edi, 74
	mov	eax, 0
	call	err@PLT
.L25:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR -40[rbp], rax
.L24:
	mov	rax, QWORD PTR -56[rbp]
	lea	rcx, 1[rax]
	mov	rdx, QWORD PTR -40[rbp]
	lea	rax, -48[rbp]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	mov	eax, 0
	call	asprintf@PLT
	jmp	.L26
.L23:
	mov	rax, QWORD PTR -56[rbp]
	add	rax, 1
	mov	rdi, rax
	call	strdup@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 47
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	je	.L27
	mov	rax, QWORD PTR -24[rbp]
	mov	BYTE PTR [rax], 0
.L27:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	getpwnam@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L28
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, rax
	lea	rsi, .LC15[rip]
	mov	edi, 71
	mov	eax, 0
	call	err@PLT
.L28:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	free@PLT
	cmp	QWORD PTR -24[rbp], 0
	jne	.L29
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	jmp	.L30
.L29:
	lea	rax, .LC16[rip]
.L30:
	mov	rdx, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR 32[rdx]
	lea	rdi, -48[rbp]
	mov	rcx, rax
	lea	rsi, .LC14[rip]
	mov	eax, 0
	call	asprintf@PLT
.L26:
	mov	rax, QWORD PTR -48[rbp]
	jmp	.L20
.L21:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	strdup@PLT
.L20:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	texpand, .-texpand
	.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	"65181.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"PAMEI_DIR\000"
	.align	2
.LC1:
	.ascii	"could not stat '%s'\000"
	.align	2
.LC2:
	.ascii	"%s/%s\000"
	.align	2
.LC3:
	.ascii	"path is too long\000"
	.align	2
.LC4:
	.ascii	"open failed '%s'\000"
	.align	2
.LC5:
	.ascii	"resource is locked\000"
	.align	2
.LC6:
	.ascii	"flock failed\000"
	.align	2
.LC7:
	.ascii	"fork failed\000"
	.align	2
.LC8:
	.ascii	"could not exec '%s'\000"
	.align	2
.LC9:
	.ascii	"waitpid failed\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 144
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #144
	str	r0, [fp, #-144]
	str	r1, [fp, #-148]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-144]
	cmp	r3, #2
	bgt	.L2
	bl	emit_help
.L2:
	ldr	r0, .L16+4
	bl	getenv
	mov	r3, r0
	mov	r0, r3
	bl	texpand
	str	r0, [fp, #-124]
	sub	r3, fp, #100
	mov	r1, r3
	ldr	r0, [fp, #-124]
	bl	stat
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r2, [fp, #-124]
	ldr	r1, .L16+8
	mov	r0, #74
	bl	err
.L3:
	ldr	r3, [fp, #-148]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-120]
	ldr	r0, [fp, #-120]
	bl	strlen
	str	r0, [fp, #-116]
	mov	r3, #0
	str	r3, [fp, #-132]
	b	.L4
.L6:
	ldr	r3, [fp, #-132]
	ldr	r2, [fp, #-120]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	bne	.L5
	ldr	r3, [fp, #-132]
	ldr	r2, [fp, #-120]
	add	r3, r2, r3
	mov	r2, #95
	strb	r2, [r3]
.L5:
	ldr	r3, [fp, #-132]
	add	r3, r3, #1
	str	r3, [fp, #-132]
.L4:
	ldr	r3, [fp, #-132]
	ldr	r2, [fp, #-116]
	cmp	r2, r3
	bhi	.L6
	sub	r0, fp, #140
	ldr	r3, [fp, #-120]
	ldr	r2, [fp, #-124]
	ldr	r1, .L16+12
	bl	asprintf
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	cmp	r3, #4096
	blt	.L7
	ldr	r1, .L16+16
	mov	r0, #74
	bl	err
.L7:
	ldr	r0, [fp, #-124]
	bl	free
	ldr	r3, [fp, #-140]
	ldr	r2, .L16+20
	mov	r1, #64
	mov	r0, r3
	bl	open
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmn	r3, #1
	bne	.L8
	ldr	r3, [fp, #-140]
	mov	r2, r3
	ldr	r1, .L16+24
	mov	r0, #74
	bl	err
.L8:
	mov	r1, #6
	ldr	r0, [fp, #-108]
	bl	flock
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	bne	.L10
	ldr	r1, .L16+28
	mov	r0, #2
	bl	errx
.L10:
	ldr	r1, .L16+32
	mov	r0, #74
	bl	err
.L9:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmn	r3, #1
	bne	.L11
	ldr	r1, .L16+36
	mov	r0, #71
	bl	err
.L11:
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bne	.L12
	ldr	r0, [fp, #-108]
	bl	close
	ldr	r3, [fp, #-148]
	add	r3, r3, #8
	str	r3, [fp, #-148]
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	ldr	r1, [fp, #-148]
	mov	r0, r3
	bl	execvp
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L16+40
	mov	r0, #71
	bl	err
.L12:
	mov	r3, #0
	str	r3, [fp, #-128]
	sub	r3, fp, #136
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	waitpid
	mov	r3, r0
	cmn	r3, #1
	bne	.L13
	ldr	r1, .L16+44
	mov	r0, #71
	bl	err
.L13:
	ldr	r3, [fp, #-136]
	cmp	r3, #0
	beq	.L14
	mov	r3, #1
	str	r3, [fp, #-128]
.L14:
	ldr	r0, [fp, #-128]
	bl	exit
.L17:
	.align	2
.L16:
	.word	.LC10
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	438
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.section	.rodata
	.align	2
.LC11:
	.ascii	"Usage: pamei label command [args ..]\012\000"
	.text
	.align	2
	.global	emit_help
	.syntax unified
	.arm
	.fpu softvfp
	.type	emit_help, %function
emit_help:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L19
	ldr	r3, [r3]
	mov	r2, #37
	mov	r1, #1
	ldr	r0, .L19+4
	bl	fwrite
	mov	r0, #64
	bl	exit
.L20:
	.align	2
.L19:
	.word	stderr
	.word	.LC11
	.size	emit_help, .-emit_help
	.section	.rodata
	.align	2
.LC12:
	.ascii	"~/var/cache/pamei\000"
	.align	2
.LC13:
	.ascii	"HOME\000"
	.align	2
.LC14:
	.ascii	"cannot find HOME directory\000"
	.align	2
.LC15:
	.ascii	"%s%s\000"
	.align	2
.LC16:
	.ascii	"cannot lookup user %s\000"
	.align	2
.LC17:
	.ascii	"\000"
	.align	2
.LC18:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	texpand
	.syntax unified
	.arm
	.fpu softvfp
	.type	texpand, %function
texpand:
	@ 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, .L36
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L22
	ldr	r3, [fp, #-32]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L23
.L22:
	ldr	r0, .L36+4
	bl	texpand
	mov	r3, r0
	b	.L24
.L23:
	ldr	r3, [fp, #-32]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #126
	bne	.L25
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	beq	.L26
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L27
.L26:
	ldr	r0, .L36+8
	bl	getenv
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L28
	bl	getuid
	mov	r3, r0
	mov	r0, r3
	bl	getpwuid
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L29
	ldr	r1, .L36+12
	mov	r0, #74
	bl	err
.L29:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #20]
	str	r3, [fp, #-24]
.L28:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	sub	r0, fp, #28
	ldr	r2, [fp, #-24]
	ldr	r1, .L36+16
	bl	asprintf
	b	.L30
.L27:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	mov	r0, r3
	bl	strdup
	mov	r3, r0
	str	r3, [fp, #-20]
	mov	r1, #47
	ldr	r0, [fp, #-20]
	bl	strchr
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L31
	ldr	r3, [fp, #-16]
	mov	r2, #0
	strb	r2, [r3]
.L31:
	ldr	r0, [fp, #-20]
	bl	getpwnam
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L32
	ldr	r2, [fp, #-20]
	ldr	r1, .L36+20
	mov	r0, #71
	bl	err
.L32:
	ldr	r0, [fp, #-20]
	bl	free
	ldr	r3, [fp, #-12]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L33
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	add	r3, r3, #1
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	b	.L34
.L33:
	ldr	r3, .L36+24
.L34:
	sub	r0, fp, #28
	mov	r2, r1
	ldr	r1, .L36+16
	bl	asprintf
.L30:
	ldr	r3, [fp, #-28]
	b	.L24
.L25:
	ldr	r0, [fp, #-32]
	bl	strdup
	mov	r3, r0
.L24:
	ldr	r2, .L36
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L35
	bl	__stack_chk_fail
.L35:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L37:
	.align	2
.L36:
	.word	.LC18
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.size	texpand, .-texpand
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
