	.file	"30728.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/"
.LC1:
	.string	"/dev/null"
	.text
	.globl	daemonize
	.type	daemonize, @function
daemonize:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -24
	mov	DWORD PTR -20[rbp], 0
	call	fork@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L2
	cmp	DWORD PTR -20[rbp], -1
	jne	.L3
	mov	eax, -1
	jmp	.L4
.L3:
	mov	edi, 0
	call	_exit@PLT
.L2:
	call	setsid@PLT
	cmp	eax, -1
	jne	.L5
	mov	eax, -1
	jmp	.L4
.L5:
	call	fork@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L6
	cmp	DWORD PTR -20[rbp], -1
	jne	.L7
	mov	eax, -1
	jmp	.L4
.L7:
	mov	edi, 0
	call	_exit@PLT
.L6:
	lea	rdi, .LC0[rip]
	call	chdir@PLT
	or	DWORD PTR -20[rbp], eax
	mov	edi, 0
	call	close@PLT
	mov	ebx, eax
	mov	edi, 1
	call	close@PLT
	or	ebx, eax
	mov	edi, 2
	call	close@PLT
	or	eax, ebx
	or	DWORD PTR -20[rbp], eax
	mov	esi, 2
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	open@PLT
	test	eax, eax
	jne	.L8
	mov	edi, 0
	call	dup@PLT
	cmp	eax, -1
	je	.L8
	mov	edi, 0
	call	dup@PLT
	cmp	eax, -1
	je	.L8
	cmp	DWORD PTR -20[rbp], 0
	je	.L9
.L8:
	mov	edi, 1
	call	_exit@PLT
.L9:
	mov	eax, 0
.L4:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	daemonize, .-daemonize
	.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	"30728.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/\000"
	.align	2
.LC1:
	.ascii	"/dev/null\000"
	.text
	.align	2
	.global	daemonize
	.syntax unified
	.arm
	.fpu softvfp
	.type	daemonize, %function
daemonize:
	@ 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
	mov	r3, #0
	str	r3, [fp, #-16]
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L2
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L3
	mvn	r3, #0
	b	.L4
.L3:
	mov	r0, #0
	bl	_exit
.L2:
	bl	setsid
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	mvn	r3, #0
	b	.L4
.L5:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L6
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L7
	mvn	r3, #0
	b	.L4
.L7:
	mov	r0, #0
	bl	_exit
.L6:
	ldr	r0, .L10
	bl	chdir
	mov	r2, r0
	ldr	r3, [fp, #-16]
	orr	r3, r3, r2
	str	r3, [fp, #-16]
	mov	r0, #0
	bl	close
	mov	r4, r0
	mov	r0, #1
	bl	close
	mov	r3, r0
	orr	r4, r4, r3
	mov	r0, #2
	bl	close
	mov	r3, r0
	orr	r3, r4, r3
	ldr	r2, [fp, #-16]
	orr	r3, r2, r3
	str	r3, [fp, #-16]
	mov	r1, #2
	ldr	r0, .L10+4
	bl	open
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
	mov	r0, #0
	bl	dup
	mov	r3, r0
	cmn	r3, #1
	beq	.L8
	mov	r0, #0
	bl	dup
	mov	r3, r0
	cmn	r3, #1
	beq	.L8
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L9
.L8:
	mov	r0, #1
	bl	_exit
.L9:
	mov	r3, #0
.L4:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	.LC1
	.size	daemonize, .-daemonize
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
