// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/close_fds.c
// Function: init
static void __attribute__((constructor)) init()
{
	struct dirent *ent;
	ssize_t size = 0;
	DIR *d;

	d = opendir(OPEN_FILES_DIR);
	if (!d)
		return;

	for (ent = readdir(d); ent; ent = readdir(d)) {
		int fd;

		if (ent->d_name[0] == '.')
			continue;

		fd = atoi(ent->d_name);
		if (fd == dirfd(d))
			continue;

		if (fd >= size * FD_SETSIZE) {
			int i;
			ssize_t new_size;

			new_size = (fd / FD_SETSIZE) + 1;
			open_files_set = realloc(open_files_set, new_size * sizeof(fd_set));
			if (open_files_set == NULL)
				_exit(EXIT_FAILURE);

			for (i = size; i < new_size; i++)
				FD_ZERO(&(open_files_set[i]));

			size = new_size;
		}

		if (fd > open_files_max_fd)
			open_files_max_fd = fd;

		FD_SET(fd % FD_SETSIZE, &(open_files_set[fd / FD_SETSIZE]));
	}
	closedir(d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq $0x0, -0x10(%rbp)
leaq 0x4162(%rip), %rdi      # 0x12ce9
callq 0x4390
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xeb9c
jmp 0xed5d
movq -0x18(%rbp), %rdi
callq 0x4430
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xed54
movq -0x8(%rbp), %rax
movsbl 0x13(%rax), %eax
cmpl $0x2e, %eax
jne 0xebc6
jmp 0xed42
movq -0x8(%rbp), %rdi
addq $0x13, %rdi
callq 0x44f0
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x44e0
movl %eax, %ecx
movl -0x3c(%rbp), %eax
cmpl %ecx, %eax
jne 0xebf3
jmp 0xed42
movslq -0x1c(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq $0xa, %rcx
cmpq %rcx, %rax
jl 0xecb5
movl -0x1c(%rbp), %eax
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
addl $0x1, %eax
cltq
movq %rax, -0x28(%rbp)
movq 0x1c59d(%rip), %rdi     # 0x2b1c0
movq -0x28(%rbp), %rsi
shlq $0x7, %rsi
callq 0x4810
movq %rax, 0x1c589(%rip)     # 0x2b1c0
cmpq $0x0, 0x1c581(%rip)     # 0x2b1c0
jne 0xec4b
movl $0x1, %edi
callq 0x42a0
movq -0x10(%rbp), %rax
movl %eax, -0x20(%rbp)
movslq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0xecad
jmp 0xec5e
movq 0x1c55b(%rip), %rax     # 0x2b1c0
movslq -0x20(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpq $0x10, %rax
jae 0xec9e
movq -0x38(%rbp), %rax
movl -0x2c(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xec7b
jmp 0xeca0
jmp 0xeca2
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xec52
movq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x1c50a(%rip), %eax     # 0x2b1c8
jle 0xecc9
movl -0x1c(%rbp), %eax
movl %eax, 0x1c4ff(%rip)     # 0x2b1c8
movl -0x1c(%rbp), %eax
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
movl %edx, %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x50(%rbp)
movq 0x1c4cb(%rip), %rax     # 0x2b1c0
movq %rax, -0x58(%rbp)
movl -0x1c(%rbp), %eax
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
movl %eax, %ecx
movq -0x58(%rbp), %rax
movslq %ecx, %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x1c(%rbp), %eax
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
movl %edx, %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x50(%rbp), %rdx
movl %eax, %ecx
movq -0x48(%rbp), %rax
movslq %ecx, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rdi
callq 0x4430
movq %rax, -0x8(%rbp)
jmp 0xeba9
movq -0x18(%rbp), %rdi
callq 0x4740
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)