.class public Lcom/a/a/c;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/a/a/m;


# static fields
.field static final synthetic a:Z


# instance fields
.field b:Ljava/net/InetSocketAddress;

.field c:Lcom/a/a/e/a;

.field d:Z

.field e:Lcom/a/a/a/g;

.field f:Lcom/a/a/a/d;

.field g:Lcom/a/a/a/a;

.field h:Z

.field i:Ljava/lang/Exception;

.field j:Z

.field private k:Lcom/a/a/am;

.field private l:Ljava/nio/channels/SelectionKey;

.field private m:Lcom/a/a/e;

.field private n:Lcom/a/a/o;

.field private o:Lcom/a/a/a/a;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const-class v0, Lcom/a/a/c;

    invoke-virtual {v0}, Ljava/lang/Class;->desiredAssertionStatus()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    sput-boolean v0, Lcom/a/a/c;->a:Z

    return-void

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method constructor <init>()V
    .locals 1

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

    new-instance v0, Lcom/a/a/o;

    invoke-direct {v0}, Lcom/a/a/o;-><init>()V

    iput-object v0, p0, Lcom/a/a/c;->n:Lcom/a/a/o;

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/a/a/c;->j:Z

    return-void
.end method

.method private a(Ljava/lang/Exception;)V
    .locals 1

    iget-boolean v0, p0, Lcom/a/a/c;->d:Z

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/a/a/c;->d:Z

    iget-object v0, p0, Lcom/a/a/c;->g:Lcom/a/a/a/a;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c;->g:Lcom/a/a/a/a;

    invoke-interface {v0, p1}, Lcom/a/a/a/a;->a_(Ljava/lang/Exception;)V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/a/a/c;->g:Lcom/a/a/a/a;

    goto :goto_0
.end method

.method private b(Ljava/lang/Exception;)V
    .locals 1

    iget-object v0, p0, Lcom/a/a/c;->n:Lcom/a/a/o;

    invoke-virtual {v0}, Lcom/a/a/o;->g()Z

    move-result v0

    if-eqz v0, :cond_1

    iput-object p1, p0, Lcom/a/a/c;->i:Ljava/lang/Exception;

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-boolean v0, p0, Lcom/a/a/c;->h:Z

    if-nez v0, :cond_0

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/a/a/c;->h:Z

    iget-object v0, p0, Lcom/a/a/c;->o:Lcom/a/a/a/a;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c;->o:Lcom/a/a/a/a;

    invoke-interface {v0, p1}, Lcom/a/a/a/a;->a_(Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method private n()V
    .locals 1

    iget-object v0, p0, Lcom/a/a/c;->n:Lcom/a/a/o;

    invoke-virtual {v0}, Lcom/a/a/o;->g()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c;->n:Lcom/a/a/o;

    invoke-static {p0, v0}, Lcom/a/a/ah;->a(Lcom/a/a/q;Lcom/a/a/o;)V

    :cond_0
    return-void
.end method


# virtual methods
.method final a()I
    .locals 11

    const-wide/16 v8, 0x0

    const/4 v0, 0x0

    invoke-direct {p0}, Lcom/a/a/c;->n()V

    iget-boolean v1, p0, Lcom/a/a/c;->j:Z

    if-eqz v1, :cond_1

    :cond_0
    :goto_0
    return v0

    :cond_1
    :try_start_0
    iget-object v1, p0, Lcom/a/a/c;->c:Lcom/a/a/e/a;

    invoke-virtual {v1}, Lcom/a/a/e/a;->a()Ljava/nio/ByteBuffer;

    move-result-object v2

    iget-object v1, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    invoke-virtual {v1, v2}, Lcom/a/a/am;->read(Ljava/nio/ByteBuffer;)I

    move-result v1

    int-to-long v4, v1

    cmp-long v1, v4, v8

    if-gez v1, :cond_2

    invoke-virtual {p0}, Lcom/a/a/c;->d()V

    const/4 v1, 0x1

    :goto_1
    cmp-long v3, v4, v8

    if-lez v3, :cond_3

    iget-object v3, p0, Lcom/a/a/c;->c:Lcom/a/a/e/a;

    invoke-virtual {v3, v4, v5}, Lcom/a/a/e/a;->a(J)V

    invoke-virtual {v2}, Ljava/nio/ByteBuffer;->flip()Ljava/nio/Buffer;

    iget-object v3, p0, Lcom/a/a/c;->n:Lcom/a/a/o;

    invoke-virtual {v3, v2}, Lcom/a/a/o;->b(Ljava/nio/ByteBuffer;)Lcom/a/a/o;

    iget-object v2, p0, Lcom/a/a/c;->n:Lcom/a/a/o;

    invoke-static {p0, v2}, Lcom/a/a/ah;->a(Lcom/a/a/q;Lcom/a/a/o;)V

    :goto_2
    if-eqz v1, :cond_0

    const/4 v1, 0x0

    invoke-direct {p0, v1}, Lcom/a/a/c;->b(Ljava/lang/Exception;)V

    const/4 v1, 0x0

    invoke-direct {p0, v1}, Lcom/a/a/c;->a(Ljava/lang/Exception;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v1

    invoke-virtual {p0}, Lcom/a/a/c;->d()V

    invoke-direct {p0, v1}, Lcom/a/a/c;->b(Ljava/lang/Exception;)V

    invoke-direct {p0, v1}, Lcom/a/a/c;->a(Ljava/lang/Exception;)V

    goto :goto_0

    :cond_2
    add-long v6, v8, v4

    long-to-int v1, v6

    move v10, v0

    move v0, v1

    move v1, v10

    goto :goto_1

    :cond_3
    :try_start_1
    invoke-static {v2}, Lcom/a/a/o;->a(Ljava/nio/ByteBuffer;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_2
.end method

.method public a(Lcom/a/a/a/a;)V
    .locals 0

    iput-object p1, p0, Lcom/a/a/c;->g:Lcom/a/a/a/a;

    return-void
.end method

.method public a(Lcom/a/a/a/d;)V
    .locals 0

    iput-object p1, p0, Lcom/a/a/c;->f:Lcom/a/a/a/d;

    return-void
.end method

.method public a(Lcom/a/a/a/g;)V
    .locals 0

    iput-object p1, p0, Lcom/a/a/c;->e:Lcom/a/a/a/g;

    return-void
.end method

.method final a(Lcom/a/a/e;Ljava/nio/channels/SelectionKey;)V
    .locals 0

    iput-object p1, p0, Lcom/a/a/c;->m:Lcom/a/a/e;

    iput-object p2, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    return-void
.end method

.method public a(Lcom/a/a/o;)V
    .locals 2

    iget-object v0, p0, Lcom/a/a/c;->m:Lcom/a/a/e;

    invoke-virtual {v0}, Lcom/a/a/e;->c()Ljava/lang/Thread;

    move-result-object v0

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v1

    if-eq v0, v1, :cond_1

    iget-object v0, p0, Lcom/a/a/c;->m:Lcom/a/a/e;

    new-instance v1, Lcom/a/a/az;

    invoke-direct {v1, p0, p1}, Lcom/a/a/az;-><init>(Lcom/a/a/c;Lcom/a/a/o;)V

    invoke-virtual {v0, v1}, Lcom/a/a/e;->b(Ljava/lang/Runnable;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    invoke-virtual {v0}, Lcom/a/a/am;->b()Z

    move-result v0

    if-nez v0, :cond_2

    sget-boolean v0, Lcom/a/a/c;->a:Z

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    invoke-virtual {v0}, Lcom/a/a/am;->a()Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/AssertionError;

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

    throw v0

    :cond_2
    :try_start_0
    invoke-virtual {p1}, Lcom/a/a/o;->l()I

    invoke-virtual {p1}, Lcom/a/a/o;->b()[Ljava/nio/ByteBuffer;

    move-result-object v0

    iget-object v1, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    invoke-virtual {v1, v0}, Lcom/a/a/am;->a([Ljava/nio/ByteBuffer;)I

    invoke-virtual {p1, v0}, Lcom/a/a/o;->a([Ljava/nio/ByteBuffer;)Lcom/a/a/o;

    invoke-virtual {p1}, Lcom/a/a/o;->l()I

    move-result v0

    iget-object v1, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    invoke-virtual {v1}, Ljava/nio/channels/SelectionKey;->isValid()Z

    move-result v1

    if-nez v1, :cond_3

    new-instance v0, Ljava/io/IOException;

    new-instance v1, Ljava/nio/channels/CancelledKeyException;

    invoke-direct {v1}, Ljava/nio/channels/CancelledKeyException;-><init>()V

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V

    throw v0
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    move-exception v0

    invoke-virtual {p0}, Lcom/a/a/c;->d()V

    invoke-direct {p0, v0}, Lcom/a/a/c;->b(Ljava/lang/Exception;)V

    invoke-direct {p0, v0}, Lcom/a/a/c;->a(Ljava/lang/Exception;)V

    goto :goto_0

    :cond_3
    if-lez v0, :cond_5

    :try_start_1
    sget-boolean v0, Lcom/a/a/c;->a:Z

    if-nez v0, :cond_4

    iget-object v0, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    invoke-virtual {v0}, Lcom/a/a/am;->a()Z

    move-result v0

    if-eqz v0, :cond_4

    new-instance v0, Ljava/lang/AssertionError;

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

    throw v0

    :cond_4
    iget-object v0, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    iget-object v1, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    invoke-virtual {v1}, Ljava/nio/channels/SelectionKey;->interestOps()I

    move-result v1

    or-int/lit8 v1, v1, 0x4

    invoke-virtual {v0, v1}, Ljava/nio/channels/SelectionKey;->interestOps(I)Ljava/nio/channels/SelectionKey;

    :goto_1
    invoke-virtual {p1}, Lcom/a/a/o;->l()I

    invoke-static {}, Lcom/a/a/e;->a()V

    goto :goto_0

    :cond_5
    iget-object v0, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    iget-object v1, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    invoke-virtual {v1}, Ljava/nio/channels/SelectionKey;->interestOps()I

    move-result v1

    and-int/lit8 v1, v1, -0x5

    invoke-virtual {v0, v1}, Ljava/nio/channels/SelectionKey;->interestOps(I)Ljava/nio/channels/SelectionKey;
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1
.end method

.method final a(Ljava/nio/channels/SocketChannel;Ljava/net/InetSocketAddress;)V
    .locals 1

    iput-object p2, p0, Lcom/a/a/c;->b:Ljava/net/InetSocketAddress;

    new-instance v0, Lcom/a/a/e/a;

    invoke-direct {v0}, Lcom/a/a/e/a;-><init>()V

    iput-object v0, p0, Lcom/a/a/c;->c:Lcom/a/a/e/a;

    new-instance v0, Lcom/a/a/ax;

    invoke-direct {v0, p1}, Lcom/a/a/ax;-><init>(Ljava/nio/channels/SocketChannel;)V

    iput-object v0, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    return-void
.end method

.method public b()Ljava/lang/String;
    .locals 1

    const/4 v0, 0x0

    return-object v0
.end method

.method public b(Lcom/a/a/a/a;)V
    .locals 0

    iput-object p1, p0, Lcom/a/a/c;->o:Lcom/a/a/a/a;

    return-void
.end method

.method public c()V
    .locals 1

    invoke-virtual {p0}, Lcom/a/a/c;->d()V

    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/a/a/c;->a(Ljava/lang/Exception;)V

    return-void
.end method

.method public d()V
    .locals 1

    iget-object v0, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    invoke-virtual {v0}, Ljava/nio/channels/SelectionKey;->cancel()V

    :try_start_0
    iget-object v0, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    invoke-virtual {v0}, Lcom/a/a/am;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public e()V
    .locals 1

    iget-object v0, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    invoke-virtual {v0}, Lcom/a/a/am;->c()V

    return-void
.end method

.method public f()Lcom/a/a/a/d;
    .locals 1

    iget-object v0, p0, Lcom/a/a/c;->f:Lcom/a/a/a/d;

    return-object v0
.end method

.method public g()Lcom/a/a/e;
    .locals 1

    iget-object v0, p0, Lcom/a/a/c;->m:Lcom/a/a/e;

    return-object v0
.end method

.method public h()Lcom/a/a/a/g;
    .locals 1

    iget-object v0, p0, Lcom/a/a/c;->e:Lcom/a/a/a/g;

    return-object v0
.end method

.method public i()Z
    .locals 1

    iget-object v0, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    invoke-virtual {v0}, Lcom/a/a/am;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    invoke-virtual {v0}, Ljava/nio/channels/SelectionKey;->isValid()Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public j()Z
    .locals 1

    iget-boolean v0, p0, Lcom/a/a/c;->j:Z

    return v0
.end method

.method public k()V
    .locals 2

    iget-object v0, p0, Lcom/a/a/c;->k:Lcom/a/a/am;

    invoke-virtual {v0}, Lcom/a/a/am;->a()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    iget-object v1, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    invoke-virtual {v1}, Ljava/nio/channels/SelectionKey;->interestOps()I

    move-result v1

    and-int/lit8 v1, v1, -0x5

    invoke-virtual {v0, v1}, Ljava/nio/channels/SelectionKey;->interestOps(I)Ljava/nio/channels/SelectionKey;

    :cond_0
    iget-object v0, p0, Lcom/a/a/c;->e:Lcom/a/a/a/g;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/a/a/c;->e:Lcom/a/a/a/g;

    invoke-interface {v0}, Lcom/a/a/a/g;->a()V

    :cond_1
    return-void
.end method

.method public l()V
    .locals 2

    iget-object v0, p0, Lcom/a/a/c;->m:Lcom/a/a/e;

    invoke-virtual {v0}, Lcom/a/a/e;->c()Ljava/lang/Thread;

    move-result-object v0

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v1

    if-eq v0, v1, :cond_1

    iget-object v0, p0, Lcom/a/a/c;->m:Lcom/a/a/e;

    new-instance v1, Lcom/a/a/ba;

    invoke-direct {v1, p0}, Lcom/a/a/ba;-><init>(Lcom/a/a/c;)V

    invoke-virtual {v0, v1}, Lcom/a/a/e;->b(Ljava/lang/Runnable;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-boolean v0, p0, Lcom/a/a/c;->j:Z

    if-nez v0, :cond_0

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/a/a/c;->j:Z

    :try_start_0
    iget-object v0, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    iget-object v1, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    invoke-virtual {v1}, Ljava/nio/channels/SelectionKey;->interestOps()I

    move-result v1

    and-int/lit8 v1, v1, -0x2

    invoke-virtual {v0, v1}, Ljava/nio/channels/SelectionKey;->interestOps(I)Ljava/nio/channels/SelectionKey;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public m()V
    .locals 2

    iget-object v0, p0, Lcom/a/a/c;->m:Lcom/a/a/e;

    invoke-virtual {v0}, Lcom/a/a/e;->c()Ljava/lang/Thread;

    move-result-object v0

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v1

    if-eq v0, v1, :cond_1

    iget-object v0, p0, Lcom/a/a/c;->m:Lcom/a/a/e;

    new-instance v1, Lcom/a/a/bb;

    invoke-direct {v1, p0}, Lcom/a/a/bb;-><init>(Lcom/a/a/c;)V

    invoke-virtual {v0, v1}, Lcom/a/a/e;->b(Ljava/lang/Runnable;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-boolean v0, p0, Lcom/a/a/c;->j:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/a/a/c;->j:Z

    :try_start_0
    iget-object v0, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    iget-object v1, p0, Lcom/a/a/c;->l:Ljava/nio/channels/SelectionKey;

    invoke-virtual {v1}, Ljava/nio/channels/SelectionKey;->interestOps()I

    move-result v1

    or-int/lit8 v1, v1, 0x1

    invoke-virtual {v0, v1}, Ljava/nio/channels/SelectionKey;->interestOps(I)Ljava/nio/channels/SelectionKey;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_1
    invoke-direct {p0}, Lcom/a/a/c;->n()V

    invoke-virtual {p0}, Lcom/a/a/c;->i()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c;->i:Ljava/lang/Exception;

    invoke-direct {p0, v0}, Lcom/a/a/c;->b(Ljava/lang/Exception;)V

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_1
.end method
