	.file	"22965.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: dirname string\n"
.LC1:
	.string	"//"
.LC2:
	.string	"."
	.text
	.globl	posix_dirname
	.type	posix_dirname, @function
posix_dirname:
.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	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	cmp	DWORD PTR -36[rbp], 2
	je	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strdup@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR stdout[rip]
	mov	esi, 0
	mov	rdi, rax
	call	setbuf@PLT
.L4:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L32
	nop
.L5:
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -24[rbp], rax
	mov	DWORD PTR -28[rbp], 1
	jmp	.L7
.L10:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	je	.L8
	mov	DWORD PTR -28[rbp], 0
	jmp	.L9
.L8:
	add	QWORD PTR -24[rbp], 1
.L7:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L10
.L9:
	cmp	DWORD PTR -28[rbp], 0
	je	.L33
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	mov	BYTE PTR [rax], 0
	jmp	.L12
.L33:
	nop
.L11:
	mov	rax, QWORD PTR -16[rbp]
	sub	eax, 1
	mov	DWORD PTR -32[rbp], eax
	jmp	.L13
.L17:
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	jne	.L34
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -32[rbp], 1
.L13:
	cmp	DWORD PTR -32[rbp], 0
	jns	.L17
	jmp	.L16
.L34:
	nop
.L16:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	QWORD PTR -16[rbp], rax
.L18:
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 47
	mov	rdi, rax
	call	strchr@PLT
	test	rax, rax
	jne	.L35
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L3
.L35:
	nop
.L19:
	mov	rax, QWORD PTR -16[rbp]
	sub	eax, 1
	mov	DWORD PTR -32[rbp], eax
	jmp	.L20
.L24:
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	je	.L36
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	sub	DWORD PTR -32[rbp], 1
.L20:
	cmp	DWORD PTR -32[rbp], 0
	jns	.L24
	jmp	.L23
.L36:
	nop
.L23:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	QWORD PTR -16[rbp], rax
	jmp	.L25
.L6:
.L32:
	nop
.L25:
	mov	rax, QWORD PTR -16[rbp]
	sub	eax, 1
	mov	DWORD PTR -32[rbp], eax
	jmp	.L26
.L30:
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	jne	.L37
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -32[rbp], 1
.L26:
	cmp	DWORD PTR -32[rbp], 0
	jns	.L30
	jmp	.L29
.L37:
	nop
.L29:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	QWORD PTR -16[rbp], rax
.L31:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L38
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], 47
	mov	QWORD PTR -16[rbp], 1
	jmp	.L12
.L38:
	nop
.L12:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	puts@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	posix_dirname, .-posix_dirname
	.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	"22965.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: dirname string\012\000"
	.align	2
.LC1:
	.ascii	"//\000"
	.align	2
.LC2:
	.ascii	".\000"
	.text
	.align	2
	.global	posix_dirname
	.syntax unified
	.arm
	.fpu softvfp
	.type	posix_dirname, %function
posix_dirname:
	@ 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]
	str	r1, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	beq	.L2
	ldr	r3, .L39
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L39+4
	bl	fwrite
	mov	r3, #1
	b	.L3
.L2:
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	strdup
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	str	r0, [fp, #-12]
	ldr	r3, .L39+8
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	setbuf
.L4:
	ldr	r1, .L39+12
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L32
	nop
.L5:
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-16]
	mov	r3, #1
	str	r3, [fp, #-20]
	b	.L7
.L10:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	beq	.L8
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L9
.L8:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L7:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L10
.L9:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L33
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	mov	r2, #0
	strb	r2, [r3]
	b	.L12
.L33:
	nop
.L11:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-24]
	b	.L13
.L17:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	bne	.L34
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L13:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L17
	b	.L16
.L34:
	nop
.L16:
	ldr	r0, [fp, #-8]
	bl	strlen
	str	r0, [fp, #-12]
.L18:
	mov	r1, #47
	ldr	r0, [fp, #-8]
	bl	strchr
	mov	r3, r0
	cmp	r3, #0
	bne	.L35
	ldr	r0, [fp, #-8]
	bl	free
	ldr	r0, .L39+16
	bl	puts
	mov	r3, #0
	b	.L3
.L35:
	nop
.L19:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-24]
	b	.L20
.L24:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	beq	.L36
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	str	r3, [fp, #-24]
.L20:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L24
	b	.L23
.L36:
	nop
.L23:
	ldr	r0, [fp, #-8]
	bl	strlen
	str	r0, [fp, #-12]
	b	.L25
.L6:
.L32:
	nop
.L25:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-24]
	b	.L26
.L30:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	bne	.L37
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L26:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L30
	b	.L29
.L37:
	nop
.L29:
	ldr	r0, [fp, #-8]
	bl	strlen
	str	r0, [fp, #-12]
.L31:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L38
	ldr	r3, [fp, #-8]
	mov	r2, #47
	strb	r2, [r3]
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L12
.L38:
	nop
.L12:
	ldr	r0, [fp, #-8]
	bl	puts
	ldr	r0, [fp, #-8]
	bl	free
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L40:
	.align	2
.L39:
	.word	stderr
	.word	.LC0
	.word	stdout
	.word	.LC1
	.word	.LC2
	.size	posix_dirname, .-posix_dirname
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
