Rabbit-R1/switch port/smali/smali_classes3/kotlin/collections/SlidingWindowKt$windowedIterator$1.smali
2024-05-21 17:08:36 -04:00

731 lines
18 KiB
Smali

.class final Lkotlin/collections/SlidingWindowKt$windowedIterator$1;
.super Lkotlin/coroutines/jvm/internal/RestrictedSuspendLambda;
.source "SlidingWindow.kt"
# interfaces
.implements Lkotlin/jvm/functions/Function2;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lkotlin/collections/SlidingWindowKt;->windowedIterator(Ljava/util/Iterator;IIZZ)Ljava/util/Iterator;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x18
name = null
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Lkotlin/coroutines/jvm/internal/RestrictedSuspendLambda;",
"Lkotlin/jvm/functions/Function2<",
"Lkotlin/sequences/SequenceScope<",
"-",
"Ljava/util/List<",
"+TT;>;>;",
"Lkotlin/coroutines/Continuation<",
"-",
"Lkotlin/Unit;",
">;",
"Ljava/lang/Object;",
">;"
}
.end annotation
.annotation runtime Lkotlin/Metadata;
d1 = {
"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010 \u0010\u0000\u001a\u00020\u0001\"\u0004\u0008\u0000\u0010\u0002*\u000e\u0012\n\u0012\u0008\u0012\u0004\u0012\u0002H\u00020\u00040\u0003H\u008a@"
}
d2 = {
"<anonymous>",
"",
"T",
"Lkotlin/sequences/SequenceScope;",
""
}
k = 0x3
mv = {
0x1,
0x9,
0x0
}
xi = 0x30
.end annotation
.annotation runtime Lkotlin/coroutines/jvm/internal/DebugMetadata;
c = "kotlin.collections.SlidingWindowKt$windowedIterator$1"
f = "SlidingWindow.kt"
i = {
0x0,
0x0,
0x0,
0x2,
0x2,
0x3,
0x3
}
l = {
0x22,
0x28,
0x31,
0x37,
0x3a
}
m = "invokeSuspend"
n = {
"$this$iterator",
"buffer",
"gap",
"$this$iterator",
"buffer",
"$this$iterator",
"buffer"
}
s = {
"L$0",
"L$1",
"I$0",
"L$0",
"L$1",
"L$0",
"L$1"
}
.end annotation
# instance fields
.field final synthetic $iterator:Ljava/util/Iterator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Iterator<",
"TT;>;"
}
.end annotation
.end field
.field final synthetic $partialWindows:Z
.field final synthetic $reuseBuffer:Z
.field final synthetic $size:I
.field final synthetic $step:I
.field I$0:I
.field private synthetic L$0:Ljava/lang/Object;
.field L$1:Ljava/lang/Object;
.field L$2:Ljava/lang/Object;
.field label:I
# direct methods
.method constructor <init>(IILjava/util/Iterator;ZZLkotlin/coroutines/Continuation;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(II",
"Ljava/util/Iterator<",
"+TT;>;ZZ",
"Lkotlin/coroutines/Continuation<",
"-",
"Lkotlin/collections/SlidingWindowKt$windowedIterator$1;",
">;)V"
}
.end annotation
iput p1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$size:I
iput p2, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$step:I
iput-object p3, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$iterator:Ljava/util/Iterator;
iput-boolean p4, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$reuseBuffer:Z
iput-boolean p5, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$partialWindows:Z
const/4 p1, 0x2
invoke-direct {p0, p1, p6}, Lkotlin/coroutines/jvm/internal/RestrictedSuspendLambda;-><init>(ILkotlin/coroutines/Continuation;)V
return-void
.end method
# virtual methods
.method public final create(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
.locals 8
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Object;",
"Lkotlin/coroutines/Continuation<",
"*>;)",
"Lkotlin/coroutines/Continuation<",
"Lkotlin/Unit;",
">;"
}
.end annotation
new-instance v7, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;
iget v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$size:I
iget v2, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$step:I
iget-object v3, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$iterator:Ljava/util/Iterator;
iget-boolean v4, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$reuseBuffer:Z
iget-boolean v5, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$partialWindows:Z
move-object v0, v7
move-object v6, p2
invoke-direct/range {v0 .. v6}, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;-><init>(IILjava/util/Iterator;ZZLkotlin/coroutines/Continuation;)V
iput-object p1, v7, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
check-cast v7, Lkotlin/coroutines/Continuation;
return-object v7
.end method
.method public bridge synthetic invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.locals 0
check-cast p1, Lkotlin/sequences/SequenceScope;
check-cast p2, Lkotlin/coroutines/Continuation;
invoke-virtual {p0, p1, p2}, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->invoke(Lkotlin/sequences/SequenceScope;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
move-result-object p0
return-object p0
.end method
.method public final invoke(Lkotlin/sequences/SequenceScope;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lkotlin/sequences/SequenceScope<",
"-",
"Ljava/util/List<",
"+TT;>;>;",
"Lkotlin/coroutines/Continuation<",
"-",
"Lkotlin/Unit;",
">;)",
"Ljava/lang/Object;"
}
.end annotation
invoke-virtual {p0, p1, p2}, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->create(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
move-result-object p0
check-cast p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;
sget-object p1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
invoke-virtual {p0, p1}, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p0
return-object p0
.end method
.method public final invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
.locals 10
invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object;
move-result-object v0
iget v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->label:I
const/4 v2, 0x5
const/4 v3, 0x4
const/4 v4, 0x3
const/4 v5, 0x2
const/4 v6, 0x1
const/4 v7, 0x0
if-eqz v1, :cond_6
if-eq v1, v6, :cond_4
if-eq v1, v5, :cond_3
if-eq v1, v4, :cond_2
if-eq v1, v3, :cond_1
if-ne v1, v2, :cond_0
goto :goto_0
.line 24
:cond_0
new-instance p0, Ljava/lang/IllegalStateException;
const-string p1, "call to \'resume\' before \'invoke\' with coroutine"
invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p0
:cond_1
iget-object v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$1:Ljava/lang/Object;
check-cast v1, Lkotlin/collections/RingBuffer;
iget-object v4, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
check-cast v4, Lkotlin/sequences/SequenceScope;
invoke-static {p1}, Lkotlin/ResultKt;->throwOnFailure(Ljava/lang/Object;)V
goto/16 :goto_9
:cond_2
iget-object v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$2:Ljava/lang/Object;
check-cast v1, Ljava/util/Iterator;
iget-object v5, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$1:Ljava/lang/Object;
check-cast v5, Lkotlin/collections/RingBuffer;
iget-object v8, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
check-cast v8, Lkotlin/sequences/SequenceScope;
invoke-static {p1}, Lkotlin/ResultKt;->throwOnFailure(Ljava/lang/Object;)V
goto/16 :goto_6
:cond_3
:goto_0
invoke-static {p1}, Lkotlin/ResultKt;->throwOnFailure(Ljava/lang/Object;)V
goto/16 :goto_a
:cond_4
iget v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->I$0:I
iget-object v2, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$2:Ljava/lang/Object;
check-cast v2, Ljava/util/Iterator;
iget-object v3, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$1:Ljava/lang/Object;
check-cast v3, Ljava/util/ArrayList;
iget-object v4, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
check-cast v4, Lkotlin/sequences/SequenceScope;
invoke-static {p1}, Lkotlin/ResultKt;->throwOnFailure(Ljava/lang/Object;)V
:cond_5
move p1, v1
goto :goto_2
:cond_6
invoke-static {p1}, Lkotlin/ResultKt;->throwOnFailure(Ljava/lang/Object;)V
iget-object p1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
check-cast p1, Lkotlin/sequences/SequenceScope;
iget v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$size:I
const/16 v8, 0x400
.line 25
invoke-static {v1, v8}, Lkotlin/ranges/RangesKt;->coerceAtMost(II)I
move-result v1
iget v8, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$step:I
iget v9, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$size:I
sub-int/2addr v8, v9
if-ltz v8, :cond_c
.line 28
new-instance v2, Ljava/util/ArrayList;
invoke-direct {v2, v1}, Ljava/util/ArrayList;-><init>(I)V
iget-object v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$iterator:Ljava/util/Iterator;
const/4 v3, 0x0
move-object v4, p1
move p1, v3
move-object v3, v2
move-object v2, v1
move v1, v8
.line 30
:cond_7
:goto_1
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v8
if-eqz v8, :cond_a
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v8
if-lez p1, :cond_8
add-int/lit8 p1, p1, -0x1
goto :goto_1
.line 32
:cond_8
invoke-virtual {v3, v8}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 33
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v8
iget v9, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$size:I
if-ne v8, v9, :cond_7
.line 34
move-object p1, p0
check-cast p1, Lkotlin/coroutines/Continuation;
iput-object v4, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
iput-object v3, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$1:Ljava/lang/Object;
iput-object v2, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$2:Ljava/lang/Object;
iput v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->I$0:I
iput v6, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->label:I
invoke-virtual {v4, v3, p1}, Lkotlin/sequences/SequenceScope;->yield(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
move-result-object p1
if-ne p1, v0, :cond_5
return-object v0
.line 35
:goto_2
iget-boolean v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$reuseBuffer:Z
if-eqz v1, :cond_9
invoke-virtual {v3}, Ljava/util/ArrayList;->clear()V
goto :goto_3
:cond_9
new-instance v1, Ljava/util/ArrayList;
iget v3, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$size:I
invoke-direct {v1, v3}, Ljava/util/ArrayList;-><init>(I)V
move-object v3, v1
:goto_3
move v1, p1
goto :goto_1
.line 39
:cond_a
move-object p1, v3
check-cast p1, Ljava/util/Collection;
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
move-result p1
xor-int/2addr p1, v6
if-eqz p1, :cond_15
.line 40
iget-boolean p1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$partialWindows:Z
if-nez p1, :cond_b
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result p1
iget v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$size:I
if-ne p1, v1, :cond_15
:cond_b
move-object p1, p0
check-cast p1, Lkotlin/coroutines/Continuation;
iput-object v7, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
iput-object v7, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$1:Ljava/lang/Object;
iput-object v7, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$2:Ljava/lang/Object;
iput v5, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->label:I
invoke-virtual {v4, v3, p1}, Lkotlin/sequences/SequenceScope;->yield(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
move-result-object p0
if-ne p0, v0, :cond_15
return-object v0
.line 43
:cond_c
new-instance v5, Lkotlin/collections/RingBuffer;
invoke-direct {v5, v1}, Lkotlin/collections/RingBuffer;-><init>(I)V
iget-object v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$iterator:Ljava/util/Iterator;
move-object v8, p1
.line 44
:cond_d
:goto_4
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result p1
if-eqz p1, :cond_11
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object p1
.line 45
invoke-virtual {v5, p1}, Lkotlin/collections/RingBuffer;->add(Ljava/lang/Object;)V
.line 46
invoke-virtual {v5}, Lkotlin/collections/RingBuffer;->isFull()Z
move-result p1
if-eqz p1, :cond_d
.line 47
invoke-virtual {v5}, Lkotlin/collections/RingBuffer;->size()I
move-result p1
iget v9, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$size:I
if-ge p1, v9, :cond_e
invoke-virtual {v5, v9}, Lkotlin/collections/RingBuffer;->expanded(I)Lkotlin/collections/RingBuffer;
move-result-object v5
goto :goto_4
.line 49
:cond_e
iget-boolean p1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$reuseBuffer:Z
if-eqz p1, :cond_f
move-object p1, v5
check-cast p1, Ljava/util/List;
goto :goto_5
:cond_f
new-instance p1, Ljava/util/ArrayList;
move-object v9, v5
check-cast v9, Ljava/util/Collection;
invoke-direct {p1, v9}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
check-cast p1, Ljava/util/List;
:goto_5
move-object v9, p0
check-cast v9, Lkotlin/coroutines/Continuation;
iput-object v8, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
iput-object v5, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$1:Ljava/lang/Object;
iput-object v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$2:Ljava/lang/Object;
iput v4, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->label:I
invoke-virtual {v8, p1, v9}, Lkotlin/sequences/SequenceScope;->yield(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
move-result-object p1
if-ne p1, v0, :cond_10
return-object v0
.line 50
:cond_10
:goto_6
iget p1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$step:I
invoke-virtual {v5, p1}, Lkotlin/collections/RingBuffer;->removeFirst(I)V
goto :goto_4
.line 53
:cond_11
iget-boolean p1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$partialWindows:Z
if-eqz p1, :cond_15
move-object v1, v5
move-object v4, v8
.line 54
:goto_7
invoke-virtual {v1}, Lkotlin/collections/RingBuffer;->size()I
move-result p1
iget v5, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$step:I
if-le p1, v5, :cond_14
.line 55
iget-boolean p1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$reuseBuffer:Z
if-eqz p1, :cond_12
move-object p1, v1
check-cast p1, Ljava/util/List;
goto :goto_8
:cond_12
new-instance p1, Ljava/util/ArrayList;
move-object v5, v1
check-cast v5, Ljava/util/Collection;
invoke-direct {p1, v5}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
check-cast p1, Ljava/util/List;
:goto_8
move-object v5, p0
check-cast v5, Lkotlin/coroutines/Continuation;
iput-object v4, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
iput-object v1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$1:Ljava/lang/Object;
iput-object v7, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$2:Ljava/lang/Object;
iput v3, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->label:I
invoke-virtual {v4, p1, v5}, Lkotlin/sequences/SequenceScope;->yield(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
move-result-object p1
if-ne p1, v0, :cond_13
return-object v0
.line 56
:cond_13
:goto_9
iget p1, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->$step:I
invoke-virtual {v1, p1}, Lkotlin/collections/RingBuffer;->removeFirst(I)V
goto :goto_7
.line 58
:cond_14
move-object p1, v1
check-cast p1, Ljava/util/Collection;
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
move-result p1
xor-int/2addr p1, v6
if-eqz p1, :cond_15
move-object p1, p0
check-cast p1, Lkotlin/coroutines/Continuation;
iput-object v7, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$0:Ljava/lang/Object;
iput-object v7, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$1:Ljava/lang/Object;
iput-object v7, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->L$2:Ljava/lang/Object;
iput v2, p0, Lkotlin/collections/SlidingWindowKt$windowedIterator$1;->label:I
invoke-virtual {v4, v1, p1}, Lkotlin/sequences/SequenceScope;->yield(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
move-result-object p0
if-ne p0, v0, :cond_15
return-object v0
.line 61
:cond_15
:goto_a
sget-object p0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
return-object p0
.end method