	.file	"840334.c"
	.intel_syntax noprefix
	.text
	.globl	signal_handler
	.type	signal_handler, @function
signal_handler:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	cmp	DWORD PTR -4[rbp], 1
	je	.L6
	cmp	DWORD PTR -4[rbp], 15
	je	.L7
	jmp	.L5
.L6:
	nop
	jmp	.L8
.L7:
	nop
.L5:
.L8:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	signal_handler, .-signal_handler
	.section	.rodata
.LC0:
	.string	"/dev/null"
.LC1:
	.string	"%d\n"
	.text
	.globl	daemonize
	.type	daemonize, @function
daemonize:
.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, 304
	mov	QWORD PTR -296[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	fork@PLT
	mov	DWORD PTR -280[rbp], eax
	mov	QWORD PTR -272[rbp], 0
	mov	QWORD PTR -264[rbp], 0
	mov	QWORD PTR -256[rbp], 0
	mov	QWORD PTR -248[rbp], 0
	mov	QWORD PTR -240[rbp], 0
	mov	QWORD PTR -232[rbp], 0
	mov	QWORD PTR -224[rbp], 0
	mov	QWORD PTR -216[rbp], 0
	mov	QWORD PTR -208[rbp], 0
	mov	QWORD PTR -200[rbp], 0
	mov	QWORD PTR -192[rbp], 0
	mov	QWORD PTR -184[rbp], 0
	mov	QWORD PTR -176[rbp], 0
	mov	QWORD PTR -168[rbp], 0
	mov	QWORD PTR -160[rbp], 0
	mov	QWORD PTR -152[rbp], 0
	mov	QWORD PTR -144[rbp], 0
	mov	QWORD PTR -136[rbp], 0
	mov	QWORD PTR -128[rbp], 0
	mov	QWORD PTR -120[rbp], 0
	mov	QWORD PTR -112[rbp], 0
	mov	QWORD PTR -104[rbp], 0
	mov	QWORD PTR -96[rbp], 0
	mov	QWORD PTR -88[rbp], 0
	mov	QWORD PTR -80[rbp], 0
	mov	QWORD PTR -72[rbp], 0
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	QWORD PTR -32[rbp], 0
	mov	QWORD PTR -24[rbp], 0
	cmp	DWORD PTR -280[rbp], 0
	jns	.L10
	mov	edi, 1
	call	exit@PLT
.L10:
	cmp	DWORD PTR -280[rbp], 0
	jle	.L11
	mov	edi, 0
	call	exit@PLT
.L11:
	call	setsid@PLT
	call	getdtablesize@PLT
	mov	DWORD PTR -284[rbp], eax
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -284[rbp]
	mov	edi, eax
	call	close@PLT
	sub	DWORD PTR -284[rbp], 1
.L12:
	cmp	DWORD PTR -284[rbp], 0
	jns	.L13
	mov	esi, 2
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -284[rbp], eax
	mov	eax, DWORD PTR -284[rbp]
	mov	edi, eax
	call	dup@PLT
	mov	eax, DWORD PTR -284[rbp]
	mov	edi, eax
	call	dup@PLT
	mov	edi, 23
	call	umask@PLT
	mov	rax, QWORD PTR -296[rbp]
	mov	edx, 416
	mov	esi, 66
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -276[rbp], eax
	cmp	DWORD PTR -276[rbp], 0
	jns	.L14
	mov	edi, 1
	call	exit@PLT
.L14:
	mov	eax, DWORD PTR -276[rbp]
	mov	edx, 0
	mov	esi, 2
	mov	edi, eax
	call	lockf@PLT
	test	eax, eax
	jns	.L15
	mov	edi, 0
	call	exit@PLT
.L15:
	call	getpid@PLT
	mov	edx, eax
	lea	rax, -272[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -272[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rcx, -272[rbp]
	mov	eax, DWORD PTR -276[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	esi, 1
	mov	edi, 17
	call	signal@PLT
	lea	rsi, signal_handler[rip]
	mov	edi, 1
	call	signal@PLT
	lea	rsi, signal_handler[rip]
	mov	edi, 15
	call	signal@PLT
	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	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	"840334.c"
	.text
	.align	2
	.global	signal_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	signal_handler, %function
signal_handler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	beq	.L6
	ldr	r3, [fp, #-8]
	cmp	r3, #15
	beq	.L7
	b	.L5
.L6:
	nop
	b	.L8
.L7:
	nop
.L5:
.L8:
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	signal_handler, .-signal_handler
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/dev/null\000"
	.align	2
.LC1:
	.ascii	"%d\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	daemonize
	.syntax unified
	.arm
	.fpu softvfp
	.type	daemonize, %function
daemonize:
	@ args = 0, pretend = 0, frame = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #280
	str	r0, [fp, #-280]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-272]
	mov	r3, #0
	str	r3, [fp, #-264]
	sub	r3, fp, #260
	mov	r2, #252
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-272]
	cmp	r3, #0
	bge	.L10
	mov	r0, #1
	bl	exit
.L10:
	ldr	r3, [fp, #-272]
	cmp	r3, #0
	ble	.L11
	mov	r0, #0
	bl	exit
.L11:
	bl	setsid
	bl	getdtablesize
	str	r0, [fp, #-276]
	b	.L12
.L13:
	ldr	r0, [fp, #-276]
	bl	close
	ldr	r3, [fp, #-276]
	sub	r3, r3, #1
	str	r3, [fp, #-276]
.L12:
	ldr	r3, [fp, #-276]
	cmp	r3, #0
	bge	.L13
	mov	r1, #2
	ldr	r0, .L18+4
	bl	open
	str	r0, [fp, #-276]
	ldr	r0, [fp, #-276]
	bl	dup
	ldr	r0, [fp, #-276]
	bl	dup
	mov	r0, #23
	bl	umask
	mov	r2, #416
	mov	r1, #66
	ldr	r0, [fp, #-280]
	bl	open
	str	r0, [fp, #-268]
	ldr	r3, [fp, #-268]
	cmp	r3, #0
	bge	.L14
	mov	r0, #1
	bl	exit
.L14:
	mov	r2, #0
	mov	r1, #2
	ldr	r0, [fp, #-268]
	bl	lockf
	mov	r3, r0
	cmp	r3, #0
	bge	.L15
	mov	r0, #0
	bl	exit
.L15:
	bl	getpid
	mov	r2, r0
	sub	r3, fp, #264
	ldr	r1, .L18+8
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #264
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #264
	mov	r1, r3
	ldr	r0, [fp, #-268]
	bl	write
	mov	r1, #1
	mov	r0, #17
	bl	signal
	ldr	r1, .L18+12
	mov	r0, #1
	bl	signal
	ldr	r1, .L18+12
	mov	r0, #15
	bl	signal
	mov	r3, #0
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.word	signal_handler
	.size	daemonize, .-daemonize
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
