package p000.p001.p021.p022;

import android.graphics.Bitmap;
import java.security.MessageDigest;
import p138.p145.p146.p151.p154.p155.InterfaceC2942;
import p138.p145.p146.p151.p160.p161.AbstractC3084;
import p402.p411.p413.C6635;

/* JADX INFO: renamed from: ނ.֏.ؠ.֏.ކ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C1235 extends AbstractC3084 {

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static final C1235 f4334 = new C1235();

    @Override // p138.p145.p146.p151.InterfaceC2844
    public boolean equals(Object obj) {
        return obj instanceof C1235;
    }

    @Override // p138.p145.p146.p151.InterfaceC2844
    public int hashCode() {
        return C1236.f4335.hashCode();
    }

    /* JADX WARN: Code restructure failed: missing block: B:42:0x00b7, code lost:
    
        if (r2 == r1) goto L69;
     */
    @Override // p138.p145.p146.p151.p160.p161.AbstractC3084
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Bitmap mo2525(InterfaceC2942 interfaceC2942, Bitmap bitmap, int i, int i2) {
        if (interfaceC2942 == null) {
            C6635.m9824("pool");
            throw null;
        }
        if (bitmap == null) {
            C6635.m9824("toTransform");
            throw null;
        }
        int[] iArr = new int[bitmap.getHeight() * bitmap.getWidth()];
        bitmap.getPixels(iArr, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
        int width = bitmap.getWidth() - 1;
        int width2 = bitmap.getWidth();
        int i3 = 0;
        int i4 = 0;
        loop0: while (true) {
            if (i4 >= width2) {
                break;
            }
            int height = bitmap.getHeight();
            for (int i5 = 0; i5 < height; i5++) {
                if (iArr[(bitmap.getWidth() * i5) + i4] != 0) {
                    width = i4;
                    break loop0;
                }
            }
            i4++;
        }
        int width3 = bitmap.getWidth() - 1;
        if (width3 >= width) {
            loop2: while (true) {
                int height2 = bitmap.getHeight();
                for (int i6 = 0; i6 < height2; i6++) {
                    if (iArr[(bitmap.getWidth() * i6) + width3] != 0) {
                        break loop2;
                    }
                }
                if (width3 == width) {
                    break;
                }
                width3--;
            }
            width3 = 0;
        } else {
            width3 = 0;
        }
        int height3 = bitmap.getHeight() - 1;
        int height4 = bitmap.getHeight();
        int i7 = 0;
        loop4: while (true) {
            if (i7 >= height4) {
                break;
            }
            int width4 = bitmap.getWidth();
            for (int i8 = 0; i8 < width4; i8++) {
                if (iArr[(bitmap.getWidth() * i7) + i8] != 0) {
                    height3 = i7;
                    break loop4;
                }
            }
            i7++;
        }
        int height5 = bitmap.getHeight() - 1;
        if (height5 >= height3) {
            loop6: while (true) {
                int width5 = bitmap.getWidth();
                int i9 = 0;
                while (true) {
                    if (i9 >= width5) {
                        break;
                    }
                    if (iArr[(bitmap.getWidth() * height5) + i9] != 0) {
                        i3 = height5;
                        break loop6;
                    }
                    i9++;
                }
                height5--;
            }
        }
        if (width > width3 || height3 > i3) {
            return bitmap;
        }
        if (width == 0 && width3 == bitmap.getWidth() - 1 && height3 == 0 && i3 == bitmap.getHeight() - 1) {
            return bitmap;
        }
        Bitmap bitmapCreateBitmap = Bitmap.createBitmap(bitmap, width, height3, (width3 - width) + 1, (i3 - height3) + 1);
        C6635.m9823((Object) bitmapCreateBitmap, "Bitmap.createBitmap(toTr… + 1, lastY - firstY + 1)");
        return bitmapCreateBitmap;
    }

    @Override // p138.p145.p146.p151.InterfaceC2844
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo2526(MessageDigest messageDigest) {
        if (messageDigest != null) {
            messageDigest.update(C1236.f4336);
        } else {
            C6635.m9824("messageDigest");
            throw null;
        }
    }
}
