content: package kotlinx.coroutines.channels;
  
  import androidx.concurrent.futures.AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;
  import java.util.concurrent.CancellationException;
  import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
  import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
  import kotlin.Deprecated;
  import kotlin.DeprecationLevel;
  import kotlin.Metadata;
  import kotlin.ReplaceWith;
  import kotlin.Unit;
  import kotlin.collections.ArraysKt;
  import kotlin.coroutines.Continuation;
  import kotlin.coroutines.intrinsics.IntrinsicsKt;
  import kotlin.jvm.functions.Function1;
  import kotlin.jvm.functions.Function2;
  import kotlin.jvm.internal.DefaultConstructorMarker;
  import kotlin.jvm.internal.Intrinsics;
  import kotlin.jvm.internal.TypeIntrinsics;
  import kotlinx.coroutines.DebugKt;
  import kotlinx.coroutines.channels.BroadcastChannel;
  import kotlinx.coroutines.internal.Symbol;
  import kotlinx.coroutines.intrinsics.UndispatchedKt;
  import kotlinx.coroutines.selects.SelectClause2;
  import kotlinx.coroutines.selects.SelectInstance;
  import mt.Log1F380D;
  
  @Metadata(d1 = {"\u0000|\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\r\n\u0002\u0018\u0002\b\u0007\u0018\u0000 B*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u00028\u00000G:\u0004CBDEB\u0011\b\u0016\u0012\u0006\u0010\u0002\u001a\u00028\u0000¢\u0006\u0004\b\u0003\u0010\u0004B\u0007¢\u0006\u0004\b\u0003\u0010\u0005J?\u0010\n\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00070\u00062\u0014\u0010\b\u001a\u0010\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u0007\u0018\u00010\u00062\f\u0010\t\u001a\b\u0012\u0004\u0012\u00028\u00000\u0007H\u0002¢\u0006\u0004\b\n\u0010\u000bJ\u0019\u0010\u000f\u001a\u00020\u000e2\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0017¢\u0006\u0004\b\u000f\u0010\u0010J\u001f\u0010\u000f\u001a\u00020\u00132\u000e\u0010\r\u001a\n\u0018\u00010\u0011j\u0004\u0018\u0001`\u0012H\u0016¢\u0006\u0004\b\u000f\u0010\u0014J\u0019\u0010\u0015\u001a\u00020\u000e2\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0016¢\u0006\u0004\b\u0015\u0010\u0010J\u001d\u0010\u0016\u001a\u00020\u00132\f\u0010\t\u001a\b\u0012\u0004\u0012\u00028\u00000\u0007H\u0002¢\u0006\u0004\b\u0016\u0010\u0017J)\u0010\u001b\u001a\u00020\u00132\u0018\u0010\u001a\u001a\u0014\u0012\u0006\u0012\u0004\u0018\u00010\f\u0012\u0004\u0012\u00020\u00130\u0018j\u0002`\u0019H\u0016¢\u0006\u0004\b\u001b\u0010\u001cJ\u0019\u0010\u001d\u001a\u00020\u00132\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0002¢\u0006\u0004\b\u001d\u0010\u001eJ\u0019\u0010!\u001a\u0004\u0018\u00010 2\u0006\u0010\u001f\u001a\u00028\u0000H\u0002¢\u0006\u0004\b!\u0010\"J\u0015\u0010$\u001a\b\u0012\u0004\u0012\u00028\u00000#H\u0016¢\u0006\u0004\b$\u0010%JX\u0010.\u001a\u00020\u0013\"\u0004\b\u0001\u0010&2\f\u0010(\u001a\b\u0012\u0004\u0012\u00028\u00010'2\u0006\u0010\u001f\u001a\u00028\u00002(\u0010-\u001a$\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000*\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00010+\u0012\u0006\u0012\u0004\u0018\u00010,0)H\u0002ø\u0001\u0000¢\u0006\u0004\b.\u0010/J?\u00100\u001a\u0010\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u0007\u0018\u00010\u00062\u0012\u0010\b\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00070\u00062\f\u0010\t\u001a\b\u0012\u0004\u0012\u00028\u00000\u0007H\u0002¢\u0006\u0004\b0\u0010\u000bJ\u001b\u00101\u001a\u00020\u00132\u0006\u0010\u001f\u001a\u00028\u0000H@ø\u0001\u0000¢\u0006\u0004\b1\u00102J&\u00106\u001a\b\u0012\u0004\u0012\u00020\u0013032\u0006\u0010\u001f\u001a\u00028\u0000H\u0016ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002¢\u0006\u0004\b4\u00105R\u0014\u00107\u001a\u00020\u000e8VX\u0004¢\u0006\u0006\u001a\u0004\b7\u00108R&\u0010<\u001a\u0014\u0012\u0004\u0012\u00028\u0000\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000*098VX\u0004¢\u0006\u0006\u001a\u0004\b:\u0010;R\u0017\u0010\u0002\u001a\u00028\u00008F¢\u0006\f\u0012\u0004\b?\u0010\u0005\u001a\u0004\b=\u0010>R\u0013\u0010A\u001a\u0004\u0018\u00018\u00008F¢\u0006\u0006\u001a\u0004\b@\u0010>\u0002\u000f\n\u0002\b\u0019\n\u0002\b!\n\u0005\b¡\u001e0\u0001¨\u0006F"}, d2 = {"Lkotlinx/coroutines/channels/ConflatedBroadcastChannel;", "E", "value", "<init>", "(Ljava/lang/Object;)V", "()V", "", "Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Subscriber;", "list", "subscriber", "addSubscriber", "([Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Subscriber;Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Subscriber;)[Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Subscriber;", "", "cause", "", "cancel", "(Ljava/lang/Throwable;)Z", "Ljava/util/concurrent/CancellationException;", "Lkotlinx/coroutines/CancellationException;", "", "(Ljava/util/concurrent/CancellationException;)V", "close", "closeSubscriber", "(Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Subscriber;)V", "Lkotlin/Function1;", "Lkotlinx/coroutines/channels/Handler;", "handler", "invokeOnClose", "(Lkotlin/jvm/functions/Function1;)V", "invokeOnCloseHandler", "(Ljava/lang/Throwable;)V", "element", "Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Closed;", "offerInternal", "(Ljava/lang/Object;)Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Closed;", "Lkotlinx/coroutines/channels/ReceiveChannel;", "openSubscription", "()Lkotlinx/coroutines/channels/ReceiveChannel;", "R", "Lkotlinx/coroutines/selects/SelectInstance;", "select", "Lkotlin/Function2;", "Lkotlinx/coroutines/channels/SendChannel;", "Lkotlin/coroutines/Continuation;", "", "block", "registerSelectSend", "(Lkotlinx/coroutines/selects/SelectInstance;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)V", "removeSubscriber", "send", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "Lkotlinx/coroutines/channels/ChannelResult;", "trySend-JP2dKIU", "(Ljava/lang/Object;)Ljava/lang/Object;", "trySend", "isClosedForSend", "()Z", "Lkotlinx/coroutines/selects/SelectClause2;", "getOnSend", "()Lkotlinx/coroutines/selects/SelectClause2;", "onSend", "getValue", "()Ljava/lang/Object;", "getValue$annotations", "getValueOrNull", "valueOrNull", "Companion", "Closed", "State", "Subscriber", "kotlinx-coroutines-core", "Lkotlinx/coroutines/channels/BroadcastChannel;"}, k = 1, mv = {1, 6, 0}, xi = 48)
  /* compiled from: 018C */
  public final class ConflatedBroadcastChannel<E> implements BroadcastChannel<E> {
      @Deprecated
      private static final Closed CLOSED = new Closed((Throwable) null);
      private static final Companion Companion = new Companion((DefaultConstructorMarker) null);
      @Deprecated
      private static final State<Object> INITIAL_STATE;
      @Deprecated
      private static final Symbol UNDEFINED;
      private static final /* synthetic */ AtomicReferenceFieldUpdater _state$FU;
      private static final /* synthetic */ AtomicIntegerFieldUpdater _updating$FU;
      private static final /* synthetic */ AtomicReferenceFieldUpdater onCloseHandler$FU;
      private volatile /* synthetic */ Object _state;
      private volatile /* synthetic */ int _updating;
      private volatile /* synthetic */ Object onCloseHandler;
  
      @Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0007\b\u0002\u0018\u00002\u00020\u0001B\u000f\u0012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0003¢\u0006\u0002\u0010\u0004R\u0012\u0010\u0002\u001a\u0004\u0018\u00010\u00038\u0006X\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u0005\u001a\u00020\u00038F¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007R\u0011\u0010\b\u001a\u00020\u00038F¢\u0006\u0006\u001a\u0004\b\t\u0010\u0007¨\u0006\n"}, d2 = {"Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Closed;", "", "closeCause", "", "(Ljava/lang/Throwable;)V", "sendException", "getSendException", "()Ljava/lang/Throwable;", "valueException", "getValueException", "kotlinx-coroutines-core"}, k = 1, mv = {1, 6, 0}, xi = 48)
      /* compiled from: ConflatedBroadcastChannel.kt */
      private static final class Closed {
          public final Throwable closeCause;
  
          public Closed(Throwable closeCause2) {
              this.closeCause = closeCause2;
          }
  
          public final Throwable getSendException() {
              Throwable th = this.closeCause;
              return th == null ? new ClosedSendChannelException(ChannelsKt.DEFAULT_CLOSE_MESSAGE) : th;
          }
  
          public final Throwable getValueException() {
              Throwable th = this.closeCause;
              return th == null ? new IllegalStateException(ChannelsKt.DEFAULT_CLOSE_MESSAGE) : th;
          }
      }
  
      @Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0004¢\u0006\u0002\n\u0000R\u0016\u0010\u0005\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00010\u0006X\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0004¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Companion;", "", "()V", "CLOSED", "Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Closed;", "INITIAL_STATE", "Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$State;", "UNDEFINED", "Lkotlinx/coroutines/internal/Symbol;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 6, 0}, xi = 48)
      /* compiled from: ConflatedBroadcastChannel.kt */
      private static final class Companion {
          private Companion() {
          }
  
          public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
              this();
          }
      }
  
      @Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0002\u0018\u0000*\u0004\b\u0001\u0010\u00012\u00020\u0002B%\u0012\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002\u0012\u0014\u0010\u0004\u001a\u0010\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00010\u0006\u0018\u00010\u0005¢\u0006\u0002\u0010\u0007R \u0010\u0004\u001a\u0010\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00010\u0006\u0018\u00010\u00058\u0006X\u0004¢\u0006\u0004\n\u0002\u0010\bR\u0012\u0010\u0003\u001a\u0004\u0018\u00010\u00028\u0006X\u0004¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$State;", "E", "", "value", "subscribers", "", "Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Subscriber;", "(Ljava/lang/Object;[Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Subscriber;)V", "[Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Subscriber;", "kotlinx-coroutines-core"}, k = 1, mv = {1, 6, 0}, xi = 48)
      /* compiled from: ConflatedBroadcastChannel.kt */
      private static final class State<E> {
          public final Subscriber<E>[] subscribers;
          public final Object value;
  
          public State(Object value2, Subscriber<E>[] subscribers2) {
              this.value = value2;
              this.subscribers = subscribers2;
          }
      }
  
      @Metadata(d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\b\u0002\u0018\u0000*\u0004\b\u0001\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B\u0013\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00010\u0005¢\u0006\u0002\u0010\u0006J\u0015\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00028\u0001H\u0016¢\u0006\u0002\u0010\nJ\u0010\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u000eH\u0014R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00010\u0005X\u0004¢\u0006\u0002\n\u0000¨\u0006\u000f"}, d2 = {"Lkotlinx/coroutines/channels/ConflatedBroadcastChannel$Subscriber;", "E", "Lkotlinx/coroutines/channels/ConflatedChannel;", "Lkotlinx/coroutines/channels/ReceiveChannel;", "broadcastChannel", "Lkotlinx/coroutines/channels/ConflatedBroadcastChannel;", "(Lkotlinx/coroutines/channels/ConflatedBroadcastChannel;)V", "offerInternal", "", "element", "(Ljava/lang/Object;)Ljava/lang/Object;", "onCancelIdempotent", "", "wasClosed", "", "kotlinx-coroutines-core"}, k = 1, mv = {1, 6, 0}, xi = 48)
      /* compiled from: ConflatedBroadcastChannel.kt */
      private static final class Subscriber<E> extends ConflatedChannel<E> implements ReceiveChannel<E> {
          private final ConflatedBroadcastChannel<E> broadcastChannel;
  
          public Subscriber(ConflatedBroadcastChannel<E> broadcastChannel2) {
              super((Function1) null);
              this.broadcastChannel = broadcastChannel2;
          }
  
          public Object offerInternal(E element) {
              return super.offerInternal(element);
          }
  
          /* access modifiers changed from: protected */
          public void onCancelIdempotent(boolean wasClosed) {
              if (wasClosed) {
                  this.broadcastChannel.closeSubscriber(this);
              }
          }
      }
  
      static {
          Class<ConflatedBroadcastChannel> cls = ConflatedBroadcastChannel.class;
          Symbol symbol = new Symbol("UNDEFINED");
          UNDEFINED = symbol;
          INITIAL_STATE = new State<>(symbol, (Subscriber<E>[]) null);
          _state$FU = AtomicReferenceFieldUpdater.newUpdater(cls, Object.class, "_state");
          _updating$FU = AtomicIntegerFieldUpdater.newUpdater(cls, "_updating");
          onCloseHandler$FU = AtomicReferenceFieldUpdater.newUpdater(cls, Object.class, "onCloseHandler");
      }
  
      public ConflatedBroadcastChannel() {
          this._state = INITIAL_STATE;
          this._updating = 0;
          this.onCloseHandler = null;
      }
  
      public ConflatedBroadcastChannel(E value) {
          this();
          _state$FU.lazySet(this, new State(value, (Subscriber<E>[]) null));
      }
  
      private final Subscriber<E>[] addSubscriber(Subscriber<E>[] list, Subscriber<E> subscriber) {
          if (list != null) {
              return (Subscriber[]) ArraysKt.plus((T[]) list, subscriber);
          }
          Subscriber<E>[] subscriberArr = new Subscriber[1];
          for (int i = 0; i < 1; i++) {
              subscriberArr[i] = subscriber;
          }
          return subscriberArr;
      }
  
      /* access modifiers changed from: private */
      public final void closeSubscriber(Subscriber<E> subscriber) {
          Object obj;
          Object obj2;
          Subscriber<E>[] subscriberArr;
          do {
              obj = this._state;
              if (!(obj instanceof Closed)) {
                  if (obj instanceof State) {
                      obj2 = ((State) obj).value;
                      subscriberArr = ((State) obj).subscribers;
                      Intrinsics.checkNotNull(subscriberArr);
                  } else {
                      String stringPlus = Intrinsics.stringPlus("Invalid state ", obj);
                      Log1F380D.a((Object) stringPlus);
                      throw new IllegalStateException(stringPlus.toString());
                  }
              } else {
                  return;
              }
          } while (!AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(_state$FU, this, obj, new State(obj2, removeSubscriber(subscriberArr, subscriber))));
      }
  
      public static /* synthetic */ void getValue$annotations() {
      }
  
      private final void invokeOnCloseHandler(Throwable cause) {
          Object obj = this.onCloseHandler;
          if (obj != null && obj != AbstractChannelKt.HANDLER_INVOKED && AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(onCloseHandler$FU, this, obj, AbstractChannelKt.HANDLER_INVOKED)) {
              ((Function1) TypeIntrinsics.beforeCheckcastToFunctionOfArity(obj, 1)).invoke(cause);
          }
      }
  
      /* access modifiers changed from: private */
      public final <R> void registerSelectSend(SelectInstance<? super R> select, E element, Function2<? super SendChannel<? super E>, ? super Continuation<? super R>, ? extends Object> block) {
          if (select.trySelect()) {
              Closed offerInternal = offerInternal(element);
              if (offerInternal == null) {
                  UndispatchedKt.startCoroutineUnintercepted(block, this, select.getCompletion());
              } else {
                  select.resumeSelectWithException(offerInternal.getSendException());
              }
          }
      }
  
      private final Subscriber<E>[] removeSubscriber(Subscriber<E>[] list, Subscriber<E> subscriber) {
          int length = list.length;
          int indexOf = ArraysKt.indexOf((T[]) list, subscriber);
          if (DebugKt.getASSERTIONS_ENABLED()) {
              if (!(indexOf >= 0)) {
                  throw new AssertionError();
              }
          }
          if (length == 1) {
              return null;
          }
          Subscriber<E>[] subscriberArr = new Subscriber[(length - 1)];
          Subscriber<E>[] subscriberArr2 = list;
          Subscriber<E>[] subscriberArr3 = subscriberArr;
          ArraysKt.copyInto$default((Object[]) subscriberArr2, (Object[]) subscriberArr3, 0, 0, indexOf, 6, (Object) null);
          ArraysKt.copyInto$default((Object[]) subscriberArr2, (Object[]) subscriberArr3, indexOf, indexOf + 1, 0, 8, (Object) null);
          return subscriberArr;
      }
  
      public void cancel(CancellationException cause) {
          cancel(cause);
      }
  
      public SelectClause2<E, SendChannel<E>> getOnSend() {
          return new ConflatedBroadcastChannel$onSend$1(this);
      }
  
      public boolean isClosedForSend() {
          return this._state instanceof Closed;
      }
  
      @Deprecated(level = DeprecationLevel.ERROR, message = "Deprecated in the favour of 'trySend' method", replaceWith = @ReplaceWith(expression = "trySend(element).isSuccess", imports = {}))
      public boolean offer(E element) {
          return BroadcastChannel.DefaultImpls.offer(this, element);
      }
  
      public Object send(E element, Continuation<? super Unit> $completion) {
          Closed offerInternal = offerInternal(element);
          if (offerInternal != null) {
              throw offerInternal.getSendException();
          } else if (IntrinsicsKt.getCOROUTINE_SUSPENDED() == null) {
              return null;
          } else {
              return Unit.INSTANCE;
          }
      }
  
      /* renamed from: trySend-JP2dKIU  reason: not valid java name */
      public Object m1550trySendJP2dKIU(E element) {
          Closed offerInternal = offerInternal(element);
          return offerInternal == null ? ChannelResult.Companion.m1549successJP2dKIU(Unit.INSTANCE) : ChannelResult.Companion.m1547closedJP2dKIU(offerInternal.getSendException());
      }
  
      /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r4v0, resolved type: java.lang.Object} */
      /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r2v2, resolved type: kotlinx.coroutines.channels.ConflatedBroadcastChannel$Closed} */
      /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r7v0, resolved type: kotlinx.coroutines.channels.ConflatedBroadcastChannel$State} */
      /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v5, resolved type: kotlinx.coroutines.channels.ConflatedBroadcastChannel$State} */
      /* JADX WARNING: Multi-variable type inference failed */
      /* Code decompiled incorrectly, please refer to instructions dump. */
      private final kotlinx.coroutines.channels.ConflatedBroadcastChannel.Closed offerInternal(E r14) {
          /*
              r13 = this;
              java.util.concurrent.atomic.AtomicIntegerFieldUpdater r0 = _updating$FU
              r1 = 0
              r2 = 1
              boolean r0 = r0.compareAndSet(r13, r1, r2)
              r2 = 0
              if (r0 != 0) goto L_0x000c
              return r2
          L_0x000c:
              r0 = r13
              r3 = 0
          L_0x000f:
              java.lang.Object r4 = r0._state     // Catch:{ all -> 0x0064 }
              r5 = 0
              boolean r6 = r4 instanceof kotlinx.coroutines.channels.ConflatedBroadcastChannel.Closed     // Catch:{ all -> 0x0064 }
              if (r6 == 0) goto L_0x001e
              r2 = r4
              kotlinx.coroutines.channels.ConflatedBroadcastChannel$Closed r2 = (kotlinx.coroutines.channels.ConflatedBroadcastChannel.Closed) r2     // Catch:{ all -> 0x0064 }
          L_0x001b:
              r13._updating = r1
              return r2
          L_0x001e:
              boolean r6 = r4 instanceof kotlinx.coroutines.channels.ConflatedBroadcastChannel.State     // Catch:{ all -> 0x0064 }
              if (r6 == 0) goto L_0x0051
              kotlinx.coroutines.channels.ConflatedBroadcastChannel$State r6 = new kotlinx.coroutines.channels.ConflatedBroadcastChannel$State     // Catch:{ all -> 0x0064 }
              r7 = r4
              kotlinx.coroutines.channels.ConflatedBroadcastChannel$State r7 = (kotlinx.coroutines.channels.ConflatedBroadcastChannel.State) r7     // Catch:{ all -> 0x0064 }
              kotlinx.coroutines.channels.ConflatedBroadcastChannel$Subscriber<E>[] r7 = r7.subscribers     // Catch:{ all -> 0x0064 }
              r6.<init>(r14, r7)     // Catch:{ all -> 0x0064 }
              java.util.concurrent.atomic.AtomicReferenceFieldUpdater r7 = _state$FU     // Catch:{ all -> 0x0064 }
              boolean r7 = androidx.concurrent.futures.AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(r7, r13, r4, r6)     // Catch:{ all -> 0x0064 }
              if (r7 == 0) goto L_0x004e
              r0 = r4
              kotlinx.coroutines.channels.ConflatedBroadcastChannel$State r0 = (kotlinx.coroutines.channels.ConflatedBroadcastChannel.State) r0     // Catch:{ all -> 0x0064 }
              kotlinx.coroutines.channels.ConflatedBroadcastChannel$Subscriber<E>[] r0 = r0.subscribers     // Catch:{ all -> 0x0064 }
              if (r0 != 0) goto L_0x003c
              goto L_0x004c
          L_0x003c:
              r7 = 0
              int r8 = r0.length     // Catch:{ all -> 0x0064 }
              r9 = r1
          L_0x003f:
              if (r9 >= r8) goto L_0x004b
              r10 = r0[r9]     // Catch:{ all -> 0x0064 }
              int r9 = r9 + 1
              r11 = r10
              r12 = 0
              r11.offerInternal(r14)     // Catch:{ all -> 0x0064 }
              goto L_0x003f
          L_0x004b:
          L_0x004c:
              goto L_0x001b
          L_0x004e:
              goto L_0x000f
          L_0x0051:
              java.lang.IllegalStateException r0 = new java.lang.IllegalStateException     // Catch:{ all -> 0x0064 }
              java.lang.String r2 = "Invalid state "
              java.lang.String r2 = kotlin.jvm.internal.Intrinsics.stringPlus(r2, r4)     // Catch:{ all -> 0x0064 }
              mt.Log1F380D.a((java.lang.Object) r2)
              java.lang.String r2 = r2.toString()     // Catch:{ all -> 0x0064 }
              r0.<init>(r2)     // Catch:{ all -> 0x0064 }
              throw r0     // Catch:{ all -> 0x0064 }
          L_0x0064:
              r0 = move-exception
              r13._updating = r1
              throw r0
          */
          throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.channels.ConflatedBroadcastChannel.offerInternal(java.lang.Object):kotlinx.coroutines.channels.ConflatedBroadcastChannel$Closed");
      }
  
      /* renamed from: close */
      public boolean cancel(Throwable cause) {
          Object obj;
          int i;
          do {
              obj = this._state;
              i = 0;
              if (obj instanceof Closed) {
                  return false;
              }
              if (!(obj instanceof State)) {
                  String stringPlus = Intrinsics.stringPlus("Invalid state ", obj);
                  Log1F380D.a((Object) stringPlus);
                  throw new IllegalStateException(stringPlus.toString());
              }
          } while (!AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(_state$FU, this, obj, cause == null ? CLOSED : new Closed(cause)));
          Subscriber<E>[] subscriberArr = ((State) obj).subscribers;
          if (subscriberArr != null) {
              int length = subscriberArr.length;
              while (i < length) {
                  Subscriber<E> subscriber = subscriberArr[i];
                  i++;
                  subscriber.close(cause);
              }
          }
          invokeOnCloseHandler(cause);
          return true;
      }
  
      public final E getValue() {
          Object obj = this._state;
          if (obj instanceof Closed) {
              throw ((Closed) obj).getValueException();
          } else if (!(obj instanceof State)) {
              String stringPlus = Intrinsics.stringPlus("Invalid state ", obj);
              Log1F380D.a((Object) stringPlus);
              throw new IllegalStateException(stringPlus.toString());
          } else if (((State) obj).value != UNDEFINED) {
              return ((State) obj).value;
          } else {
              throw new IllegalStateException("No value");
          }
      }
  
      public final E getValueOrNull() {
          Object obj = this._state;
          if (obj instanceof Closed) {
              return null;
          }
          if (obj instanceof State) {
              E e = UNDEFINED;
              E e2 = ((State) obj).value;
              if (e2 == e) {
                  return null;
              }
              return e2;
          }
          String stringPlus = Intrinsics.stringPlus("Invalid state ", obj);
          Log1F380D.a((Object) stringPlus);
          throw new IllegalStateException(stringPlus.toString());
      }
  
      public void invokeOnClose(Function1<? super Throwable, Unit> handler) {
          AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = onCloseHandler$FU;
          if (!AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(atomicReferenceFieldUpdater, this, (Object) null, handler)) {
              Object obj = this.onCloseHandler;
              if (obj == AbstractChannelKt.HANDLER_INVOKED) {
                  throw new IllegalStateException("Another handler was already registered and successfully invoked");
              }
              String stringPlus = Intrinsics.stringPlus("Another handler was already registered: ", obj);
              Log1F380D.a((Object) stringPlus);
              throw new IllegalStateException(stringPlus);
          }
          Object obj2 = this._state;
          if ((obj2 instanceof Closed) && AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(atomicReferenceFieldUpdater, this, handler, AbstractChannelKt.HANDLER_INVOKED)) {
              handler.invoke(((Closed) obj2).closeCause);
          }
      }
  
      public ReceiveChannel<E> openSubscription() {
          Object obj;
          Subscriber subscriber = new Subscriber(this);
          do {
              obj = this._state;
              if (obj instanceof Closed) {
                  subscriber.close(((Closed) obj).closeCause);
                  return subscriber;
              } else if (obj instanceof State) {
                  if (((State) obj).value != UNDEFINED) {
                      subscriber.offerInternal(((State) obj).value);
                  }
              } else {
                  String stringPlus = Intrinsics.stringPlus("Invalid state ", obj);
                  Log1F380D.a((Object) stringPlus);
                  throw new IllegalStateException(stringPlus.toString());
              }
          } while (!AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0.m(_state$FU, this, obj, new State(((State) obj).value, addSubscriber(((State) obj).subscribers, subscriber))));
          return subscriber;
      }
  }
  