FortuneTeller.smali

.class public Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;
.super Ljava/lang/Object;
.source "FortuneTeller.java"


# static fields
.field static NUM0:[[D

.field static NUM1:[[D

.field static NUM7:[[D


# direct methods
.method static constructor <clinit>()V
    .registers 7

    .prologue
    const/4 v6, 0x4

    const/4 v5, 0x3

    const/4 v4, 0x1

    const/4 v3, 0x0

    const/4 v2, 0x2

    .line 9
    new-array v0, v6, [[D

    new-array v1, v2, [D

    fill-array-data v1, :array_66

    aput-object v1, v0, v3

    new-array v1, v2, [D

    fill-array-data v1, :array_72

    aput-object v1, v0, v4

    new-array v1, v2, [D

    fill-array-data v1, :array_7e

    aput-object v1, v0, v2

    new-array v1, v2, [D

    fill-array-data v1, :array_8a

    aput-object v1, v0, v5

    sput-object v0, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->NUM0:[[D

    .line 17
    new-array v0, v6, [[D

    new-array v1, v2, [D

    fill-array-data v1, :array_96

    aput-object v1, v0, v3

    new-array v1, v2, [D

    fill-array-data v1, :array_a2

    aput-object v1, v0, v4

    new-array v1, v2, [D

    fill-array-data v1, :array_ae

    aput-object v1, v0, v2

    new-array v1, v2, [D

    fill-array-data v1, :array_ba

    aput-object v1, v0, v5

    sput-object v0, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->NUM1:[[D

    .line 25
    new-array v0, v6, [[D

    new-array v1, v2, [D

    fill-array-data v1, :array_c6

    aput-object v1, v0, v3

    new-array v1, v2, [D

    fill-array-data v1, :array_d2

    aput-object v1, v0, v4

    new-array v1, v2, [D

    fill-array-data v1, :array_de

    aput-object v1, v0, v2

    new-array v1, v2, [D

    fill-array-data v1, :array_ea

    aput-object v1, v0, v5

    sput-object v0, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->NUM7:[[D

    return-void

    .line 9
    :array_66
    .array-data 8
        0x0
        0x4143fc2600000000L    # 2619468.0
    .end array-data

    :array_72
    .array-data 8
        0x402e000000000000L    # 15.0
        0x4107afb000000000L    # 194038.0
    .end array-data

    :array_7e
    .array-data 8
        0x4041800000000000L    # 35.0
        0x40f79ac000000000L    # 96684.0
    .end array-data

    :array_8a
    .array-data 8
        0x409f400000000000L    # 2000.0
        0x40c2158000000000L    # 9259.0
    .end array-data

    .line 17
    :array_96
    .array-data 8
        0x0
        0x416e67c340000000L    # 1.5941146E7
    .end array-data

    :array_a2
    .array-data 8
        0x402e000000000000L    # 15.0
        0x413c727b00000000L    # 1864315.0
    .end array-data

    :array_ae
    .array-data 8
        0x4041800000000000L    # 35.0
        0x4128a54c00000000L    # 807590.0
    .end array-data

    :array_ba
    .array-data 8
        0x40af400000000000L    # 4000.0
        0x4077a00000000000L    # 378.0
    .end array-data

    .line 25
    :array_c6
    .array-data 8
        0x0
        0x418b326a18000000L    # 5.7036099E7
    .end array-data

    :array_d2
    .array-data 8
        0x402e000000000000L    # 15.0
        0x4155fdb500000000L    # 5764820.0
    .end array-data

    :array_de
    .array-data 8
        0x4041800000000000L    # 35.0
        0x4145e98680000000L    # 2872077.0
    .end array-data

    :array_ea
    .array-data 8
        0x40b7700000000000L    # 6000.0
        0x40b5570000000000L    # 5463.0
    .end array-data
.end method

.method public constructor <init>()V
    .registers 1

    .prologue
    .line 6
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static rank([D[DD)D
    .registers 8

    .prologue
    .line 142
    const/4 v0, 0x0

    aget-wide v0, p1, v0

    sub-double/2addr v0, p2

    invoke-static {p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->tg([D[D)D

    move-result-wide v2

    mul-double/2addr v0, v2

    .line 143
    const/4 v2, 0x1

    aget-wide v2, p1, v2

    add-double/2addr v0, v2

    return-wide v0
.end method

.method public static rank0(D)D
    .registers 12

    .prologue
    const/4 v9, 0x2

    const/4 v8, 0x1

    const-wide v6, 0x4041800000000000L    # 35.0

    const-wide/high16 v4, 0x402e000000000000L    # 15.0

    .line 37
    sget-object v0, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->NUM0:[[D

    .line 39
    const-wide/16 v2, 0x0

    cmpl-double v1, p0, v2

    if-lez v1, :cond_1f

    cmpg-double v1, p0, v4

    if-gtz v1, :cond_1f

    .line 40
    const/4 v1, 0x0

    aget-object v1, v0, v1

    aget-object v0, v0, v8

    invoke-static {v1, v0, p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank([D[DD)D

    move-result-wide v0

    .line 46
    :goto_1e
    return-wide v0

    .line 41
    :cond_1f
    cmpl-double v1, p0, v4

    if-lez v1, :cond_30

    cmpg-double v1, p0, v6

    if-gtz v1, :cond_30

    .line 42
    aget-object v1, v0, v8

    aget-object v0, v0, v9

    invoke-static {v1, v0, p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank([D[DD)D

    move-result-wide v0

    goto :goto_1e

    .line 43
    :cond_30
    cmpl-double v1, p0, v6

    if-lez v1, :cond_47

    const-wide v2, 0x409f400000000000L    # 2000.0

    cmpg-double v1, p0, v2

    if-gtz v1, :cond_47

    .line 44
    aget-object v1, v0, v9

    const/4 v2, 0x3

    aget-object v0, v0, v2

    invoke-static {v1, v0, p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank([D[DD)D

    move-result-wide v0

    goto :goto_1e

    .line 46
    :cond_47
    const-wide/high16 v0, -0x10000000000000L    # Double.NEGATIVE_INFINITY

    goto :goto_1e
.end method

.method public static rank0Percent(J)I
    .registers 8

    .prologue
    const/4 v0, 0x1

    .line 51
    const-wide/32 v2, 0x100000

    div-long v2, p0, v2

    long-to-double v2, v2

    .line 52
    invoke-static {v2, v3}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank0(D)D

    move-result-wide v2

    .line 53
    invoke-static {v2, v3}, Ljava/lang/Double;->isInfinite(D)Z

    move-result v1

    if-eqz v1, :cond_12

    .line 58
    :goto_11
    return v0

    .line 57
    :cond_12
    sget-object v1, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->NUM0:[[D

    const/4 v4, 0x0

    aget-object v1, v1, v4

    aget-wide v0, v1, v0

    div-double v0, v2, v0

    const-wide/high16 v2, 0x4059000000000000L    # 100.0

    mul-double/2addr v0, v2

    .line 58
    invoke-static {v0, v1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->validatePercent(D)I

    move-result v0

    goto :goto_11
.end method

.method public static rank1(D)D
    .registers 12

    .prologue
    const/4 v9, 0x2

    const/4 v8, 0x1

    const-wide v6, 0x4041800000000000L    # 35.0

    const-wide/high16 v4, 0x402e000000000000L    # 15.0

    .line 106
    sget-object v0, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->NUM1:[[D

    .line 108
    const-wide/16 v2, 0x0

    cmpl-double v1, p0, v2

    if-lez v1, :cond_1f

    cmpg-double v1, p0, v4

    if-gtz v1, :cond_1f

    .line 109
    const/4 v1, 0x0

    aget-object v1, v0, v1

    aget-object v0, v0, v8

    invoke-static {v1, v0, p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank([D[DD)D

    move-result-wide v0

    .line 115
    :goto_1e
    return-wide v0

    .line 110
    :cond_1f
    cmpl-double v1, p0, v4

    if-lez v1, :cond_30

    cmpg-double v1, p0, v6

    if-gtz v1, :cond_30

    .line 111
    aget-object v1, v0, v8

    aget-object v0, v0, v9

    invoke-static {v1, v0, p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank([D[DD)D

    move-result-wide v0

    goto :goto_1e

    .line 112
    :cond_30
    cmpl-double v1, p0, v6

    if-lez v1, :cond_47

    const-wide v2, 0x40af400000000000L    # 4000.0

    cmpg-double v1, p0, v2

    if-gtz v1, :cond_47

    .line 113
    aget-object v1, v0, v9

    const/4 v2, 0x3

    aget-object v0, v0, v2

    invoke-static {v1, v0, p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank([D[DD)D

    move-result-wide v0

    goto :goto_1e

    .line 115
    :cond_47
    const-wide/high16 v0, -0x10000000000000L    # Double.NEGATIVE_INFINITY

    goto :goto_1e
.end method

.method public static rank1Percent(J)I
    .registers 10

    .prologue
    const/4 v0, 0x1

    .line 62
    const-wide/32 v2, 0x100000

    div-long v2, p0, v2

    long-to-double v2, v2

    .line 63
    invoke-static {v2, v3}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank1(D)D

    move-result-wide v4

    .line 66
    invoke-static {v4, v5}, Ljava/lang/Double;->isInfinite(D)Z

    move-result v1

    if-eqz v1, :cond_12

    .line 73
    :goto_11
    return v0

    .line 70
    :cond_12
    sget-object v1, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->NUM1:[[D

    const/4 v6, 0x0

    aget-object v1, v1, v6

    aget-wide v0, v1, v0

    div-double v0, v4, v0

    const-wide/high16 v4, 0x4059000000000000L    # 100.0

    mul-double/2addr v4, v0

    .line 71
    invoke-static {v4, v5}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->validatePercent(D)I

    move-result v0

    .line 72
    sget-object v1, Ljava/lang/System;->out:Ljava/io/PrintStream;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "SIZE="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, p0, p1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, " "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v2, v3}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "M p="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v4, v5}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    goto :goto_11
.end method

.method public static rank7(D)D
    .registers 12

    .prologue
    const/4 v9, 0x2

    const/4 v8, 0x1

    const-wide v6, 0x4041800000000000L    # 35.0

    const-wide/high16 v4, 0x402e000000000000L    # 15.0

    .line 124
    sget-object v0, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->NUM7:[[D

    .line 126
    const-wide/16 v2, 0x0

    cmpl-double v1, p0, v2

    if-lez v1, :cond_1f

    cmpg-double v1, p0, v4

    if-gtz v1, :cond_1f

    .line 127
    const/4 v1, 0x0

    aget-object v1, v0, v1

    aget-object v0, v0, v8

    invoke-static {v1, v0, p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank([D[DD)D

    move-result-wide v0

    .line 133
    :goto_1e
    return-wide v0

    .line 128
    :cond_1f
    cmpl-double v1, p0, v4

    if-lez v1, :cond_30

    cmpg-double v1, p0, v6

    if-gtz v1, :cond_30

    .line 129
    aget-object v1, v0, v8

    aget-object v0, v0, v9

    invoke-static {v1, v0, p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank([D[DD)D

    move-result-wide v0

    goto :goto_1e

    .line 130
    :cond_30
    cmpl-double v1, p0, v6

    if-lez v1, :cond_47

    const-wide v2, 0x40b7700000000000L    # 6000.0

    cmpg-double v1, p0, v2

    if-gtz v1, :cond_47

    .line 131
    aget-object v1, v0, v9

    const/4 v2, 0x3

    aget-object v0, v0, v2

    invoke-static {v1, v0, p0, p1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank([D[DD)D

    move-result-wide v0

    goto :goto_1e

    .line 133
    :cond_47
    const-wide/high16 v0, -0x10000000000000L    # Double.NEGATIVE_INFINITY

    goto :goto_1e
.end method

.method public static rank7Percent(J)I
    .registers 8

    .prologue
    const/4 v0, 0x1

    .line 89
    const-wide/32 v2, 0x100000

    div-long v2, p0, v2

    long-to-double v2, v2

    .line 90
    invoke-static {v2, v3}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->rank7(D)D

    move-result-wide v2

    .line 92
    invoke-static {v2, v3}, Ljava/lang/Double;->isInfinite(D)Z

    move-result v1

    if-eqz v1, :cond_12

    .line 97
    :goto_11
    return v0

    .line 96
    :cond_12
    sget-object v1, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->NUM7:[[D

    const/4 v4, 0x0

    aget-object v1, v1, v4

    aget-wide v0, v1, v0

    div-double v0, v2, v0

    const-wide/high16 v2, 0x4059000000000000L    # 100.0

    mul-double/2addr v0, v2

    .line 97
    invoke-static {v0, v1}, Lcom/cm/plugincluster/resultpage/ctrl/FortuneTeller;->validatePercent(D)I

    move-result v0

    goto :goto_11
.end method

.method static tg([D[D)D
    .registers 10

    .prologue
    const/4 v6, 0x1

    const/4 v4, 0x0

    .line 147
    aget-wide v0, p0, v4

    .line 148
    aget-wide v2, p0, v6

    .line 149
    aget-wide v4, p1, v4

    .line 150
    aget-wide v6, p1, v6

    .line 152
    sub-double/2addr v2, v6

    sub-double v0, v4, v0

    div-double v0, v2, v0

    .line 153
    return-wide v0
.end method

.method private static validatePercent(D)I
    .registers 6

    .prologue
    .line 77
    const-wide/16 v0, 0x64

    invoke-static {p0, p1}, Ljava/lang/Math;->round(D)J

    move-result-wide v2

    sub-long/2addr v0, v2

    .line 78
    const-wide/16 v2, 0x63

    cmp-long v2, v0, v2

    if-lez v2, :cond_10

    .line 79
    const/16 v0, 0x63

    .line 85
    :goto_f
    return v0

    .line 82
    :cond_10
    const-wide/16 v2, 0x1

    cmp-long v2, v0, v2

    if-gez v2, :cond_18

    .line 83
    const/4 v0, 0x1

    goto :goto_f

    .line 85
    :cond_18
    long-to-int v0, v0

    goto :goto_f
.end method