static int qemu_chr_open_pipe(QemuOpts *opts, CharDriverState **_chr)

{

    int fd_in, fd_out;

    char filename_in[256], filename_out[256];

    const char *filename = qemu_opt_get(opts, "path");



    if (filename == NULL) {

        fprintf(stderr, "chardev: pipe: no filename given\n");

        return -EINVAL;

    }



    snprintf(filename_in, 256, "%s.in", filename);

    snprintf(filename_out, 256, "%s.out", filename);

    TFR(fd_in = qemu_open(filename_in, O_RDWR | O_BINARY));

    TFR(fd_out = qemu_open(filename_out, O_RDWR | O_BINARY));

    if (fd_in < 0 || fd_out < 0) {

	if (fd_in >= 0)

	    close(fd_in);

	if (fd_out >= 0)

	    close(fd_out);

        TFR(fd_in = fd_out = qemu_open(filename, O_RDWR | O_BINARY));

        if (fd_in < 0) {

            return -errno;

        }

    }



    *_chr = qemu_chr_open_fd(fd_in, fd_out);

    return 0;

}

static int qemu_chr_open_pipe(QemuOpts *opts, CharDriverState **_chr)

{

    int fd_in, fd_out;

    char filename_in[256], filename_out[256];

    const char *filename = qemu_opt_get(opts, "path");



    if (filename == NULL) {

        fprintf(stderr, "chardev: pipe: no filename given\n");

        return -EINVAL;

    }



    snprintf(filename_in, 256, "%s.in", filename);

    snprintf(filename_out, 256, "%s.out", filename);

    TFR(fd_in = qemu_open(filename_in, O_RDWR | O_BINARY));

    TFR(fd_out = qemu_open(filename_out, O_RDWR | O_BINARY));

    if (fd_in < 0 || fd_out < 0) {

	if (fd_in >= 0)

	    close(fd_in);

	if (fd_out >= 0)

	    close(fd_out);

        TFR(fd_in = fd_out = qemu_open(filename, O_RDWR | O_BINARY));

        if (fd_in < 0) {

            return -errno;

        }

    }



    *_chr = qemu_chr_open_fd(fd_in, fd_out);

    return 0;

}

    return 0;     return 0;     return 0;     return 0;     return 0; static int qemu_chr_open_pipe(QemuOpts *opts, CharDriverState **_chr)         return -EINVAL;         TFR(fd_in = fd_out = qemu_open(filename, O_RDWR | O_BINARY));         if (fd_in < 0) {             return -errno;     *_chr = qemu_chr_open_fd(fd_in, fd_out);     return 0;     return 0;     return 0;     return 0;     return 0;     return 0;     return 0;     return 0;     return 0;     return 0;     return 0;     return 0;         return -EINVAL;         return -EINVAL;     return 0;
static int FUNC_0(QemuOpts *VAR_0, CharDriverState **VAR_1)

{

    int VAR_2, VAR_3;

    char VAR_4[256], VAR_5[256];

    const char *VAR_6 = qemu_opt_get(VAR_0, "path");



    if (VAR_6 == NULL) {

        fprintf(stderr, "chardev: pipe: no VAR_6 given\n");

        return -EINVAL;

    }



    snprintf(VAR_4, 256, "%s.in", VAR_6);

    snprintf(VAR_5, 256, "%s.out", VAR_6);

    TFR(VAR_2 = qemu_open(VAR_4, O_RDWR | O_BINARY));

    TFR(VAR_3 = qemu_open(VAR_5, O_RDWR | O_BINARY));

    if (VAR_2 < 0 || VAR_3 < 0) {

	if (VAR_2 >= 0)

	    close(VAR_2);

	if (VAR_3 >= 0)

	    close(VAR_3);

        TFR(VAR_2 = VAR_3 = qemu_open(VAR_6, O_RDWR | O_BINARY));

        if (VAR_2 < 0) {

            return -errno;

        }

    }



    *VAR_1 = qemu_chr_open_fd(VAR_2, VAR_3);

    return 0;

}

static int FUNC_0(QemuOpts *VAR_0, CharDriverState **VAR_1)
{ int VAR_2, VAR_3; char VAR_4[256], VAR_5[256]; const char *VAR_6 = qemu_opt_get(VAR_0, "path"); if (VAR_6 == NULL) { fprintf(stderr, "chardev: pipe: no VAR_6 given\n"); return -EINVAL; } snprintf(VAR_4, 256, "%s.in", VAR_6); snprintf(VAR_5, 256, "%s.out", VAR_6); TFR(VAR_2 = qemu_open(VAR_4, O_RDWR | O_BINARY)); TFR(VAR_3 = qemu_open(VAR_5, O_RDWR | O_BINARY)); if (VAR_2 < 0 || VAR_3 < 0) { if (VAR_2 >= 0)
close(VAR_2); if (VAR_3 >= 0)
close(VAR_3); TFR(VAR_2 = VAR_3 = qemu_open(VAR_6, O_RDWR | O_BINARY)); if (VAR_2 < 0) { return -errno; } } *VAR_1 = qemu_chr_open_fd(VAR_2, VAR_3); return 0; }