static CharDriverState *qemu_chr_open_pipe(QemuOpts *opts)

{

    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 NULL;

    }



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

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

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

    TFR(fd_out = 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 = open(filename, O_RDWR | O_BINARY));

        if (fd_in < 0)

            return NULL;

    }

    return qemu_chr_open_fd(fd_in, fd_out);

}

static CharDriverState *qemu_chr_open_pipe(QemuOpts *opts)

{

    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 NULL;

    }



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

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

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

    TFR(fd_out = 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 = open(filename, O_RDWR | O_BINARY));

        if (fd_in < 0)

            return NULL;

    }

    return qemu_chr_open_fd(fd_in, fd_out);

}

    TFR(fd_in = open(filename_in, O_RDWR | O_BINARY));     TFR(fd_out = open(filename_out, O_RDWR | O_BINARY));
static CharDriverState *FUNC_0(QemuOpts *opts)

{

    int VAR_0, VAR_1;

    char VAR_2[256], VAR_3[256];

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



    if (VAR_4 == NULL) {

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

        return NULL;

    }



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

    snprintf(VAR_3, 256, "%s.out", VAR_4);

    TFR(VAR_0 = open(VAR_2, O_RDWR | O_BINARY));

    TFR(VAR_1 = open(VAR_3, O_RDWR | O_BINARY));

    if (VAR_0 < 0 || VAR_1 < 0) {

	if (VAR_0 >= 0)

	    close(VAR_0);

	if (VAR_1 >= 0)

	    close(VAR_1);

        TFR(VAR_0 = VAR_1 = open(VAR_4, O_RDWR | O_BINARY));

        if (VAR_0 < 0)

            return NULL;

    }

    return qemu_chr_open_fd(VAR_0, VAR_1);

}

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