// File: /workspace/github_c_makefile_star2_O0/albertito[P]libfiu/libfiu/fiu-rc.c
// Function: fiu_rc_fifo
static int _fiu_rc_fifo(const char *basename)
{
	pthread_t thread;

	/* see rc_fifo_thread() */
	rec_count++;

	/* Allocate the pipe paths. Will be composed of
	 * "<basename>-<pid>.[in|out]", so leave plenty of room for the last
	 * part, to handle potentially long pids.
	 * These live through the entire life of the binary and are never
	 * freed. */
	int path_len = strlen(basename) + 40;
	npipe_path_in = malloc(path_len);
	npipe_path_out = malloc(path_len);

	snprintf(npipe_path_in, path_len, "%s-%d.in", basename, getpid());
	snprintf(npipe_path_out, path_len, "%s-%d.out", basename, getpid());

	if (mkfifo(npipe_path_in, 0600) != 0 && errno != EEXIST) {
		rec_count--;
		return -1;
	}

	if (mkfifo(npipe_path_out, 0600) != 0 && errno != EEXIST) {
		unlink(npipe_path_in);
		rec_count--;
		return -1;
	}

	if (pthread_create(&thread, NULL, rc_fifo_thread, NULL) != 0) {
		unlink(npipe_path_in);
		unlink(npipe_path_out);
		rec_count--;
		return -1;
	}

	atexit(fifo_atexit);

	rec_count--;
	return 0;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
leaq 0x4c07(%rip), %rdi      # 0x7fd8
callq 0x21f0
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x48(%rsp), %rdi
callq 0x2100
addq $0x28, %rax
movl %eax, 0x3c(%rsp)
movslq 0x3c(%rsp), %rdi
callq 0x2250
movq %rax, 0x4e1d(%rip)      # 0x8220
movslq 0x3c(%rsp), %rdi
callq 0x2250
movq %rax, 0x4e14(%rip)      # 0x8228
movq 0x4e05(%rip), %rax      # 0x8220
movq %rax, 0x8(%rsp)
movslq 0x3c(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x18(%rsp)
callq 0x20f0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rcx
movl %eax, %r8d
leaq 0x2cda(%rip), %rdx      # 0x612c
movb $0x0, %al
callq 0x2140
movq 0x4dc8(%rip), %rax      # 0x8228
movq %rax, 0x20(%rsp)
movslq 0x3c(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
callq 0x20f0
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rcx
movl %eax, %r8d
leaq 0x2c9e(%rip), %rdx      # 0x6135
movb $0x0, %al
callq 0x2140
movq 0x4d7b(%rip), %rdi      # 0x8220
movl $0x180, %esi            # imm = 0x180
callq 0x2220
cmpl $0x0, %eax
je 0x34e2
callq 0x2060
cmpl $0x11, (%rax)
je 0x34e2
leaq 0x4b12(%rip), %rdi      # 0x7fd8
callq 0x21f0
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x35b3
movq 0x4d3f(%rip), %rdi      # 0x8228
movl $0x180, %esi            # imm = 0x180
callq 0x2220
cmpl $0x0, %eax
je 0x3532
callq 0x2060
cmpl $0x11, (%rax)
je 0x3532
movq 0x4d17(%rip), %rdi      # 0x8220
callq 0x2070
leaq 0x4ac2(%rip), %rdi      # 0x7fd8
callq 0x21f0
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x35b3
leaq 0x40(%rsp), %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq 0x8e(%rip), %rdx        # 0x35d0
movq %rcx, %rsi
callq 0x2290
cmpl $0x0, %eax
je 0x3588
movq 0x4cca(%rip), %rdi      # 0x8220
callq 0x2070
movq 0x4cc6(%rip), %rdi      # 0x8228
callq 0x2070
leaq 0x4a69(%rip), %rdi      # 0x7fd8
callq 0x21f0
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x35b3
leaq 0x191(%rip), %rdi       # 0x3720
callq 0x55b0
leaq 0x4a3c(%rip), %rdi      # 0x7fd8
callq 0x21f0
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)