Skip to content

Instantly share code, notes, and snippets.

@samhenrigold
Last active April 29, 2025 20:41
Show Gist options
  • Save samhenrigold/89d9f10034cc91ec4f491e529e5f4fdc to your computer and use it in GitHub Desktop.
Save samhenrigold/89d9f10034cc91ec4f491e529e5f4fdc to your computer and use it in GitHub Desktop.
ChatKit Organic Image Layout Comprehensive Guide

ChatKit Organic Image Layout Comprehensive Guide

This document provides a complete reference for the organic image layout system used in ChatKit framework, combining technical specifications, implementation details, and mathematical algorithms extracted from the framework's source code.

Overview

The organic image layout system in ChatKit is a sophisticated mechanism that arranges multiple images in visually pleasing, dynamic layouts within iMessage conversations. Rather than displaying images in a simple grid, the organic layout system positions, rotates, and sizes images to create an aesthetically appealing, slightly randomized arrangement that adds visual interest to image groups.

Core Components

1. CKOrganicImageLayoutRecipe

The CKOrganicImageLayoutRecipe class defines the specifications for how an individual image should be positioned within the organic layout:

struct ImageLayoutRecipe {
    var rotation: CGFloat = 0
    var offset: CGPoint = .zero
    var targetSize: CGSize = .zero
    var overlap: CGFloat = 0
    var wantsShadow: Bool = false
    var relativeGroupCenter: CGFloat = 0
    var isLastItem: Bool = false
}
  • Rotation: Angle (in degrees) by which an image is rotated
  • Offset: Position offset within the group
  • TargetSize: The intended display size for the image
  • Overlap: How much the image should overlap with others
  • WantsShadow: Boolean indicating whether the image should have a shadow
  • GroupIdentifier: Used to identify related images in the same group
  • RelativeGroupCenter: Position relative to the group center
  • GroupMaxX: Maximum X coordinate for the group
  • IsLastItem: Boolean indicating if this is the last image in the group

2. CKOrganicImageLayoutGroupProvider

This class handles the arrangement of multiple images into cohesive groups:

  • Coordinates the layout of multiple images
  • Creates layout recipes for each image
  • Determines optimal image positioning and rotation
  • Handles different device orientations and screen sizes
  • Supports 2-3 images per group (with specific layout rules for each configuration)

3. CKOrganicImageBalloonView

This class renders the organic image layout:

  • Displays images according to their layout recipes
  • Handles rotation transformations
  • Applies corner rounding and shadow effects
  • Supports scheduled messages (with dashed border treatment)
  • Maintains proper z-ordering of images

4. Specialized Variants

  • CKOrganicImageLivePhotoBalloonView: Specialized version for Live Photos
  • CKOrganicPendingMomentShareBalloonView: For pending photo shares
  • CKPendingMomentSharePhotoStackBalloonView: Handles moment shares (photo collections)

Layout Algorithm

The layout algorithm follows these steps:

  1. Group Analysis: Determines the number of images (2-3 supported) and analyzes their sizes

  2. Recipe Generation: Creates a layout recipe for each image with:

    • Rotation angle based on a hash of the image's unique identifier
    • Position offset calculated relative to other images in the group
    • Target size based on the available screen space
    • Overlap factor to control image layering
  3. Layout Calculation:

    • Uses device orientation to determine optimal layout direction
    • Creates a layout spec with intersection points between images
    • Applies different layouts based on whether images are portrait or landscape
    • Generates more variation for 3-image layouts than 2-image layouts
  4. Rendering:

    • Applies appropriate transforms to each image
    • Handles proper corner rounding (20pt radius)
    • Adds shadows when specified
    • Sets corner curves for modern iOS appearance

Layout Rules

1. Two-Image Layout

  • Images typically overlap slightly
  • Rotation is subtle (usually less than one degree)
  • One image is slightly offset from the other
  • If both images are portrait orientation, they align differently than if both are landscape

2. Three-Image Layout

  • More complex intersection patterns
  • Greater variation in rotation angles
  • Images stack with calculated overlaps
  • Specific handling for mixed portrait/landscape orientations

3. Image Orientation Handling

  • Portrait vs. landscape orientation influences the layout algorithm
  • The orientation of each image affects its relative position in the group
  • Images are rotated slightly based on a hash of their unique identifier
  • Left vs. right rotation is determined by whether the message is from the user or someone else

Technical Specifications

1. Rotation Specification Matrix

The rotation logic uses a 2D matrix indexed by [orientation][otherOrientation] where:

  • orientation 0 = landscape, 1 = portrait
  • Value indicates whether to apply left rotation
static let startRotationSpec: [[Bool]] = [
    [false, true],
    [false, false]
]

This means:

  • When both images are landscape (0,0): no left rotation
  • When first is landscape, second is portrait (0,1): apply left rotation
  • When first is portrait, second is landscape (1,0): no left rotation
  • When both are portrait (1,1): no left rotation

The actual rotation direction combines this with the isFromMe property:

leftRotated = startRotationSpec[firstOrientation][secondOrientation] != isFromMe

2. Offset Specification Matrices

For 2 images:

static let startOffsetSpec2: [[Bool]] = [
    [false, false],
    [true, false]
]

For 3 images:

static let startOffsetSpec3: [[Bool]] = [
    [true, false],
    [true, true]
]

These matrices determine whether to use horizontal (true) or vertical (false) offsets based on the orientations of the images.

3. Intersection Specifications

These contain the exact overlap percentages to use:

For first image in group of 2:

static let intersectSpec_0_2: [[CGSize]] = [
    [CGSize(width: 0.7, height: 0.15), CGSize(width: 0.7, height: 0.12)],
    [CGSize(width: 0.6, height: 0.15), CGSize(width: 0.76, height: 0.1)]
]

For first image in group of 3:

static let intersectSpec_0_3: [[CGSize]] = [
    [CGSize(width: 0.7, height: 0.2), CGSize(width: 0.7, height: 0.12)],
    [CGSize(width: 0.6, height: 0.15), CGSize(width: 0.76, height: 0.1)]
]

For second image in group of 3:

static let intersectSpec_1_3: [[CGSize]] = [
    [CGSize(width: 0.7, height: 0.2), CGSize(width: 0.77, height: 0.08)],
    [CGSize(width: 0.6, height: 0.15), CGSize(width: 0.82, height: 0.1)]
]

The CGSize values represent width and height overlap percentages.

Rotation and Size Calculations

Core Rotation Formula

The rotation angle for images is calculated based on several factors:

rotation = baseRotationFactor * rotationMultiplier

Where:

  • baseRotationFactor is either 1.0 or -1.0 based on message direction (whether message is from the user)
  • rotationMultiplier is either 1.0 or 0.5 based on the hash of the image's unique identifier

Implementation Details

  1. Base Rotation Direction:

    • Images from the sender are rotated in one direction
    • Images from the receiver are rotated in the opposite direction
    • This is determined by XOR'ing two boolean values:
      leftRotated = startRotationSpec[orientation][otherOrientation] ^ isFromMe
      
    • If leftRotated is true, baseRotationFactor = -1.0, otherwise baseRotationFactor = 1.0
  2. Hash-Based Randomization:

    • Each image gets a unique, but deterministic rotation based on its GUID
    • The hash of the GUID is used to determine the rotation magnitude
    • If the lowest bit of the hash is 1 (hash & 1), then rotationMultiplier = 0.5, otherwise rotationMultiplier = 1.0
  3. Final Rotation Calculation:

    • For images where (hash & 1) == 1: rotation = baseRotationFactor * 0.5 (half degree rotation)
    • For other images: rotation = baseRotationFactor (full degree rotation)
  4. Transform Application:

    • The rotation in degrees is converted to radians: radians = degrees * π / 180.0
    • A CATransform3D matrix is created and applied to the view

The exact rotation formula:

// Base rotation direction: 1.0 or -1.0
let baseRotation: CGFloat = leftRotated ? -1.0 : 1.0

// Determine rotation magnitude from GUID hash
let rotationMultiplier: CGFloat = (guidHash & 1) != 0 ? 0.5 : 1.0

// Final rotation
let rotation = baseRotation * rotationMultiplier

This means:

  • Full rotations are ±1.0 degree
  • Half rotations are ±0.5 degree
  • Direction depends on leftRotated flag and isFromMe status

Size Calculation

The size calculation ensures images are displayed at appropriate dimensions while maintaining aspect ratio and ensuring a pleasing composition.

Target Size Calculation

  1. Original Size Check:

    if (width > 0.0 && height > 0.0) {
        maxWidth = sharedBehaviors.previewMaxWidth
        if (width <= maxWidth) {
            return (width, height)
        }
    }
    
  2. Size Scaling for Oversized Images:

    if (width > maxWidth || height > maxHeight) {
        scaleRatio = min(maxWidth/width, maxHeight/height)
        width = width * scaleRatio
        height = height * scaleRatio
    }
    
  3. Thumbnail Size Generation:

    thumbnailSize = thumbnailFillSizeForWidth(maxWidth, imageSize)
    

Overlap and Offset Calculation

The system calculates how much images should overlap based on orientation and group count:

  1. Overlap Factors:

    • For 2 or 3 image groups:
      • If image is in portrait orientation (height > width): overlap = 0.6 (60%)
      • If image is in landscape orientation (width > height): overlap = 0.75 (75%)
  2. Offset Calculation for Two Images:

    if (startOffsetSpec[orientation][otherOrientation]) {
        offset.x = secondImageWidth - (secondImageWidth * intersectionSpec[0][orientation][otherOrientation].width)
        offset.y = 0.0
    } else {
        offset.x = 0.0
        offset.y = firstImageHeight - (firstImageHeight * intersectionSpec[0][orientation][otherOrientation].height)
    }
    
  3. Three-Image Layout: When three images are present, special handling is applied for the third image:

    if (isThirdImage && !thirdImageOrientation && firstImageOrientation == 1) {
        offset.x = offset.x + offset.x * -0.949999988
    }
    

    This creates a cascading effect for the third image when specific orientation combinations occur.

The offset calculation uses the following logic:

if useHorizontalOffset {
    // Horizontal offset (width-based)
    secondOffset.x = secondImageWidth - (secondImageWidth * intersectSpec[orientation][otherOrientation].width)
    secondOffset.y = 0
} else {
    // Vertical offset (height-based)
    secondOffset.x = 0
    secondOffset.y = firstImageHeight - (firstImageHeight * intersectSpec[orientation][otherOrientation].height)
    
    // Special case for third image in specific orientation
    if count > 2 && !firstOrientation {
        if secondOrientation {
            secondOffset.x = secondOffset.y + secondOffset.y * -0.95
        }
    }
}

Group Layout Algorithm

The group layout algorithm combines the rotation and size calculations:

  1. Space Calculation:

    totalHeight = smallSpace + mediumSpace
    centerY = totalHeight * 0.5
    
  2. Layout Recipe Creation:

    image1Recipe = layoutRecipe(rotation: rotation1, offset: offset1, targetSize: targetSize1, overlap: 0.0, wantsShadow: false)
    image2Recipe = layoutRecipe(rotation: rotation2, offset: offset2, targetSize: targetSize2, overlap: image1Size * intersectSpec.height, wantsShadow: true)
    
  3. Relative Position: Each image is assigned a position relative to the group center:

    relativeGroupCenter = centerY - CGRectGetMidY(imageFrame)
    
  4. Layout Order: The last image in the group is marked with isLastItem = true to ensure proper z-ordering.

Full Layout Recipe Structure

ChatKit creates a complete layout recipe for each image with:

struct ImageLayoutRecipe {
    var rotation: CGFloat = 0
    var offset: CGPoint = .zero
    var targetSize: CGSize = .zero
    var overlap: CGFloat = 0
    var wantsShadow: Bool = false
    var relativeGroupCenter: CGFloat = 0
    var isLastItem: Bool = false
}

These recipes control the precise arrangement of the organic image layout:

  • First image in group:

    • rotation = rotation1
    • offset = .zero
    • targetSize = firstImageSize
    • overlap = 0.0
    • wantsShadow = false
    • isLastItem = false
  • Second image in group:

    • rotation = rotation2
    • offset = secondOffset
    • targetSize = secondImageSize
    • overlap = firstImageSize.height * intersectSpec.height
    • wantsShadow = true
    • isLastItem = (count == 2)
  • Third image in group (if present):

    • rotation = rotation3
    • offset = calculated based on first two images
    • targetSize = thirdImageSize
    • overlap = secondImageSize.height * thirdOverlapSizes.height
    • wantsShadow = true
    • isLastItem = true

Visual Effects

The organic layout includes several visual enhancements:

  1. Corner Radius: 20.0 points with modern corner curve style
  2. Shadow Radius: 27.0 points
  3. Shadow Opacity: 0.5
  4. Shadow Offset: CGSize(width: 0, height: 7)
  5. Edge Antialiasing: Enabled for crisp rendering
  6. Dashed Borders: For scheduled messages (when enabled via feature flag)

Special Layout Considerations

  1. Emoji Tapbacks:

    if (hasTapbacks && isEmojiTapbacksEnabled) {
        topSpace = extraLargeSpace
    } else {
        topSpace = mediumSpace
    }
    
  2. Dashed Border for Scheduled Messages:

    if (isScheduled && isDashedBalloonsEnabled) {
        // Add dashed border with stroke color matching balloon color
        // Line dash pattern from predefined pattern
        // Line width: 2.0
    }
    

Rendering Process

The complete rendering transforms for each image:

  1. Create CATransform3D identity matrix
  2. Convert rotation angle to radians: radians = degrees * 3.14159265 / 180.0
  3. Apply rotation transform: CATransform3DRotate(identityMatrix, radians, 0, 0, 1)
  4. Apply transform to view layer
  5. Position image within container accounting for offsets and overlaps
  6. Apply corner radius, shadow, and other visual effects

Image Placement

The placeSubviews method should:

  1. Iterate through images in reverse order (for proper z-ordering)
  2. Position each image using its offset from the group center point
  3. Apply the calculated rotation to each image
  4. Apply shadows based on wantsShadow flag

Integration with Message Composition

The organic image layout system integrates with:

  1. CKOrganicAttachmentMessagePartChatItem: The message model that uses organic layouts
  2. CKMessagePartChatItem: Base class for message parts that can be laid out organically
  3. CKTranscriptBalloonCell: Renders the organic layouts in the conversation transcript

Performance Considerations

  1. Shadow rendering is optimized by using setShadowPathIsBounds
  2. Edge antialiasing is enabled for visual quality
  3. Image views use content gravity settings for proper scaling
  4. Corner radius masking is applied consistently across layers

Limitations

  • The ChatKit implementation only supports 1-3 images
  • Orientation detection is binary (portrait or landscape)
  • Rotation angles are limited to a subtle ±1 degree maximum
@implementation CKMessagePartChatItem
- (void)description
{
void *v2;
uint64_t v3;
uint64_t v4;
int v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
uint64_t v10;
uint64_t v11;
_QWORD v12[2];
uint64_t vars8;
v2 = (void *)MEMORY[0x1E05E8418];
v12[0] = a1;
v12[1] = off_1E0B42878;
v3 = MEMORY[0x19303E000](v12, 0x1F1935DB8uLL);
v4 = MEMORY[0x19303DF20](v3);
v5 = objc_msgSend(a1, "color");
v6 = MEMORY[0x19303DF20](objc_msgSend(a1, "messageHighlightChatItem"));
v7 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "visibleAssociatedMessageChatItems")), "componentsJoinedByString:", &stru_1E8DB66F8);
v8 = objc_msgSend(v2, "stringWithFormat:", &stru_1E8DCC9B8, v4, v5, v6, MEMORY[0x19303DF20](v7));
MEMORY[0x19303DF20](v8);
v9 = MEMORY[0x19303E0F0]();
v10 = MEMORY[0x19303E090](v9);
v11 = MEMORY[0x19303E0E0](v10);
MEMORY[0x19303E0C0](v11);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)init
{
void *v1;
void *v2;
_QWORD v4[2];
v4[0] = a1;
v4[1] = off_1E0B42878;
v1 = (void *)MEMORY[0x19303E000](v4, 0x1F1CB4438uLL);
v2 = v1;
if (v1)
objc_msgSend(v1, "setCachedColor:", 4294967294LL);
return v2;
}
- (uint64_t)canCopy
{
return 1LL;
}
- (uint64_t)canForward
{
return 1LL;
}
- (uint64_t)canSendAsTextMessage
{
uint64_t v2;
uint64_t v4;
uint64_t v5;
uint64_t v6;
if ((unsigned int)objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isScheduledMessagesCoreEnabled"))
{
v2 = objc_msgSend(a1, "scheduleType");
MEMORY[0x19303E0B0]();
if (v2 == 2)
return 0LL;
}
else
{
MEMORY[0x19303E0B0]();
}
v4 = objc_msgSend(MEMORY[0x1E0628600], "serviceWithName:", MEMORY[0x19303DF20](objc_msgSend(a1, "serviceName")));
v5 = objc_msgSend((id)MEMORY[0x19303DF20](v4), "supportsCapability:", *MEMORY[0x1E062A7A8]);
v6 = MEMORY[0x19303E0B0]();
MEMORY[0x19303E090](v6);
return v5;
}
- (BOOL)canSendAsTextMessageOverSatellite
{
_BOOL8 v2;
if ((unsigned int)objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isScheduledMessagesCoreEnabled"))v2 = objc_msgSend(a1, "scheduleType") != 2;
else
v2 = 1LL;
MEMORY[0x19303E090]();
return v2;
}
- (uint64_t)canInlineReply
{
uint64_t v1;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "canReply");
MEMORY[0x19303E090]();
return v1;
}
- (uint64_t)canAttachStickers
{
int v2;
int v3;
uint64_t v4;
void *v5;
unint64_t v6;
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isScheduledMessagesCoreEnabled");
MEMORY[0x19303E0B0]();
v3 = objc_msgSend(a1, "isEditedMessageHistory");
if (!v2)
return v3 ^ 1u;
if ((v3 & 1) != 0)
return 0LL;
v5 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem"));
if (objc_msgSend(v5, "scheduleType") == 2)
{
v6 = objc_msgSend(v5, "scheduleState");
if (v6 <= 5)
v4 = (9u >> v6) & 1;
else
v4 = 1LL;
}
else
{
v4 = 1LL;
}
MEMORY[0x19303E090]();
return v4;
}
- (uint64_t)stickersSnapToPoint
{
return 1LL;
}
- (uint64_t)isFromMe
{
uint64_t v2;
void *v4;
uint64_t v5;
uint64_t v6;
v2 = MEMORY[0x19303DF20](objc_msgSend(a1, "notification"));
MEMORY[0x19303E0B0]();
if (v2)
return 0LL;
if ((unsigned int)CKIsRunningForDevelopmentOnSimulator()
|| (unsigned int)CKIsRunningUITests()
|| (unsigned int)CKIsRunningForDevelopmentOnSimulator()
|| (v6 = MEMORY[0x19303DF20](objc_msgSend(a1, "message")), MEMORY[0x19303E0B0](), !v6) )
{
v4 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem"));
}
else
{
v4 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "message"));
}
v5 = objc_msgSend(v4, "isFromMe");
MEMORY[0x19303E090]();
return v5;
}
- (uint64_t)failed
{
uint64_t result;
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
result = objc_msgSend(a1, "isFromMe");
if ((_DWORD)result)
{
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "message")), "error");
v4 = MEMORY[0x19303DF20](v3);
v5 = MEMORY[0x19303E0C0]();
MEMORY[0x19303E0B0](v5);
result = 1;
if (!v4)
{
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem")), "scheduleType");
MEMORY[0x19303E0B0]();
if (v6 != 2)
return 0;
v7 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem")), "scheduleState");
MEMORY[0x19303E090]();
if ((v7 & 0xFFFFFFFFFFFFFFFELL) != 4)
return 0;
}
}
return result;
}
- (void)time
{
uint64_t v2;
uint64_t v3;
void *v4;
uint64_t vars8;
v2 = MEMORY[0x19303DF20](objc_msgSend(a1, "notification"));
MEMORY[0x19303E0B0]();
if (v2)
{
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "notification")), "date");
MEMORY[0x19303DF20](v3);
}
else
{
if ((unsigned int)CKIsRunningForDevelopmentOnSimulator()
|| (unsigned int)CKIsRunningUITests()
|| (unsigned int)CKIsRunningForDevelopmentOnSimulator() )
{
v4 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem"));
}
else
{
v4 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "message"));
}
MEMORY[0x19303DF20](objc_msgSend(v4, "time"));
}
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)sender
{
void *v2;
uint64_t vars8;
if ((unsigned int)CKIsRunningForDevelopmentOnSimulator() || (unsigned int)CKIsRunningUITests())
v2 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem"));
else
v2 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "message"));
MEMORY[0x19303DF20](objc_msgSend(v2, "sender"));
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)serviceName
{
uint64_t v1;
uint64_t vars8;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "serviceName");
MEMORY[0x19303DF20](v1);
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (uint64_t)configureBalloonView:(void *)a3
{
return objc_msgSend(a3, "configureForMessagePart:", a1);
}
- (uint64_t)_isSURFRelatedMessage
{
uint64_t v2;
void *v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
void *v8;
uint64_t v9;
uint64_t v10;
uint64_t v11;
uint64_t v12;
uint64_t v13;
uint64_t v14;
uint64_t v15;
uint64_t v16;
uint64_t v17;
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "message")), "balloonBundleID");
v3 = (void *)MEMORY[0x19303DF20](v2);
v4 = *MEMORY[0x1E06293D0];
v5 = objc_msgSend(v3, "containsString:", *MEMORY[0x1E06293D0]);
if ((v5 & 1) != 0)
{
v6 = 1LL;
}
else
{
v7 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "message")), "balloonBundleID");
v8 = (void *)MEMORY[0x19303DF20](v7);
v9 = *MEMORY[0x1E06293D8];
v10 = objc_msgSend(v8, "containsString:", *MEMORY[0x1E06293D8]);
if ((v10 & 1) != 0)
{
v6 = 1LL;
}
else
{
v11 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "message")), "associatedBalloonBundleID");
v12 = objc_msgSend((id)MEMORY[0x19303DF20](v11), "containsString:", v4);
if ((v12 & 1) != 0)
{
v6 = 1LL;
}
else
{
v13 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "message")), "associatedBalloonBundleID");
v6 = objc_msgSend((id)MEMORY[0x19303DF20](v13), "containsString:", v9);
v14 = MEMORY[0x19303E130]();
v12 = MEMORY[0x19303E100](v14);
}
v15 = MEMORY[0x19303E110](v12);
v10 = MEMORY[0x19303E0F0](v15);
}
v16 = MEMORY[0x19303E0D0](v10);
v5 = MEMORY[0x19303E0C0](v16);
}
v17 = MEMORY[0x19303E0B0](v5);
MEMORY[0x19303E090](v17);
return v6;
}
- (void)message
{
uint64_t v1;
uint64_t vars8;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "message");
MEMORY[0x19303DF20](v1);
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)messageItem
{
uint64_t v1;
uint64_t vars8;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "messageItem");
MEMORY[0x19303DF20](v1);
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (uint64_t)index
{
uint64_t v1;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "index");
MEMORY[0x19303E090]();
return v1;
}
- (uint64_t)balloonStyle
{
int v2;
char v3;
uint64_t result;
uint64_t v5;
unint64_t v6;
int v7;
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isDashedBalloonsEnabled");
MEMORY[0x19303E0B0]();
if (v2)
{
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem")), "isPendingSatelliteSend");
MEMORY[0x19303E0B0]();
if ((v3 & 1) != 0)
return 4LL;
}
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem")), "scheduleType");
MEMORY[0x19303E0B0]();
if (v5 != 2)
return 0LL;
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem")), "scheduleState");
MEMORY[0x19303E0B0]();
result = 0LL;
if (v6 <= 5 && ((1LL << v6) & 0x36) != 0)
{
v7 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isDashedBalloonsEnabled");
MEMORY[0x19303E090]();
if (v7)
return 4LL;
else
return 2LL;
}
return result;
}
- (double)strokeColor
{
double v1;
int v3;
int v4;
unint64_t v5;
unint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
double v10;
uint64_t v11;
uint64_t v12;
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isDashedBalloonsEnabled");
MEMORY[0x19303E0B0]();
if (v3)
{
v4 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem")), "isPendingSatelliteSend");
MEMORY[0x19303E0B0]();
if (v4)
goto LABEL_8;
}
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem")), "scheduleType");
MEMORY[0x19303E0B0]();
if (v5 < 2)
return 0.0;
if (v5 == 2)
{
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem")), "scheduleState");
MEMORY[0x19303E0B0]();
if (v6 <= 5)
{
if (((1LL << v6) & 0x36) == 0)
return 0.0;
LABEL_8:
v7 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "theme");
v8 = objc_msgSend((id)MEMORY[0x19303DF20](v7), "unfilledBalloonColorForColorType:", 15LL);
v9 = objc_msgSend((id)MEMORY[0x19303DF20](v8), "ckColor");
v1 = v10;
v11 = MEMORY[0x19303E0C0](v9);
v12 = MEMORY[0x19303E0B0](v11);
MEMORY[0x19303E090](v12);
}
}
return v1;
}
- (uint64_t)color
{
uint64_t v2;
void *v3;
void *v4;
int v5;
unint64_t v6;
int v7;
char v9;
uint64_t v10;
uint64_t v11;
uint64_t v12;
uint64_t vars8;
if ((unsigned int)objc_msgSend(off_1E0AFC148, "isResizing") && (unsigned int)objc_msgSend(a1, "cachedColor") != -2)
{
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
return objc_msgSend(a1, "cachedColor");
}
else
{
if ((unsigned int)objc_msgSend(a1, "_isSURFRelatedMessage"))
{
LOBYTE(v2) = 5;
objc_msgSend(a1, "setCachedColor:", 5LL);
}
else if ((objc_msgSend(a1, "isFromMe") & 1) != 0)
{
v3 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "message"));
v4 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem"));
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isScheduledMessagesCoreEnabled");
MEMORY[0x19303E0D0]();
if (v5
&& objc_msgSend(v4, "scheduleType") == 2
&& (v6 = objc_msgSend(v4, "scheduleState") - 1, v6 < 5)
&& ((0x1Bu >> v6) & 1) != 0
|| (v7 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isDashedBalloonsEnabled"), MEMORY[0x19303E0D0](), v7)&& (objc_msgSend(v3, "isPendingSatelliteSend") & 1) != 0 )
{
v2 = 15LL;
}
else
{
v9 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "isRunningInStoreDemoMode");
MEMORY[0x19303E0D0]();
if ((v9 & 1) != 0)
{
v2 = 1LL;
}
else if ((objc_msgSend(v4, "isStewie") & 1) != 0)
{
v2 = 12LL;
}
else if ((objc_msgSend(v4, "isBusiness") & 1) != 0)
{
v2 = 6LL;
}
else if ((objc_msgSend(v3, "wasDowngraded") & 1) != 0)
{
v2 = 0LL;
}
else
{
v10 = objc_msgSend(MEMORY[0x1E0628600], "serviceWithName:", MEMORY[0x19303DF20](objc_msgSend(a1, "serviceName")));
v2 = objc_msgSend((id)MEMORY[0x19303DF20](v10), "__ck_displayColor");
v11 = MEMORY[0x19303E0F0]();
MEMORY[0x19303E0E0](v11);
}
}
v12 = MEMORY[0x19303E0C0](objc_msgSend(a1, "setCachedColor:", v2));
MEMORY[0x19303E0B0](v12);
}
else
{
objc_msgSend(a1, "setCachedColor:", 0xFFFFFFFFLL);
LOBYTE(v2) = -1;
}
return (unsigned int)(char)v2;
}
}
- (uint64_t)rtfDocumentItemsWithFormatString:selectedTextRange:
{
return 0LL;
}
- (uint64_t)pasteboardItemProviders
{
uint64_t v1;
uint64_t v2;
uint64_t v4;
uint64_t v5;
uint64_t vars8;
v5 = *MEMORY[0x1E05D4338];
v1 = MEMORY[0x19303DF20](objc_msgSend(a1, "dragItemProvider"));
if (v1)
{
v4 = v1;
MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC3F8], "arrayWithObjects:count:", &v4, 1LL));
}
v2 = MEMORY[0x19303E090]();
if (*MEMORY[0x1E05D4338] == v5)
{
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
MEMORY[0x19303D8F0](v2);
return -[CKMessagePartChatItem dragItemProvider]();
}
- (uint64_t)dragItemProvider
{
return 0LL;
}
- (uint64_t)fileURLForAttachment
{
return 0LL;
}
- (uint64_t)initWithIMChatItem:(uint64_t)a1 maxWidth:(double)a2
{
id *v3;
id *v4;
uint64_t v5;
uint64_t v6;
char v7;
void *v8;
void *v9;
void *v10;
void *v11;
uint64_t v12;
uint64_t v13;
uint64_t v14;
uint64_t i;
uint64_t v16;
uint64_t v17;
void *v18;
uint64_t v19;
uint64_t v20;
uint64_t v21;
uint64_t v22;
uint64_t v24;
__int128 v25;
__int128 v26;
__int128 v27;
__int128 v28;
_QWORD v29[2];
_BYTE v30[128];
uint64_t v31;
v31 = *MEMORY[0x1E05D4338];
v29[0] = a1;
v29[1] = off_1E0B42878;
v3 = (id *)MEMORY[0x19303E000](v29, off_1E0B21BF0);
v4 = v3;
if (v3)
{
v5 = MEMORY[0x19303DF20](objc_msgSend(v3, "IMChatItem"));
v6 = MEMORY[0x19303E010](MEMORY[0x1E0628580]);
v7 = MEMORY[0x19303E020](v5, v6);
MEMORY[0x19303E0B0]();
if ((v7 & 1) != 0)
{
v8 = (void *)MEMORY[0x19303DF20](objc_msgSend(v4, "IMChatItem"));
v9 = (void *)MEMORY[0x19303DF20](objc_msgSend(v8, "visibleAssociatedMessageChatItems"));
if (v9)
{
v10 = (void *)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC4C8], "arrayWithCapacity:", objc_msgSend(v9, "count")));
v25 = 0u;
v26 = 0u;
v27 = 0u;
v28 = 0u;
v11 = (void *)MEMORY[0x19303E210](v10);
v12 = objc_msgSend(v11, "countByEnumeratingWithState:objects:count:", &v25, v30, 16LL);
if (v12)
{
v13 = v12;
v14 = *(_QWORD *)v26;
do
{
for (i = 0LL; i != v13; ++i)
{
if (*(_QWORD *)v26 != v14)
MEMORY[0x19303DF70](v11);
v16 = objc_msgSend((id)MEMORY[0x19303DEA0](objc_msgSend(*(id *)(*((_QWORD *)&v25 + 1) + 8 * i), "__ck_chatItemClass")), "initWithIMChatItem:maxWidth:", *(_QWORD *)(*((_QWORD *)&v25 + 1) + 8 * i), a2);
if (v16)
v16 = objc_msgSend(v10, "addObject:", v16);
MEMORY[0x19303E100](v16);
}
v13 = objc_msgSend(v11, "countByEnumeratingWithState:objects:count:", &v25, v30, 16LL);
}
while (v13);
}
MEMORY[0x19303E0E0]();
}
else
{
v10 = 0LL;
}
objc_storeStrong(v4 + 25, v10);
v17 = MEMORY[0x19303DF20](objc_msgSend(v8, "messageHighlightChatItem"));
MEMORY[0x19303E0E0]();
if (v17)
{
v18 = (void *)MEMORY[0x19303DEA0](off_1E0AFCAE8);
v4[27] = (id)objc_msgSend(v18, "initWithIMChatItem:maxWidth:", MEMORY[0x19303DF20](objc_msgSend(v8, "messageHighlightChatItem")), a2);
v19 = MEMORY[0x19303E150]();
MEMORY[0x19303E0F0](v19);
}
v4[26] = (id)MEMORY[0x19303DF20](objc_msgSend(v8, "suggestedActionsList"));
v20 = MEMORY[0x19303E150]();
v21 = MEMORY[0x19303E0D0](v20);
v22 = MEMORY[0x19303E0C0](v21);
MEMORY[0x19303E0B0](v22);
}
v3 = (id *)objc_msgSend(v4, "setCachedColor:", 4294967294LL);
}
if (*MEMORY[0x1E05D4338] == v31)
return (uint64_t)v4;
v24 = MEMORY[0x19303D8F0](v3);
return -[CKMessagePartChatItem tapbackActionButtonImageName](v24);
}
- (uint64_t)tapbackActionButtonImageName
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
__CFString *v5;
void *v6;
__CFString *v7;
uint64_t v8;
__CFString *v9;
if ((unsigned int)objc_msgSend(a1, "hasMessageAcknowledgment"))
{
v2 = MEMORY[0x19303DF20](objc_msgSend(a1[25], "lastObject"));
v3 = MEMORY[0x19303E010](off_1E0AFC060);
v4 = MEMORY[0x19303E020](v2, v3);
v5 = &stru_1E8DB0098;
if ((v4 & 1) != 0)
{
v6 = (void *)MEMORY[0x19303E1E0]();
if ((unsigned int)objc_msgSend(v6, "includesMultiple"))
v7 = &stru_1E8DCC9F8;
else
v7 = &stru_1E8DB0098;
v8 = objc_msgSend(v6, "latestAcknowledgmentType");
if (objc_msgSend(v6, "fromMeAcknowledgmentType"))
{
v8 = objc_msgSend(v6, "fromMeAcknowledgmentType");
v5 = &stru_1E8DCCA18;
}
if ((unint64_t)(v8 - 2000) > 5)
v9 = &stru_1E8DB2C98;
else
v9 = (__CFString *)qword_1E0B09840[v8 - 2000];
v4 = MEMORY[0x19303E0B0]();
}
else
{
v9 = &stru_1E8DB2C98;
v7 = &stru_1E8DB0098;
}
MEMORY[0x19303E090](v4);
}
else
{
v7 = &stru_1E8DB0098;
v9 = &stru_1E8DB2C98;
v5 = &stru_1E8DB0098;
}
return objc_msgSend(MEMORY[0x1E05E8418], "stringWithFormat:", &stru_1E8DCCA98, v9, &stru_1E8DCC9D8, v7, v5);
}
- (uint64_t)tapbacksChatItem
{
void *v1;
uint64_t v2;
uint64_t v3;
uint64_t i;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
__int128 v10;
__int128 v11;
__int128 v12;
__int128 v13;
_BYTE v14[128];
uint64_t v15;
uint64_t vars8;
v15 = *MEMORY[0x1E05D4338];
v10 = 0u;
v11 = 0u;
v12 = 0u;
v13 = 0u;
v1 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "visibleAssociatedMessageChatItems", 0LL));
v2 = objc_msgSend(v1, "countByEnumeratingWithState:objects:count:", &v10, v14, 16LL);
if (v2)
{
v3 = *(_QWORD *)v11;
while (2)
{
for (i = 0LL; i != v2; ++i)
{
if (*(_QWORD *)v11 != v3)
MEMORY[0x19303DF70](v1);
v5 = *(_QWORD *)(*((_QWORD *)&v10 + 1) + 8 * i);
v6 = MEMORY[0x19303E010](off_1E0AFC060);
if ((MEMORY[0x19303E020](v5, v6) & 1) != 0)
{
MEMORY[0x19303E210]();
goto LABEL_11;
}
}
v2 = objc_msgSend(v1, "countByEnumeratingWithState:objects:count:", &v10, v14, 16LL);
if (v2)
continue;
break;
}
}
LABEL_11:
v7 = MEMORY[0x19303E090]();
if (*MEMORY[0x1E05D4338] == v15)
{
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
v8 = MEMORY[0x19303D8F0](v7);
return -[CKMessagePartChatItem canSendTapbacks](v8);
}
- (uint64_t)canSendTapbacks
{
uint64_t v2;
int v4;
void *v5;
unint64_t v6;
if ((objc_msgSend(a1, "isEditedMessageHistory") & 1) != 0 || (objc_msgSend(a1, "itemIsReplyContextPreview") & 1) != 0)
return 0LL;
v4 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isScheduledMessagesCoreEnabled");
MEMORY[0x19303E0B0]();
if (!v4)
return 1LL;
v5 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "messageItem"));
if (objc_msgSend(v5, "scheduleType") == 2)
{
v6 = objc_msgSend(v5, "scheduleState");
if (v6 <= 5)
v2 = (9u >> v6) & 1;
else
v2 = 1LL;
}
else
{
v2 = 1LL;
}
MEMORY[0x19303E090]();
return v2;
}
- (uint64_t)messagePartRange
{
void *v1;
uint64_t v2;
v1 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem"));
if ((MEMORY[0x19303E040](v1, 0x1F23925B7uLL) & 1) != 0)
v2 = objc_msgSend(v1, "messagePartRange");
else
v2 = 0LL;
MEMORY[0x19303E090]();
return v2;
}
- (uint64_t)originalMessagePartRange
{
uint64_t v1;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "originalMessagePartRange");
MEMORY[0x19303E090]();
return v1;
}
- (BOOL)hasMessageAcknowledgment
{
_BOOL8 v1;
v1 = MEMORY[0x19303DF20](objc_msgSend(a1, "tapbacksChatItem")) != 0;
MEMORY[0x19303E060]();
return v1;
}
- (uint64_t)hasStickers
{
void *v1;
uint64_t v2;
uint64_t v3;
uint64_t i;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v9;
__int128 v10;
__int128 v11;
__int128 v12;
__int128 v13;
_BYTE v14[128];
uint64_t v15;
v15 = *MEMORY[0x1E05D4338];
v10 = 0u;
v11 = 0u;
v12 = 0u;
v13 = 0u;
v1 = (void *)MEMORY[0x19303E2E0](a1);
v2 = objc_msgSend(v1, "countByEnumeratingWithState:objects:count:", &v10, v14, 16LL);
if (v2)
{
v3 = *(_QWORD *)v11;
while (2)
{
for (i = 0LL; i != v2; ++i)
{
if (*(_QWORD *)v11 != v3)
MEMORY[0x19303DF70](v1);
v5 = *(_QWORD *)(*((_QWORD *)&v10 + 1) + 8 * i);
v6 = MEMORY[0x19303E010](off_1E0AFC168);
if ((MEMORY[0x19303E020](v5, v6) & 1) != 0)
{
v2 = 1LL;
goto LABEL_11;
}
}
v2 = objc_msgSend(v1, "countByEnumeratingWithState:objects:count:", &v10, v14, 16LL);
if (v2)
continue;
break;
}
}
LABEL_11:
v7 = MEMORY[0x19303E090]();
if (*MEMORY[0x1E05D4338] == v15)
return v2;
v9 = MEMORY[0x19303D8F0](v7);
return -[CKMessagePartChatItem isCorrupt](v9);
}
- (uint64_t)isCorrupt
{
uint64_t v1;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "isCorrupt");
MEMORY[0x19303E090]();
return v1;
}
- (uint64_t)stewieConversationID
{
uint64_t v1;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "stewieConversationID");
MEMORY[0x19303E090]();
return v1;
}
- (uint64_t)isBlackholed
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t result;
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "message")), "error");
v3 = objc_msgSend((id)MEMORY[0x19303DF20](v2), "code");
v4 = MEMORY[0x19303E0C0]();
MEMORY[0x19303E0B0](v4);
LODWORD(result) = objc_msgSend(a1, "isFromMe");
if (v3 == 43)
return (unsigned int)result;
else
return 0LL;
}
- (uint64_t)isReply
{
uint64_t v2;
if (objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "threadIdentifier")), "length"))
v2 = (unsigned int)objc_msgSend(a1, "wantsOverlayLayout") ^ 1;
else
v2 = 0LL;
MEMORY[0x19303E090]();
return v2;
}
- (uint64_t)isReplyContextPreview
{
return 0LL;
}
- (void)threadIdentifier
{
uint64_t v1;
uint64_t vars8;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "threadIdentifier");
MEMORY[0x19303DF20](v1);
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)threadOriginator
{
uint64_t v1;
uint64_t vars8;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "threadOriginator");
MEMORY[0x19303DF20](v1);
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (uint64_t)scheduleType
{
uint64_t v1;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "scheduleType");
MEMORY[0x19303E090]();
return v1;
}
- (uint64_t)scheduleState
{
uint64_t v1;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem")), "scheduleState");
MEMORY[0x19303E090]();
return v1;
}
- (double)timeIntervalSinceMessageSent
{
uint64_t v1;
uint64_t v2;
double v3;
double v4;
uint64_t v5;
v1 = MEMORY[0x19303DF20](objc_msgSend(a1, "time"));
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC440], "__im_dateWithCurrentServerTime")), "timeIntervalSinceDate:", v1);
v4 = v3;
v5 = MEMORY[0x19303E0B0](v2);
MEMORY[0x19303E090](v5);
return v4;
}
- (void)_setVisibleAssociatedMessageChatItems:(void *)a3
{
uint64_t v5;
id *v6;
uint64_t vars8;
v5 = MEMORY[0x19303E1E0]();
v6 = (id *)(a1 + 200);
if (*v6 != (id)v5 && (objc_msgSend(*v6, "isEqualToArray:", v5) & 1) == 0)
objc_storeStrong(v6, a3);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E070LL);
}
- (uint64_t)hasVisibleAssociatedMessageItems
{
void *v1;
uint64_t v2;
uint64_t v3;
uint64_t i;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v9;
__int128 v10;
__int128 v11;
__int128 v12;
__int128 v13;
_BYTE v14[128];
uint64_t v15;
v15 = *MEMORY[0x1E05D4338];
v10 = 0u;
v11 = 0u;
v12 = 0u;
v13 = 0u;
v1 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "visibleAssociatedMessageChatItems", 0LL));
v2 = objc_msgSend(v1, "countByEnumeratingWithState:objects:count:", &v10, v14, 16LL);
if (v2)
{
v3 = *(_QWORD *)v11;
while (2)
{
for (i = 0LL; i != v2; ++i)
{
if (*(_QWORD *)v11 != v3)
MEMORY[0x19303DF70](v1);
v5 = *(_QWORD *)(*((_QWORD *)&v10 + 1) + 8 * i);
v6 = MEMORY[0x19303E010](off_1E0AFC060);
if ((MEMORY[0x19303E020](v5, v6) & 1) != 0)
{
v2 = 1LL;
goto LABEL_11;
}
}
v2 = objc_msgSend(v1, "countByEnumeratingWithState:objects:count:", &v10, v14, 16LL);
if (v2)
continue;
break;
}
}
LABEL_11:
v7 = MEMORY[0x19303E090]();
if (*MEMORY[0x1E05D4338] == v15)
return v2;
v9 = MEMORY[0x19303D8F0](v7);
return -[CKMessagePartChatItem visibleAssociatedMessageChatItems](v9);
}
- (uint64_t)visibleAssociatedMessageChatItems
{
return *(_QWORD *)(a1 + 200);
}
- (uint64_t)suggestedActionsList
{
return *(_QWORD *)(a1 + 208);
}
- (uint64_t)messageHighlightChatItem
{
return *(_QWORD *)(a1 + 216);
}
- (uint64_t)cachedColor
{
return (unsigned int)*(char *)(a1 + 192);
}
- (uint64_t)setCachedColor:(char)a3
{
*(_BYTE *)(result + 192) = a3;
return result;
}
- (void).cxx_destruct
{
uint64_t vars8;
objc_storeStrong(a1 + 27, 0LL);
objc_storeStrong(a1 + 26, 0LL);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
objc_storeStrong(a1 + 25, 0LL);
}
@end
@implementation CKOrganicAttachmentMessagePartChatItem
- (void)initWithIMChatItem:(uint64_t)a1 maxWidth:
{
void *v1;
uint64_t v2;
uint64_t v3;
void *v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t i;
void *v9;
uint64_t v10;
__int128 v12;
__int128 v13;
__int128 v14;
__int128 v15;
_QWORD v16[2];
_BYTE v17[128];
uint64_t v18;
v18 = *MEMORY[0x1E05D4338];
v16[0] = a1;
v16[1] = off_1E0B424C0;
v1 = (void *)MEMORY[0x19303E000](v16, off_1E0B21BF0);
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v1, "visibleAssociatedMessageChatItems")), "count");
v3 = MEMORY[0x19303E0B0]();
if (v2)
{
v14 = 0u;
v15 = 0u;
v12 = 0u;
v13 = 0u;
v4 = (void *)MEMORY[0x19303DF20](objc_msgSend(v1, "visibleAssociatedMessageChatItems", 0LL));
v5 = objc_msgSend(v4, "countByEnumeratingWithState:objects:count:", &v12, v17, 16LL);
if (v5)
{
v6 = v5;
v7 = *(_QWORD *)v13;
do
{
for (i = 0LL; i != v6; ++i)
{
if (*(_QWORD *)v13 != v7)
MEMORY[0x19303DF70](v4);
v9 = *(void **)(*((_QWORD *)&v12 + 1) + 8 * i);
v10 = MEMORY[0x19303E010](off_1E0AFC060);
if ((MEMORY[0x19303E020](v9, v10) & 1) != 0)
objc_msgSend(v9, "setParentIsOrganicLayout:", 1LL);
}
v6 = objc_msgSend(v4, "countByEnumeratingWithState:objects:count:", &v12, v17, 16LL);
}
while (v6);
}
v3 = MEMORY[0x19303E0B0]();
}
if (*MEMORY[0x1E05D4338] != v18)
{
MEMORY[0x19303D8F0](v3);
-[CKOrganicAttachmentMessagePartChatItem customLayoutGroupProviderClass]();
}
return v1;
}
- (void)customLayoutGroupProviderClass
{
JUMPOUT(0x19303E010LL);
}
- (void)cellClass
{
JUMPOUT(0x19303E010LL);
}
- (uint64_t)supportsInlineReplyTransition
{
return 0LL;
}
- (void)balloonViewClass
{
uint64_t v2;
uint64_t v3;
char v4;
uint64_t vars8;
MEMORY[0x19303E010](off_1E0AFCC18);
v2 = MEMORY[0x19303DF20](objc_msgSend(a1, "IMChatItem"));
v3 = MEMORY[0x19303E010](MEMORY[0x1E06285A8]);
v4 = MEMORY[0x19303E020](v2, v3);
MEMORY[0x19303E0B0]();
if ((v4 & 1) != 0)
MEMORY[0x19303E010](off_1E0AFCC38);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E180LL);
}
- (uint64_t)balloonCorners
{
return 0LL;
}
- (double)loadSizeThatFits:(double)a3 textAlignmentInsets:
{
double v5;
double v6;
double v7;
double v8;
double v9;
_QWORD v11[2];
v11[0] = a1;
v11[1] = off_1E0B424C0;
v5 = MEMORY[0x19303E000](v11, 0x1F238C97BuLL);
v7 = a2 * dbl_18F77E190[v5 < v6];
if (a3 < v7)
{
v8 = a2 / a2;
v9 = 0.0;
if (a2 == 0.0)
v8 = 0.0;
if (v7 != 0.0)
v9 = a3 / v7;
a2 = a2 * fmin(v8, v9);
}
return ceil(a2);
}
- (uint64_t)layoutRecipe
{
return *(_QWORD *)(a1 + 256);
}
- (void)setLayoutRecipe:(id)obj
{
objc_storeStrong((id *)(a1 + 256), obj);
}
- (void).cxx_destruct
{
objc_storeStrong((id *)(a1 + 256), 0LL);
}
@end
@implementation CKOrganicImageBalloonView
- (void)initWithFrame:(double)a3
{
void *v9;
id v10;
uint64_t v11;
_QWORD v13[2];
v13[0] = a1;
v13[1] = off_1E0B419D8;
v9 = (void *)MEMORY[0x19303E000](v13, 0x1F0DDABB8uLL);
if (v9)
{
MEMORY[0x19303DEA0](off_1E0AFC278);
MEMORY[0x19303E0B0](objc_msgSend(v9, "setImageView:", objc_msgSend(v10, "initWithFrame:", a2, a3, a4, a5)));
v11 = objc_msgSend(v9, "addSubview:", MEMORY[0x19303DF20](objc_msgSend(v9, "imageView")));
MEMORY[0x19303E0B0](v11);
}
return v9;
}
- (uint64_t)prepareForDisplay
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
void *v10;
uint64_t v11;
uint64_t v12;
uint64_t v13;
uint64_t v14;
uint64_t v15;
uint64_t v16;
int v17;
uint64_t v18;
uint64_t v19;
void *v20;
uint64_t v21;
uint64_t v22;
uint64_t v23;
uint64_t v24;
uint64_t v25;
uint64_t v26;
uint64_t v27;
uint64_t v28;
uint64_t v29;
void *v30;
uint64_t v31;
uint64_t v32;
uint64_t v33;
uint64_t v34;
uint64_t v35;
uint64_t v36;
uint64_t v37;
void *v38;
uint64_t v39;
uint64_t v40;
uint64_t v41;
uint64_t v42;
double v43;
double v44;
__int128 v45;
int v46;
uint64_t v47;
void *v48;
double v49;
uint64_t v50;
uint64_t v51;
uint64_t v52;
uint64_t v53;
uint64_t v54;
uint64_t v55;
_OWORD v57[3];
_OWORD v58[3];
__int128 v59;
__int128 v60;
__int128 v61;
double v62;
double v63;
double v64;
double v65;
_QWORD v66[2];
v66[0] = a1;
v66[1] = off_1E0B419D8;
MEMORY[0x19303E000](v66, 0x1F19B4238uLL);
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "invisibleInkEffectController")), "prepareForDisplay");
MEMORY[0x19303E0B0](v2);
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "layer");
v4 = objc_msgSend((id)MEMORY[0x19303DF20](v3), "setContentsGravity:", *MEMORY[0x1E05F8E80]);
v5 = MEMORY[0x19303E0C0](v4);
MEMORY[0x19303E0B0](v5);
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "layer");
v7 = objc_msgSend((id)MEMORY[0x19303DF20](v6), "setCornerRadius:", 20.0);
v8 = MEMORY[0x19303E0C0](v7);
MEMORY[0x19303E0B0](v8);
v9 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "layer");
v10 = (void *)MEMORY[0x19303DF20](v9);
v11 = *MEMORY[0x1E05F8958];
v12 = MEMORY[0x19303E0D0](objc_msgSend(v10, "setCornerCurve:", *MEMORY[0x1E05F8958]));
MEMORY[0x19303E0C0](v12);
v13 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "layer");
v14 = objc_msgSend((id)MEMORY[0x19303DF20](v13), "setMasksToBounds:", 1LL);
v15 = MEMORY[0x19303E0D0](v14);
MEMORY[0x19303E0C0](v15);
v16 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")), "removeFromSuperlayer");
MEMORY[0x19303E0C0](v16);
if ((unsigned int)objc_msgSend(a1, "isScheduled"))
{
v17 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isDashedBalloonsEnabled");
MEMORY[0x19303E0C0]();
if (v17)
{
v18 = MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder"));
MEMORY[0x19303E0C0]();
if (!v18)
{
v19 = objc_msgSend(a1, "setDashedBorder:", MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05F8738], "layer")));
MEMORY[0x19303E0C0](v19);
v20 = (void *)MEMORY[0x1E0600628];
objc_msgSend(a1, "balloonDescriptor");
v21 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v20, "ck_colorWithCKColor:", v62, v63, v64, v65)), "cgColor");
v22 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")), "setStrokeColor:", v21);
v23 = MEMORY[0x19303E0E0](v22);
MEMORY[0x19303E0C0](v23);
v24 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")), "setFillColor:", 0LL);
MEMORY[0x19303E0C0](v24);
v25 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")), "setLineDashPattern:", &unk_1E8E7B188);
MEMORY[0x19303E0C0](v25);
v26 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")), "setLineWidth:", 2.0);
MEMORY[0x19303E0C0](v26);
v27 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")), "setCornerRadius:", 20.0);
MEMORY[0x19303E0C0](v27);
v28 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")), "setCornerCurve:", v11);
MEMORY[0x19303E0C0](v28);
v29 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")), "setAllowsEdgeAntialiasing:", 1LL);
MEMORY[0x19303E0C0](v29);
}
v30 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "layer"));
v31 = objc_msgSend(v30, "addSublayer:", MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")));
v32 = MEMORY[0x19303E0D0](v31);
MEMORY[0x19303E0C0](v32);
}
v33 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setCornerRadius:", 20.0);
MEMORY[0x19303E0C0](v33);
v34 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setCornerCurve:", v11);
MEMORY[0x19303E0C0](v34);
v35 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setMasksToBounds:", 1LL);
MEMORY[0x19303E0C0](v35);
v36 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "setAlpha:", 0.5);
MEMORY[0x19303E0C0](v36);
}
v37 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "invisibleInkEffectController")), "effectView");
v38 = (void *)MEMORY[0x19303DF20](v37);
MEMORY[0x19303E0D0]();
v39 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v38, "layer")), "setCornerRadius:", 20.0);
MEMORY[0x19303E0D0](v39);
v40 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v38, "layer")), "setCornerCurve:", v11);
MEMORY[0x19303E0D0](v40);
v41 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v38, "layer")), "setMasksToBounds:", 1LL);
MEMORY[0x19303E0B0](v41);
v42 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layoutRecipe")), "rotation");
v44 = v43;
MEMORY[0x19303E0B0](v42);
v60 = 0u;
v61 = 0u;
v59 = 0u;
v45 = *(_OWORD *)(MEMORY[0x1E05DD4E8] + 16LL);
v58[0] = *MEMORY[0x1E05DD4E8];
v58[1] = v45;
v58[2] = *(_OWORD *)(MEMORY[0x1E05DD4E8] + 32LL);
MEMORY[0x19303BBE0](&v59, v58, v44 * 3.14159265 / 180.0);
v57[0] = v59;
v57[1] = v60;
v57[2] = v61;
objc_msgSend(a1, "setTransform:", v57);
v46 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layoutRecipe")), "wantsShadow");
MEMORY[0x19303E0B0]();
if (v46)
{
v47 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setShadowOffset:", 0.0, 7.0);
MEMORY[0x19303E0B0](v47);
v48 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "layer"));
LODWORD(v49) = 1045220557;
MEMORY[0x19303E0B0](objc_msgSend(v48, "setShadowOpacity:", v49));
v50 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setShadowRadius:", 27.0);
MEMORY[0x19303E0B0](v50);
v51 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setShadowPathIsBounds:", 1LL);
MEMORY[0x19303E0B0](v51);
}
v52 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "layer");
v53 = objc_msgSend((id)MEMORY[0x19303DF20](v52), "setAllowsEdgeAntialiasing:", 1LL);
v54 = MEMORY[0x19303E0B0](v53);
v55 = MEMORY[0x19303E090](v54);
return MEMORY[0x19303E0C0](v55);
}
- (uint64_t)setMonoskiBadgeView:(uint64_t)a1
{
void *v2;
uint64_t v3;
uint64_t v4;
void *v5;
_QWORD v7[2];
v7[0] = a1;
v7[1] = off_1E0B419D8;
v2 = (void *)MEMORY[0x19303E1F0](a1, a2);
MEMORY[0x19303E000](v7, 0x1F23B2382uLL, v2);
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v2, "layer")), "setCornerRadius:", 20.0);
MEMORY[0x19303E090](v3);
v4 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v2, "layer")), "setCornerCurve:", *MEMORY[0x1E05F8958]);
MEMORY[0x19303E090](v4);
v5 = (void *)MEMORY[0x19303DF20](objc_msgSend(v2, "layer"));
MEMORY[0x19303E0B0]();
return MEMORY[0x19303E090](objc_msgSend(v5, "setMasksToBounds:", 1LL));
}
- (uint64_t)layoutSubviews
{
uint64_t v2;
double v3;
double v4;
double v5;
double v6;
uint64_t v7;
int v8;
uint64_t v9;
double v10;
double v11;
double v12;
double v13;
double v14;
double v15;
double v16;
double v17;
uint64_t v18;
double v19;
double v20;
uint64_t v21;
void *v22;
double v23;
double v24;
double v25;
double v26;
double v27;
double v28;
double v29;
double v30;
double v31;
uint64_t v32;
uint64_t v33;
uint64_t v34;
uint64_t v35;
uint64_t v36;
uint64_t v37;
uint64_t v38;
void *v39;
double v40;
uint64_t v41;
_QWORD v43[2];
v43[0] = a1;
v43[1] = off_1E0B419D8;
MEMORY[0x19303E000](v43, off_1E0B248E0);
v2 = MEMORY[0x19303DF20](objc_msgSend(a1, "monoskiBadgeView"));
MEMORY[0x19303E0B0]();
if (v2)
{
objc_msgSend(a1, "bounds");
v7 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "monoskiBadgeView")), "setFrame:", v3, v4, v5, v6);
MEMORY[0x19303E0B0](v7);
}
if (MEMORY[0x19303DF20](objc_msgSend(a1, "irisBadgeView")))
{
v8 = objc_msgSend(a1, "orientation");
MEMORY[0x19303E0B0]();
if (!v8)
{
v9 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "irisBadgeView")), "frame");
v11 = v10;
v13 = v12;
v15 = v14;
v17 = v16;
MEMORY[0x19303E0B0](v9);
v18 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "balloonMaskTailWidth");
v20 = v11 - v19;
MEMORY[0x19303E0B0](v18);
v21 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "irisBadgeView")), "setFrame:", v20, v13, v15, v17);
MEMORY[0x19303E0B0](v21);
}
}
v22 = (void *)MEMORY[0x1E0600550];
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "bounds");
v24 = v23;
v26 = v25;
v28 = v27;
v30 = v29;
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "cornerRadius");
v32 = MEMORY[0x19303DF20](objc_msgSend(v22, "bezierPathWithRoundedRect:cornerRadius:", v24, v26, v28, v30, v31));
v33 = objc_msgSend((id)MEMORY[0x19303E170](v32), "CGPath");
v34 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "dashedBorder")), "setPath:", v33);
v35 = MEMORY[0x19303E0F0](v34);
v36 = MEMORY[0x19303E0C0](v35);
v37 = MEMORY[0x19303E0D0](v36);
MEMORY[0x19303E0B0](v37);
v38 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "layer");
v39 = (void *)MEMORY[0x19303DF20](v38);
objc_msgSend(a1, "imageInsets");
v41 = MEMORY[0x19303E0C0](objc_msgSend(v39, "setCornerRadius:", 20.0 - v40));
return MEMORY[0x19303E0B0](v41);
}
- (uint64_t)tailMask
{
return 0LL;
}
- (uint64_t)suppressMask
{
return 1LL;
}
- (uint64_t)setFrame:(double)a3
{
uint64_t v10;
double v11;
double v12;
double v13;
double v14;
uint64_t result;
__int128 v16;
void *v17;
double v18;
double v19;
double v20;
double v21;
double v22;
double v23;
double v24;
double v25;
double v26;
double v27;
double v28;
double v29;
uint64_t v30;
void *v31;
double v32;
uint64_t v33;
_OWORD v34[3];
_QWORD v35[2];
_OWORD v36[3];
__int128 v37;
__int128 v38;
__int128 v39;
v10 = objc_msgSend(a1, "frame");
result = MEMORY[0x19303C060](v10, a2, a3, a4, a5, v11, v12, v13, v14);
if ((result & 1) == 0)
{
v38 = 0u;
v39 = 0u;
v37 = 0u;
objc_msgSend(a1, "transform");
v16 = *(_OWORD *)(MEMORY[0x1E05DD4E8] + 16LL);
v36[0] = *MEMORY[0x1E05DD4E8];
v36[1] = v16;
v36[2] = *(_OWORD *)(MEMORY[0x1E05DD4E8] + 32LL);
objc_msgSend(a1, "setTransform:", v36);
v35[0] = a1;
v35[1] = off_1E0B419D8;
MEMORY[0x19303E000](v35, 0x1F1BAE238uLL, a2, a3, a4, a5);
v17 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView"));
objc_msgSend(a1, "bounds");
v19 = v18;
v21 = v20;
v23 = v22;
v25 = v24;
objc_msgSend(a1, "imageInsets");
MEMORY[0x19303E0B0](objc_msgSend(v17, "setFrame:", v19 + v29, v21 + v26, v23 - (v29 + v27), v25 - (v26 + v28)));
v30 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "layer");
v31 = (void *)MEMORY[0x19303DF20](v30);
objc_msgSend(a1, "imageInsets");
v33 = MEMORY[0x19303E0C0](objc_msgSend(v31, "setCornerRadius:", 20.0 - v32));
MEMORY[0x19303E0B0](v33);
v34[0] = v37;
v34[1] = v38;
v34[2] = v39;
return objc_msgSend(a1, "setTransform:", v34);
}
return result;
}
- (void)createOverlayImageView
{
id v2;
void *v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t vars8;
MEMORY[0x19303DEA0](MEMORY[0x1E0600808]);
v3 = (void *)objc_msgSend(v2, "initWithFrame:", *MEMORY[0x1E05DD558], *(double *)(MEMORY[0x1E05DD558] + 8LL), *(double *)(MEMORY[0x1E05DD558] + 16LL), *(double *)(MEMORY[0x1E05DD558] + 24LL));
objc_msgSend(v3, "setUserInteractionEnabled:", 0LL);
v4 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v3, "layer")), "setCornerRadius:", 20.0);
MEMORY[0x19303E0C0](v4);
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v3, "layer")), "setCornerCurve:", *MEMORY[0x1E05F8958]);
MEMORY[0x19303E0C0](v5);
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v3, "layer")), "setMasksToBounds:", 1LL);
MEMORY[0x19303E0C0](v6);
v7 = objc_msgSend(v3, "setBackgroundColor:", MEMORY[0x19303DF20](objc_msgSend(a1, "overlayColor")));
MEMORY[0x19303E0B0](v7);
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v3, "layer")), "setAllowsEdgeAntialiasing:", 1LL);
MEMORY[0x19303E0B0](v8);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (uint64_t)addFilter:(void *)a1
{
void *v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
_BOOL8 v10;
uint64_t v11;
uint64_t v12;
uint64_t v13;
uint64_t v14;
uint64_t v15;
uint64_t v16;
uint64_t v17;
uint64_t v18;
uint64_t v19;
void *v20;
uint64_t v21;
uint64_t v22;
void *v23;
uint64_t v24;
uint64_t v25;
void *v26;
uint64_t v27;
uint64_t v28;
uint64_t v29;
uint64_t v31;
v2 = (void *)MEMORY[0x19303E1F0]();
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v2, "balloonBackdropFilters")), "count");
v4 = MEMORY[0x19303E0C0]();
if (v3)
{
v5 = MEMORY[0x19303CB00](v4);
if ((_DWORD)v5)
{
v6 = CKLogCStringForType(43);
v7 = MEMORY[0x19303D290](v6);
v8 = MEMORY[0x19303DF20](v7);
v9 = MEMORY[0x19303E3F0](v8, 2LL);
if ((_DWORD)v9)
{
LOWORD(v31) = 0;
v9 = MEMORY[0x19303D950](&dword_18EEC5000, v8, 2LL, "Cannot have two backdrop filter layers", &v31, 2LL);
}
v5 = MEMORY[0x19303E0C0](v9);
}
if ((unsigned int)MEMORY[0x19303E3E0](v5) && _CKShouldLog())
{
v10 = MEMORY[0x19303DF20](objc_msgSend(a1, "backdropFilterLayer")) == 0;
v16 = _CKAssert(v10, 43, (uint64_t)&stru_1E8DB7318, v11, v12, v13, v14, v15, v31);
MEMORY[0x19303E0C0](v16);
}
v17 = MEMORY[0x19303DF20](objc_msgSend(a1, "backdropFilterLayer"));
MEMORY[0x19303E0C0]();
if (v17)
{
v18 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "backdropFilterLayer")), "removeFromSuperlayer");
MEMORY[0x19303E0C0](v18);
objc_msgSend(a1, "setBackdropFilterLayer:", 0LL);
}
objc_msgSend(a1, "setSuppressMask:", 1LL);
v19 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setAllowsGroupBlending:", 0LL);
MEMORY[0x19303E0C0](v19);
v20 = (void *)MEMORY[0x19303DEC0](MEMORY[0x1E05F8608]);
objc_msgSend(a1, "bounds");
objc_msgSend(v20, "setFrame:");
objc_msgSend(v20, "setGroupName:", &stru_1E8DB3F78);
v21 = objc_msgSend(v20, "setFilters:", MEMORY[0x19303DF20](objc_msgSend(v2, "balloonBackdropFilters")));
MEMORY[0x19303E0D0](v21);
objc_msgSend(v20, "setScale:", 0.25);
objc_msgSend(v20, "setCornerRadius:", 20.0);
objc_msgSend(v20, "setCornerCurve:", *MEMORY[0x1E05F8958]);
objc_msgSend(v20, "setMasksToBounds:", 1LL);
objc_msgSend(a1, "bounds");
objc_msgSend(v20, "setFrame:");
objc_msgSend(a1, "setBackdropFilterLayer:", v20);
v22 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "addSublayer:", v20);
MEMORY[0x19303E0D0](v22);
MEMORY[0x19303E0C0](objc_msgSend(a1, "setInvisibleInkEffectEnabled:", 0LL));
}
v23 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "layer"));
v24 = objc_msgSend(v23, "setFilters:", MEMORY[0x19303DF20](objc_msgSend(v2, "balloonFilters")));
v25 = MEMORY[0x19303E0D0](v24);
MEMORY[0x19303E0C0](v25);
v26 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "layer"));
v27 = objc_msgSend(v26, "setCompositingFilter:", MEMORY[0x19303DF20](objc_msgSend(v2, "balloonCompositingFilter")));
v28 = MEMORY[0x19303E0C0](v27);
v29 = MEMORY[0x19303E0B0](v28);
return MEMORY[0x19303E090](v29);
}
- (uint64_t)setImage:(void *)a1
{
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
_QWORD v8[2];
v8[0] = a1;
v8[1] = off_1E0B419D8;
v3 = MEMORY[0x19303E1F0](a1, a2);
MEMORY[0x19303E000](v8, 0x1F13D54B8uLL, 0LL);
v4 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setContents:", 0LL);
MEMORY[0x19303E0B0](v4);
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "setImage:", v3);
v6 = MEMORY[0x19303E0C0](v5);
return MEMORY[0x19303E090](v6);
}
- (double)sizeThatFits:(double)a3 textAlignmentInsets:
{
uint64_t v5;
void *v6;
uint64_t v7;
double v8;
double v9;
double v10;
double v11;
double v13;
double v14;
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "image");
v6 = (void *)MEMORY[0x19303DF20](v5);
v7 = MEMORY[0x19303E0B0]();
if (v6)
{
v7 = objc_msgSend(v6, "size");
v9 = v8;
v11 = v10;
}
else
{
v9 = *MEMORY[0x1E05DD560];
v11 = *(double *)(MEMORY[0x1E05DD560] + 8LL);
}
if (a2 < v9 || a3 < v11)
{
v13 = a2 / v9;
v14 = 0.0;
if (v9 == 0.0)
v13 = 0.0;
if (v11 != 0.0)
v14 = a3 / v11;
v9 = ceil(v9 * fmin(v13, v14));
}
MEMORY[0x19303E090](v7);
return v9;
}
- (uint64_t)image
{
return 0LL;
}
- (void)setInvisibleInkEffectImage:(void *)a1
{
uint64_t v2;
void *v3;
uint64_t vars8;
v2 = MEMORY[0x19303E1F0]();
v3 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView"));
MEMORY[0x19303E0B0](objc_msgSend(v3, "setInvisibleInkEffectImage:", v2));
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)invisibleInkEffectImage
{
uint64_t v1;
uint64_t vars8;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "invisibleInkEffectImage");
MEMORY[0x19303DF20](v1);
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (uint64_t)canUseOpaqueMask
{
return 0LL;
}
- (_QWORD)balloonDescriptor
{
_QWORD *result;
_QWORD v4[2];
*(_OWORD *)(a2 + 48) = 0u;
*(_OWORD *)(a2 + 64) = 0u;
*(_OWORD *)(a2 + 16) = 0u;
*(_OWORD *)(a2 + 32) = 0u;
*(_OWORD *)a2 = 0u;
v4[0] = a1;
v4[1] = off_1E0B419D8;
result = MEMORY[0x19303E000]((_QWORD *)a2, v4, 0x1F2360FD9uLL);
*(_QWORD *)(a2 + 8) = -1LL;
*(_BYTE *)(a2 + 1) = 0;
return result;
}
- (void)attachInvisibleInkEffectView
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t vars8;
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "invisibleInkEffectController")), "effectView");
v4 = MEMORY[0x19303DF20](v2);
MEMORY[0x19303E0B0]();
v3 = objc_msgSend(a1, "insertSubview:aboveSubview:", v4, MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")));
MEMORY[0x19303E0B0](v3);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)detachInvisibleInkEffectView
{
uint64_t v1;
void *v2;
uint64_t vars8;
v1 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "invisibleInkEffectController")), "effectView");
v2 = (void *)MEMORY[0x19303DF20](v1);
MEMORY[0x19303E090]();
objc_msgSend(v2, "removeFromSuperview");
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (uint64_t)prepareForReuse
{
__int128 v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
_OWORD v7[3];
_QWORD v8[2];
v8[0] = a1;
v8[1] = off_1E0B419D8;
MEMORY[0x19303E000](v8, 0x1F18DF3B8uLL);
v2 = *(_OWORD *)(MEMORY[0x1E05DD4E8] + 16LL);
v7[0] = *MEMORY[0x1E05DD4E8];
v7[1] = v2;
v7[2] = *(_OWORD *)(MEMORY[0x1E05DD4E8] + 32LL);
objc_msgSend(a1, "setTransform:", v7);
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "imageView")), "setAlpha:", 1.0);
MEMORY[0x19303E0B0](v3);
v4 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setBorderColor:", 0LL);
MEMORY[0x19303E0B0](v4);
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setBorderWidth:", 0.0);
return MEMORY[0x19303E090](v5);
}
- (uint64_t)layoutRecipe
{
return *(_QWORD *)(a1 + 808);
}
- (void)setLayoutRecipe:(id)obj
{
objc_storeStrong((id *)(a1 + 808), obj);
}
- (uint64_t)imageView
{
return *(_QWORD *)(a1 + 816);
}
- (void)setImageView:(id)obj
{
objc_storeStrong((id *)(a1 + 816), obj);
}
- (uint64_t)dashedBorder
{
return *(_QWORD *)(a1 + 824);
}
- (void)setDashedBorder:(id)obj
{
objc_storeStrong((id *)(a1 + 824), obj);
}
- (void).cxx_destruct
{
uint64_t vars8;
objc_storeStrong(a1 + 103, 0LL);
objc_storeStrong(a1 + 102, 0LL);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
objc_storeStrong(a1 + 101, 0LL);
}
@end
@implementation CKOrganicImageLayoutGroupProvider
- (void)layoutGroupForDatasourceItems:(void *)a1 environment:layoutItems:
{
void *v2;
void *v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
double v10;
double v11;
double v12;
double v13;
uint64_t v14;
void *v15;
unint64_t v16;
char v17;
double v18;
double v19;
void *v20;
void *v21;
BOOL v22;
uint64_t v23;
double v24;
double v25;
double v26;
double v27;
double v28;
double v29;
double v30;
double v31;
uint64_t v32;
uint64_t v33;
uint64_t v34;
uint64_t v35;
uint64_t v36;
uint64_t v37;
uint64_t v38;
uint64_t v39;
uint64_t v40;
uint64_t v41;
uint64_t v42;
uint64_t v43;
uint64_t v44;
void *v45;
void *v46;
void *v47;
uint64_t v48;
void *v49;
uint64_t v50;
int v51;
void *v52;
uint64_t v53;
uint64_t v54;
uint64_t v55;
uint64_t v56;
uint64_t v57;
uint64_t v58;
uint64_t v59;
uint64_t v60;
uint64_t v61;
uint64_t v62;
uint64_t v63;
uint64_t v64;
uint64_t v65;
uint64_t v66;
uint64_t v67;
uint64_t v68;
uint64_t v69;
_QWORD v70[6];
_QWORD v71[8];
uint64_t v72;
double *v73;
uint64_t v74;
uint64_t v75;
_QWORD v76[5];
uint64_t vars8;
v2 = (void *)MEMORY[0x19303E1F0]();
v3 = (void *)MEMORY[0x19303E200]();
MEMORY[0x19303E1E0]();
v4 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v3, "collectionLayoutEnvironment")), "container");
v5 = objc_msgSend((id)MEMORY[0x19303DF20](v4), "contentSize");
v7 = v6;
v8 = MEMORY[0x19303E0B0](v5);
MEMORY[0x19303E090](v8);
v69 = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E0600388], "fractionalWidthDimension:", 1.0));
v9 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "smallTranscriptSpace");
v11 = v10;
MEMORY[0x19303E090](v9);
objc_msgSend(a1, "_setLayoutRecipesForChatItems:", v2);
v13 = v12;
v14 = objc_msgSend((id)MEMORY[0x19303DEA0](MEMORY[0x1E05DC4C8]), "initWithCapacity:", objc_msgSend(v2, "count"));
v76[0] = 0LL;
v76[1] = v76;
v76[2] = 0x2020000000LL;
*(double *)&v76[3] = v11;
v72 = 0LL;
v73 = (double *)&v72;
v74 = 0x2020000000LL;
v75 = 0LL;
v71[0] = MEMORY[0x1E05D4328];
v71[1] = 3221225472LL;
v71[2] = __91__CKOrganicImageLayoutGroupProvider_layoutGroupForDatasourceItems_environment_layoutItems___block_invoke;
v71[3] = &unk_1E0B0B580;
v71[5] = v76;
v71[7] = v7;
v15 = (void *)MEMORY[0x19303E160](v14);
v71[4] = v15;
v71[6] = &v72;
objc_msgSend(v2, "enumerateObjectsUsingBlock:", v71);
v16 = 0LL;
v17 = 0;
v18 = v11 + v13;
v19 = (v11 + v13) * 0.5;
while (objc_msgSend(v15, "count") > v16)
{
v20 = (void *)MEMORY[0x19303DF20](objc_msgSend(v2, "objectAtIndex:", v16));
v21 = v20;
if (v16)
{
v22 = 0;
}
else
{
v22 = MEMORY[0x19303DF20](objc_msgSend(v20, "tapbacksChatItem")) != 0;
MEMORY[0x19303E060]();
}
v23 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v15, "objectAtIndex:", v16)), "CGRectValue");
v25 = v24;
v27 = v26;
v29 = v28;
v31 = v30;
MEMORY[0x19303E090](v23);
v32 = objc_msgSend(MEMORY[0x1E05E82E0], "numberWithDouble:", v19 - MEMORY[0x19303C0D0](v25, v27, v29, v31));
v33 = MEMORY[0x19303DF20](v32);
v34 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v21, "layoutRecipe")), "setRelativeGroupCenter:", v33);
v35 = MEMORY[0x19303E090](v34);
MEMORY[0x19303E0B0](v35);
v36 = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E82E0], "numberWithDouble:", v73[3]));
v37 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v21, "layoutRecipe")), "setGroupMaxX:", v36);
v38 = MEMORY[0x19303E090](v37);
MEMORY[0x19303E0B0](v38);
v39 = MEMORY[0x19303DF20](objc_msgSend(v2, "lastObject"));
v40 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v21, "layoutRecipe")), "setIsLastItem:", v21 == (void *)v39);
v17 |= v22;
v41 = MEMORY[0x19303E090](v40);
v42 = MEMORY[0x19303E110](v41);
MEMORY[0x19303E100](v42);
++v16;
}
v43 = objc_msgSend(MEMORY[0x1E06003B8], "sizeWithWidthDimension:heightDimension:", v69, MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E0600388], "absoluteDimension:", v18)));
v44 = MEMORY[0x19303DF20](v43);
v45 = (void *)MEMORY[0x1E0600398];
v70[0] = MEMORY[0x1E05D4328];
v70[1] = 3221225472LL;
v70[2] = __91__CKOrganicImageLayoutGroupProvider_layoutGroupForDatasourceItems_environment_layoutItems___block_invoke_2;
v70[3] = &unk_1E0B0B5D0;
v70[4] = MEMORY[0x19303E220]();
v70[5] = MEMORY[0x19303E230]();
v46 = (void *)MEMORY[0x19303DF20](objc_msgSend(v45, "customGroupWithLayoutSize:itemProvider:", v44, v70));
v47 = (void *)MEMORY[0x1E06003C0];
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "mediumTranscriptSpace");
v48 = MEMORY[0x19303DF20](objc_msgSend(v47, "fixedSpacing:"));
MEMORY[0x19303E0B0]();
v49 = (void *)MEMORY[0x1E06003C0];
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "largeTranscriptSpace");
v50 = MEMORY[0x19303DF20](objc_msgSend(v49, "fixedSpacing:"));
MEMORY[0x19303E0B0]();
v51 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isEmojiTapbacksEnabled");
MEMORY[0x19303E090]();
if (v51)
{
v52 = (void *)MEMORY[0x1E06003C0];
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "extraLargeTranscriptSpace");
v53 = MEMORY[0x19303DF20](objc_msgSend(v52, "fixedSpacing:"));
v54 = MEMORY[0x19303E130]();
MEMORY[0x19303E0B0](v54);
v50 = v53;
}
if ((v17 & 1) != 0)
v55 = v50;
else
v55 = v48;
v56 = objc_msgSend(v46, "setEdgeSpacing:", MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E0600390], "spacingForLeading:top:trailing:bottom:", 0LL, v55, 0LL, v48)));
v57 = MEMORY[0x19303E090](v56);
v58 = MEMORY[0x19303E130](v57);
v59 = MEMORY[0x19303E120](v58);
v60 = MEMORY[0x19303E140](v59);
v61 = MEMORY[0x19303E140](v60);
v62 = MEMORY[0x19303E100](v61);
v63 = MEMORY[0x19303E0F0](v62);
MEMORY[0x19303E140](v63);
MEMORY[0x19303D700](&v72, 8LL);
v64 = MEMORY[0x19303D700](v76, 8LL);
v65 = MEMORY[0x19303E110](v64);
v66 = MEMORY[0x19303E140](v65);
v67 = MEMORY[0x19303E140](v66);
v68 = MEMORY[0x19303E140](v67);
MEMORY[0x19303E140](v68);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
void __91__CKOrganicImageLayoutGroupProvider_layoutGroupForDatasourceItems_environment_layoutItems___block_invoke(uint64_t a1)
{
void *v2;
uint64_t v3;
double v4;
double v5;
double v6;
double v7;
uint64_t v8;
double v9;
double v10;
double v11;
double v12;
void *v13;
uint64_t v14;
double v15;
double v16;
uint64_t v17;
uint64_t v18;
double v19;
uint64_t vars8;
v2 = (void *)MEMORY[0x19303E1B0]();
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v2, "layoutRecipe")), "targetSize");
v5 = v4;
v7 = v6;
MEMORY[0x19303E0C0](v3);
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v2, "layoutRecipe")), "overlap");
v10 = v9;
MEMORY[0x19303E0C0](v8);
v11 = *(double *)(*(_QWORD *)(*(_QWORD *)(a1 + 40) + 8LL) + 24LL) - v10;
v12 = *(double *)(a1 + 56);
objc_msgSend(*(id *)(a1 + 32), "addObject:", MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithCGRect:", 0.0, v11, v12, v7)));
v13 = (void *)MEMORY[0x19303DF20](objc_msgSend(v2, "layoutRecipe"));
MEMORY[0x19303E0B0]();
v14 = objc_msgSend(v13, "offset");
v16 = v15;
v17 = MEMORY[0x19303E0C0](v14);
v18 = *(_QWORD *)(*(_QWORD *)(a1 + 48) + 8LL);
v19 = *(double *)(v18 + 24);
if (v19 < v5 + v16)
v19 = v5 + v16;
*(double *)(v18 + 24) = v19;
*(double *)(*(_QWORD *)(*(_QWORD *)(a1 + 40) + 8LL) + 24LL) = MEMORY[0x19303C090](v17, 0.0, v11, v12, v7);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
void __91__CKOrganicImageLayoutGroupProvider_layoutGroupForDatasourceItems_environment_layoutItems___block_invoke_2(uint64_t a1)
{
uint64_t v2;
void *v3;
_QWORD v4[5];
uint64_t vars8;
v2 = objc_msgSend((id)MEMORY[0x19303DEA0](MEMORY[0x1E05DC4C8]), "initWithCapacity:", objc_msgSend(*(id *)(a1 + 32), "count"));
v3 = *(void **)(a1 + 40);
v4[0] = MEMORY[0x1E05D4328];
v4[1] = 3221225472LL;
v4[2] = __91__CKOrganicImageLayoutGroupProvider_layoutGroupForDatasourceItems_environment_layoutItems___block_invoke_3;
v4[3] = &unk_1E0B0B5A8;
v4[4] = MEMORY[0x19303E160](v2);
MEMORY[0x19303E140](objc_msgSend(v3, "enumerateObjectsUsingBlock:", v4));
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
void __91__CKOrganicImageLayoutGroupProvider_layoutGroupForDatasourceItems_environment_layoutItems___block_invoke_3(uint64_t a1, void *a2, uint64_t a3)
{
uint64_t vars8;
objc_msgSend(a2, "CGRectValue");
objc_msgSend(*(id *)(a1 + 32), "addObject:", MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E06003A0], "customItemWithFrame:zIndex:", a3)));
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)_setLayoutRecipesForChatItems:(void *)a1
{
void *v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
double v8;
double v9;
double v10;
uint64_t v11;
double v12;
double v13;
double v14;
double v15;
uint64_t v16;
uint64_t v17;
uint64_t v18;
int v19;
uint64_t v20;
unsigned int v21;
uint64_t v22;
double v23;
double v24;
double v25;
double v26;
uint64_t v27;
uint64_t v28;
uint64_t v29;
double v30;
double v31;
double v32;
uint64_t v33;
uint64_t v34;
int v35;
uint64_t v36;
double v37;
double v38;
id v39;
id v40;
uint64_t v41;
double v42;
double v43;
double v44;
double v45;
double v46;
double v47;
uint64_t v48;
void *v49;
uint64_t v50;
uint64_t v51;
double v52;
double v53;
double v54;
double v55;
uint64_t v56;
double v57;
uint64_t v58;
id v59;
uint64_t v60;
uint64_t v61;
uint64_t v62;
uint64_t v63;
uint64_t v64;
uint64_t v65;
uint64_t v66;
uint64_t v67;
void *result;
uint64_t v69;
int v70;
uint64_t v71;
const char *v72;
double v73;
uint64_t v74;
double v75;
uint64_t v76;
void *v77;
void *v78;
void *v79;
void *v80;
uint64_t v81;
v81 = *MEMORY[0x1E05D4338];
v2 = (void *)MEMORY[0x19303E1F0]();
if ((unint64_t)objc_msgSend(v2, "count") >= 2 && (unint64_t)objc_msgSend(v2, "count") < 4)
{
v7 = objc_msgSend(v2, "count");
v77 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "_startOffsetSpecForCount:", v7));
v76 = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E8418], "stringGUID"));
v80 = (void *)MEMORY[0x19303DF20](objc_msgSend(v2, "firstObject"));
v79 = (void *)MEMORY[0x19303DF20](objc_msgSend(v2, "objectAtIndex:", 1LL));
if (objc_msgSend(v2, "count") == 3)
v78 = (void *)MEMORY[0x19303DF20](objc_msgSend(v2, "objectAtIndex:", 2LL));
else
v78 = 0LL;
objc_msgSend(a1, "_targetSizeForChatItem:totalItemCount:", v80, v7);
v9 = v8;
v75 = v10;
v11 = objc_msgSend(a1, "_orientationForChatItemSize:");
objc_msgSend(a1, "_targetSizeForChatItem:totalItemCount:", v79, v7);
v13 = v12;
v15 = v14;
v16 = objc_msgSend(a1, "_orientationForChatItemSize:");
v17 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "_startRotationSpec")), "objectAtIndexedSubscript:", v11);
v18 = objc_msgSend((id)MEMORY[0x19303DF20](v17), "objectAtIndexedSubscript:", v16);
v19 = objc_msgSend((id)MEMORY[0x19303DF20](v18), "BOOLValue");
v20 = MEMORY[0x19303E0E0]();
MEMORY[0x19303E0B0](v20);
v21 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v2, "firstObject")), "isFromMe");
MEMORY[0x19303E0B0]();
v22 = v19 ^ v21;
objc_msgSend(a1, "_rotationForChatItem:leftRotated:", v80, v22);
v24 = v23;
objc_msgSend(a1, "_rotationForChatItem:leftRotated:", v79, (unsigned int)v22 ^ 1);
v26 = v25;
v27 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "_intersectSpecForIndex:count:", 0LL, v7)), "objectAtIndexedSubscript:", v11);
v28 = objc_msgSend((id)MEMORY[0x19303DF20](v27), "objectAtIndexedSubscript:", v16);
v29 = objc_msgSend((id)MEMORY[0x19303DF20](v28), "CGSizeValue");
v73 = v30;
v32 = v31;
v33 = MEMORY[0x19303E0E0](v29);
MEMORY[0x19303E0D0](v33);
v34 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v77, "objectAtIndexedSubscript:", v11)), "objectAtIndexedSubscript:", v16);
v35 = objc_msgSend((id)MEMORY[0x19303DF20](v34), "BOOLValue");
v36 = MEMORY[0x19303E0F0]();
MEMORY[0x19303E0E0](v36);
if (v35)
{
v37 = v13 - v13 * v73;
v38 = 0.0;
}
else
{
v38 = v75 - v75 * v73;
v37 = 0.0;
if (v78)
{
if (!v11)
{
objc_msgSend(v78, "size");
if (objc_msgSend(a1, "_orientationForChatItemSize:") == 1)
v37 = v38 + v38 * -0.949999988;
}
}
}
MEMORY[0x19303DEA0](off_1E0AFCC28);
objc_msgSend(v80, "setLayoutRecipe:", objc_msgSend(v39, "initWithRotation:offset:targetSize:overlap:wantsShadow:groupIdentifier:", 1LL, v76, v24, v37, v75, v9, 0.0));
MEMORY[0x19303DEA0](off_1E0AFCC28);
v41 = objc_msgSend(v79, "setLayoutRecipe:", objc_msgSend(v40, "initWithRotation:offset:targetSize:overlap:wantsShadow:groupIdentifier:", 1LL, v76, v26, v38, v13, v15, v9 * v32));
if (v78)
{
objc_msgSend(a1, "_targetSizeForChatItem:totalItemCount:", v78, v7);
v43 = v42;
v45 = v44;
objc_msgSend(a1, "_rotationForChatItem:leftRotated:", v78, v22);
v47 = v46;
v48 = objc_msgSend(a1, "_orientationForChatItemSize:", v43, v45);
v49 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "_intersectSpecForIndex:count:", 1LL, v7));
MEMORY[0x19303E0B0]();
v50 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v49, "objectAtIndexedSubscript:", v16)), "objectAtIndexedSubscript:", v48);
v51 = objc_msgSend((id)MEMORY[0x19303DF20](v50), "CGSizeValue");
v53 = v52;
v55 = v54;
v56 = MEMORY[0x19303E0F0](v51);
MEMORY[0x19303E0B0](v56);
if (v35)
{
v57 = v13 - v13 * v53;
v58 = v76;
}
else
{
v57 = 0.0;
v58 = v76;
if (!v48)
v57 = v43 - v43 * v53 - (v75 - v75 * v73);
}
MEMORY[0x19303DEA0](off_1E0AFCC28);
v41 = MEMORY[0x19303E0B0](objc_msgSend(v78, "setLayoutRecipe:", objc_msgSend(v59, "initWithRotation:offset:targetSize:overlap:wantsShadow:groupIdentifier:", 1LL, v58, v47, v57, v43, v45, v15 * v55)));
}
v60 = MEMORY[0x19303E0E0](v41);
v61 = MEMORY[0x19303E0C0](v60);
v62 = MEMORY[0x19303E100](v61);
v63 = MEMORY[0x19303E140](v62);
v64 = MEMORY[0x19303E0F0](v63);
v65 = MEMORY[0x19303E140](v64);
v66 = MEMORY[0x19303E140](v65);
v67 = MEMORY[0x19303E0D0](v66);
v3 = MEMORY[0x19303E140](v67);
}
else
{
v3 = MEMORY[0x19303CB00]();
if ((_DWORD)v3)
{
v4 = MEMORY[0x19303D290]("Warning");
v5 = MEMORY[0x19303DF20](v4);
v6 = MEMORY[0x19303E3F0](v5, 1LL);
if ((_DWORD)v6)
{
objc_msgSend(v2, "count");
v6 = MEMORY[0x19303D950](&dword_18EEC5000, v5, 1LL, "%s asked to generate layout with %lu items, unsupported!", v72, v74);
}
v3 = MEMORY[0x19303E0B0](v6);
}
}
while (1)
{
result = (void *)MEMORY[0x19303E090](v3);
if (*MEMORY[0x1E05D4338] == v81)
break;
v69 = MEMORY[0x19303D8F0](result);
if (v70 != 1)
{
MEMORY[0x19303D870](v69);
return -[CKOrganicImageLayoutGroupProvider _startRotationSpec]();
}
v71 = MEMORY[0x19303DF10](v69);
v3 = MEMORY[0x19303DF60](v71);
}
return result;
}
- (void)_startRotationSpec
{
return &unk_1E8E7BDA0;
}
- (void)_startOffsetSpecForCount:(uint64_t)a3
{
void *v3;
v3 = &unk_1E8E7BE30;
if (a3 != 3)
v3 = 0LL;
if (a3 == 2)
return &unk_1E8E7BDE8;
else
return v3;
}
- (uint64_t)_intersectSpecForIndex:(uint64_t)a3 count:(uint64_t)a4
{
_QWORD *v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
uint64_t v10;
__int128 v12;
__int128 v13;
__int128 v14;
__int128 v15;
__int128 v16;
__int128 v17;
__int128 v18;
__int128 v19;
__int128 v20;
__int128 v21;
__int128 v22;
__int128 v23;
_QWORD v24[2];
_QWORD v25[2];
_QWORD v26[2];
_QWORD v27[2];
_QWORD v28[2];
_QWORD v29[2];
_QWORD v30[2];
_QWORD v31[2];
_QWORD v32[2];
uint64_t v33;
uint64_t vars8;
v33 = *MEMORY[0x1E05D4338];
if (a4 == 3)
{
if (a3 == 1)
{
v15 = xmmword_18F77ECB0;
v25[0] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v15, "{CGSize=dd}"));
v14 = xmmword_18F77ECC0;
v25[1] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v14, "{CGSize=dd}"));
v26[0] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC3F8], "arrayWithObjects:count:", v25, 2LL));
v13 = xmmword_18F77ECD0;
v24[0] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v13, "{CGSize=dd}"));
v12 = xmmword_18F77ECE0;
v24[1] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v12, "{CGSize=dd}"));
v26[1] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC3F8], "arrayWithObjects:count:", v24, 2LL));
v4 = v26;
goto LABEL_9;
}
if (!a3)
{
v19 = xmmword_18F77ECB0;
v28[0] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v19, "{CGSize=dd}"));
v18 = xmmword_18F77ECF0;
v28[1] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v18, "{CGSize=dd}"));
v29[0] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC3F8], "arrayWithObjects:count:", v28, 2LL));
v17 = xmmword_18F77ECD0;
v27[0] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v17, "{CGSize=dd}"));
v16 = xmmword_18F77ED00;
v27[1] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v16, "{CGSize=dd}"));
v29[1] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC3F8], "arrayWithObjects:count:", v27, 2LL));
v4 = v29;
goto LABEL_9;
}
}
else if (a4 == 2)
{
v23 = xmmword_18F77ED10;
v31[0] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v23, "{CGSize=dd}"));
v22 = xmmword_18F77ECF0;
v31[1] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v22, "{CGSize=dd}"));
v32[0] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC3F8], "arrayWithObjects:count:", v31, 2LL));
v21 = xmmword_18F77ECD0;
v30[0] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v21, "{CGSize=dd}"));
v20 = xmmword_18F77ED00;
v30[1] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithBytes:objCType:", &v20, "{CGSize=dd}"));
v32[1] = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC3F8], "arrayWithObjects:count:", v30, 2LL));
v4 = v32;
LABEL_9:
MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC3F8], "arrayWithObjects:count:", v4, 2LL));
v5 = MEMORY[0x19303E0F0]();
v6 = MEMORY[0x19303E0E0](v5);
v7 = MEMORY[0x19303E0D0](v6);
v8 = MEMORY[0x19303E0C0](v7);
v9 = MEMORY[0x19303E0B0](v8);
MEMORY[0x19303E090](v9);
}
if (*MEMORY[0x1E05D4338] == v33)
{
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
v10 = MEMORY[0x19303D8F0]();
return -[CKOrganicImageLayoutGroupProvider _targetSizeForChatItem:totalItemCount:](v10);
}
- (uint64_t)_targetSizeForChatItem:(void *)a1 totalItemCount:
{
void *v2;
uint64_t v3;
double v4;
double v5;
double v6;
double v7;
uint64_t v8;
double v9;
double v10;
uint64_t v11;
uint64_t v12;
uint64_t v13;
uint64_t v14;
uint64_t v15;
void *v16;
uint64_t v17;
double v18;
double v19;
uint64_t v20;
uint64_t result;
uint64_t v22;
int v23;
uint64_t v24;
uint64_t v25;
int v26;
const char *v27;
__int16 v28;
uint64_t v29;
__int16 v30;
void *v31;
uint64_t v32;
v32 = *MEMORY[0x1E05D4338];
v2 = (void *)MEMORY[0x19303E1F0]();
v3 = objc_msgSend(v2, "size");
v6 = v5;
v7 = v4;
if (v5 > 0.0 && v4 > 0.0)
{
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "previewMaxWidth");
v10 = v9;
v3 = MEMORY[0x19303E0D0](v8);
if (v6 <= v10)
goto LABEL_9;
}
if ((unsigned int)MEMORY[0x19303CB00](v3))
{
v11 = MEMORY[0x19303D290]("Warning");
v12 = MEMORY[0x19303DF20](v11);
v13 = MEMORY[0x19303E3F0](v12, 1LL);
if ((_DWORD)v13)
{
v14 = MEMORY[0x19303D1E0](objc_msgSend(v2, "size"));
v26 = 136315650;
v27 = "-[CKOrganicImageLayoutGroupProvider _targetSizeForChatItem:totalItemCount:]";
v28 = 2112;
v29 = MEMORY[0x19303DF20](v14);
v30 = 2112;
v31 = v2;
v15 = MEMORY[0x19303D950](&dword_18EEC5000, v12, 1LL, "CKOrganicImageLayoutGroupProvider - %s - Got invalid chatItem size %@ for chatItem %@", &v26, 32LL);
v13 = MEMORY[0x19303E0E0](v15);
}
MEMORY[0x19303E0D0](v13);
}
while (1)
{
v16 = (void *)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors"));
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "previewMaxWidth");
v17 = objc_msgSend(v16, "thumbnailFillSizeForWidth:imageSize:");
v6 = v18;
v7 = v19;
v20 = MEMORY[0x19303E0E0](v17);
MEMORY[0x19303E0D0](v20);
LABEL_9:
objc_msgSend(a1, "_orientationForChatItemSize:", v6, v7);
result = MEMORY[0x19303E090]();
if (*MEMORY[0x1E05D4338] == v32)
break;
v22 = MEMORY[0x19303D8F0](result);
if (v23 != 1)
{
v25 = MEMORY[0x19303D870](v22);
return -[CKOrganicImageLayoutGroupProvider _rotationForChatItem:leftRotated:](v25);
}
v24 = MEMORY[0x19303DF10](v22);
MEMORY[0x19303DF60](v24);
}
return result;
}
- (double)_rotationForChatItem:(void *)a3 leftRotated:(int)a4
{
uint64_t v5;
void *v6;
char v7;
double v8;
double v9;
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a3, "IMChatItem")), "guid");
v6 = (void *)MEMORY[0x19303DF20](v5);
MEMORY[0x19303E0B0]();
v7 = objc_msgSend(v6, "hash");
v8 = 1.0;
if (a4)
v8 = -1.0;
if ((v7 & 1) != 0)
v9 = v8 * 0.5;
else
v9 = v8;
MEMORY[0x19303E0C0]();
return v9;
}
- (BOOL)_orientationForChatItemSize:(double)a1
{
return a1 > a2;
}
- (double)scalarForSize:(uint64_t)a3 count:(uint64_t)a4
{
double v5;
if (a5 == 2 || (v5 = 0.0, a5 == 3))
{
if (a1 <= a2)
return 0.6;
else
return 0.75;
}
return v5;
}
@end
@implementation CKOrganicImageLayoutRecipe
- (void)initWithRotation:(double)a3 offset:(double)a4 targetSize:(double)a5 overlap:(double)a6 wantsShadow:(uint64_t)a7 groupIdentifier:(uint64_t)a8
{
uint64_t v15;
void *v16;
void *v17;
_QWORD v19[2];
v15 = MEMORY[0x19303E290]();
v19[0] = a1;
v19[1] = off_1E0B42CE8;
v16 = (void *)MEMORY[0x19303E000](v19, 0x1F1CB4438uLL);
v17 = v16;
if (v16)
{
objc_msgSend(v16, "setRotation:", a2);
objc_msgSend(v17, "setOffset:", a3);
objc_msgSend(v17, "setTargetSize:", a4, a5);
objc_msgSend(v17, "setOverlap:", a6);
objc_msgSend(v17, "setWantsShadow:", a8);
v16 = (void *)objc_msgSend(v17, "setGroupIdentifier:", v15);
}
MEMORY[0x19303E0B0](v16);
return v17;
}
- (void)description
{
void *v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
int v10;
__CFString *v11;
uint64_t v12;
uint64_t vars8;
v2 = (void *)MEMORY[0x1E05E8418];
objc_msgSend(a1, "rotation");
v4 = v3;
objc_msgSend(a1, "offset");
v6 = v5;
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "relativeGroupCenter")), "doubleValue");
v8 = v7;
v9 = MEMORY[0x19303DF20](objc_msgSend(a1, "groupIdentifier"));
v10 = objc_msgSend(a1, "isLastItem");
v11 = &stru_1E8DAFFD8;
if (v10)
v11 = &stru_1E8DAFFB8;
MEMORY[0x19303DF20](objc_msgSend(v2, "stringWithFormat:", &stru_1E8DD1F78, a1, v4, v6, v8, v9, v11));
v12 = MEMORY[0x19303E0D0]();
MEMORY[0x19303E0C0](v12);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (double)rotation
{
return *(double *)(a1 + 16);
}
- (uint64_t)setRotation:(uint64_t)result
{
*(double *)(result + 16) = a2;
return result;
}
- (double)offset
{
return *(double *)(a1 + 24);
}
- (uint64_t)setOffset:(uint64_t)result
{
*(double *)(result + 24) = a2;
return result;
}
- (uint64_t)wantsShadow
{
return *(unsigned __int8 *)(a1 + 8);
}
- (uint64_t)setWantsShadow:(char)a3
{
*(_BYTE *)(result + 8) = a3;
return result;
}
- (uint64_t)relativeGroupCenter
{
return *(_QWORD *)(a1 + 32);
}
- (void)setRelativeGroupCenter:(id)obj
{
objc_storeStrong((id *)(a1 + 32), obj);
}
- (uint64_t)groupMaxX
{
return *(_QWORD *)(a1 + 40);
}
- (void)setGroupMaxX:(id)obj
{
objc_storeStrong((id *)(a1 + 40), obj);
}
- (uint64_t)groupIdentifier
{
return *(_QWORD *)(a1 + 48);
}
- (void)setGroupIdentifier:(id)obj
{
objc_storeStrong((id *)(a1 + 48), obj);
}
- (uint64_t)isLastItem
{
return *(unsigned __int8 *)(a1 + 9);
}
- (uint64_t)setIsLastItem:(char)a3
{
*(_BYTE *)(result + 9) = a3;
return result;
}
- (double)targetSize
{
return *(double *)(a1 + 64);
}
- (uint64_t)setTargetSize:(double)a3
{
*(double *)(result + 64) = a2;
*(double *)(result + 72) = a3;
return result;
}
- (double)overlap
{
return *(double *)(a1 + 56);
}
- (uint64_t)setOverlap:(uint64_t)result
{
*(double *)(result + 56) = a2;
return result;
}
- (void).cxx_destruct
{
uint64_t vars8;
objc_storeStrong(a1 + 6, 0LL);
objc_storeStrong(a1 + 5, 0LL);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
objc_storeStrong(a1 + 4, 0LL);
}
@end
@implementation CKTranscriptBalloonCell
- (void)init
{
void *v1;
void *v2;
_QWORD v4[2];
v4[0] = a1;
v4[1] = off_1E0B41808;
v1 = (void *)MEMORY[0x19303E000](v4, 0x1F1CB4438uLL);
v2 = v1;
if (v1)
objc_msgSend(v1, "setMayReparentPluginViews:", 1LL);
return v2;
}
- (uint64_t)dealloc
{
_QWORD v3[2];
objc_msgSend(*(id *)(a1 + 936), "removeFromSuperview");
CKBalloonViewReuse();
v3[0] = a1;
v3[1] = off_1E0B41808;
return MEMORY[0x19303E000](v3, 0x1F0E0F8B8uLL);
}
- (void)description
{
void *v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
_QWORD v7[2];
uint64_t vars8;
v2 = (void *)MEMORY[0x1E05E8418];
v7[0] = a1;
v7[1] = off_1E0B41808;
v3 = MEMORY[0x19303E000](v7, 0x1F1935DB8uLL);
v4 = MEMORY[0x19303DF20](v3);
v5 = objc_msgSend(v2, "stringWithFormat:", &stru_1E8DB3F98, v4, MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")));
MEMORY[0x19303DF20](v5);
v6 = MEMORY[0x19303E090]();
MEMORY[0x19303E0C0](v6);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (uint64_t)isAudioMessage
{
int v2;
uint64_t v3;
_QWORD *v4;
uint64_t v5;
char v6;
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isRichAudioMessagesEnabled");
MEMORY[0x19303E0B0]();
v3 = MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView"));
v4 = &off_1E0AFE8C0;
if (!v2)
v4 = &off_1E0AFC1D0;
v5 = MEMORY[0x19303E010](*v4);
v6 = MEMORY[0x19303E020](v3, v5);
MEMORY[0x19303E090]();
return v6 & 1;
}
- (uint64_t)_ck_setEditing:(int)a3 animated:
{
uint64_t v5;
_QWORD v7[2];
v7[0] = a1;
v7[1] = off_1E0B41808;
MEMORY[0x19303E000](v7, 0x1F233A2D0uLL);
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "setUserInteractionEnabled:", a3 ^ 1u);
return MEMORY[0x19303E0B0](v5);
}
- (uint64_t)applyLayoutAttributes:(uint64_t)a1
{
id *v2;
uint64_t v3;
void *v4;
_QWORD v6[5];
_QWORD v7[2];
v2 = (id *)MEMORY[0x19303E1F0]();
v3 = objc_msgSend(*(id *)(a1 + 1016), "isEqual:", v2);
if ((v3 & 1) == 0)
{
v7[0] = a1;
v7[1] = off_1E0B41808;
MEMORY[0x19303E000](v7, 0x1F0F8B087uLL, v2);
objc_msgSend((id)a1, "setLayoutAttributes:", v2);
if (v2)
{
v4 = (void *)objc_msgSend(v2[81], "mutableCopy");
objc_msgSend(v4, "addObject:", v2);
MEMORY[0x19303E0C0](objc_msgSend((id)a1, "setThreadGroupLayoutAttributes:", v4));
}
if ((unsigned int)objc_msgSend(v2, "isInsertingReply"))
objc_msgSend((id)a1, "setInsertingReply:", 1LL);
if ((unsigned int)objc_msgSend((id)a1, "suppressesAnimationsForLineUpdates"))
{
v6[0] = MEMORY[0x1E05D4328];
v6[1] = 3221225472LL;
v6[2] = __49__CKTranscriptBalloonCell_applyLayoutAttributes___block_invoke;
v6[3] = &unk_1E0AFFA38;
v6[4] = a1;
v3 = objc_msgSend(MEMORY[0x1E0600D18], "performWithoutAnimation:", v6);
}
else
{
v3 = objc_msgSend((id)a1, "_updateLineForThreadGroupLayoutAttributes:", *(_QWORD *)(a1 + 1024));
}
}
return MEMORY[0x19303E090](v3);
}
uint64_t __49__CKTranscriptBalloonCell_applyLayoutAttributes___block_invoke(uint64_t a1)
{
return objc_msgSend(*(id *)(a1 + 32), "_updateLineForThreadGroupLayoutAttributes:", *(_QWORD *)(*(_QWORD *)(a1 + 32) + 1024LL));
}
- (void)messageDisplayViewLayoutAttributesForMessageDisplayViewFrame:(double)a3 inContainerFrame:(double)a4
{
uint64_t v18;
uint64_t v19;
int v20;
uint64_t v21;
uint64_t v22;
uint64_t v23;
uint64_t v24;
uint64_t v25;
uint64_t v26;
uint64_t v27;
uint64_t v28;
_QWORD v29[2];
uint64_t vars8;
v29[0] = a1;
v29[1] = off_1E0B41808;
v18 = MEMORY[0x19303E000](v29, 0x1F239002EuLL);
v19 = MEMORY[0x19303DF20](v18);
v20 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isExpressiveTextEnabled");
v21 = MEMORY[0x19303E0C0]();
if (v20 && (v22 = MEMORY[0x19303DFE0](a1 + 952), v21 = MEMORY[0x19303E0C0](), v22))
{
v23 = MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView"));
if (v23 && (v24 = MEMORY[0x19303E010](off_1E0AFD0A8), (MEMORY[0x19303E020](v23, v24) & 1) != 0))
{
v25 = MEMORY[0x19303E210]();
v26 = objc_msgSend((id)MEMORY[0x19303DFE0](a1 + 952), "transcriptBalloonCell:layoutAttributesForTextBalloonView:messageDisplayViewFrame:inContainerFrame:proposedAttributes:", a1, v25, v19, a2, a3, a4, a5, a6, a7, a8, a9);
MEMORY[0x19303DF20](v26);
v27 = MEMORY[0x19303E0E0]();
v28 = MEMORY[0x19303E0D0](v27);
}
else
{
v28 = MEMORY[0x19303E1E0]();
}
MEMORY[0x19303E0C0](v28);
}
else
{
MEMORY[0x19303E1E0](v21);
}
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (uint64_t)layoutSubviewsForContents
{
double v2;
double v3;
double v4;
double v5;
double v6;
double v7;
uint64_t v8;
double v9;
double v10;
uint64_t v11;
double v12;
double v13;
uint64_t v14;
double v15;
double v16;
double v17;
double v18;
uint64_t v19;
double v20;
double v21;
uint64_t v22;
double v23;
double v24;
double v25;
_QWORD v27[2];
objc_msgSend((id)a1, "contentAlignmentRect");
v3 = v2;
objc_msgSend((id)a1, "contentAlignmentInsets");
objc_msgSend((id)a1, "contentAlignmentInsets");
v5 = v4;
objc_msgSend((id)a1, "safeAreaInsets");
v7 = v6;
objc_msgSend((id)a1, "contentAlignmentInsets");
objc_msgSend((id)a1, "contentAlignmentInsets");
objc_msgSend((id)a1, "safeAreaInsets");
if ((objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "forceMinTranscriptMarginInsets") & 1) != 0)
{
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "minTranscriptMarginInsets");
v10 = v9;
v11 = MEMORY[0x19303E0C0](v8);
}
else
{
v11 = objc_msgSend((id)a1, "marginInsets");
v10 = v12;
}
MEMORY[0x19303E0B0](v11);
v13 = v3 - (v5 - v7);
v14 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "contactPhotoTranscriptInsets");
v16 = v10 + v15;
MEMORY[0x19303E0B0](v14);
*(double *)(a1 + 1048) = v13 + v16;
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "transcriptContactImageDiameter");
v18 = v17;
v19 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "contactPhotoBalloonMargin");
v21 = v18 + v20;
v22 = MEMORY[0x19303E0C0](v19);
MEMORY[0x19303E0B0](v22);
objc_msgSend((id)a1, "drawerPercentRevealed");
v24 = v23;
objc_msgSend((id)a1, "contentAlignmentRect");
*(double *)(a1 + 1048) = *(double *)(a1 + 1048) - v24 * (v21 + v25);
v27[0] = a1;
v27[1] = off_1E0B41808;
MEMORY[0x19303E000](v27, 0x1F238B291uLL);
return objc_msgSend((id)a1, "_updateLineForThreadGroupLayoutAttributes:", *(_QWORD *)(a1 + 1024));
}
- (uint64_t)layoutSubviewsForAlignmentContents
{
uint64_t result;
uint64_t v3;
double v4;
double v5;
uint64_t v6;
double v7;
double v8;
double v9;
uint64_t v10;
double v11;
double v12;
double v13;
double v14;
double v15;
double v16;
double v17;
double v18;
double v19;
uint64_t v20;
double v21;
double v22;
double v23;
_QWORD v24[2];
v24[0] = a1;
v24[1] = off_1E0B41808;
result = MEMORY[0x19303E000](v24, 0x1F238B26EuLL);
if (a1[126])
{
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "transcriptQuickActionButtonDiameter");
v5 = v4;
MEMORY[0x19303E0B0](v3);
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "contentView")), "bounds");
v9 = v8 + floor((v7 - v5) * 0.5);
MEMORY[0x19303E0B0](v6);
v10 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "frame");
v12 = v11;
v14 = v13;
v16 = v15;
v18 = v17;
MEMORY[0x19303E0B0](v10);
if ((unsigned int)objc_msgSend(a1, "orientation"))
{
v19 = 0.0;
if ((unsigned int)objc_msgSend(a1, "orientation") != 2)
return objc_msgSend(a1[126], "setFrame:", v19, v9, v5, v5);
v20 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "transcriptQuickActionButtonHorizontalSpacing");
v19 = v12 - v5 - v21;
}
else
{
v22 = MEMORY[0x19303C080](v12, v14, v16, v18);
v20 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "transcriptQuickActionButtonHorizontalSpacing");
v19 = v22 + v23;
}
MEMORY[0x19303E0B0](v20);
return objc_msgSend(a1[126], "setFrame:", v19, v9, v5, v5);
}
return result;
}
- (uint64_t)performInsertion:(void *)a1
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
_QWORD v6[2];
v2 = MEMORY[0x19303E1F0]();
v3 = objc_msgSend(a1, "insertionType");
if ((unsigned int)objc_msgSend(a1, "isReplyContextPreview") && v3)
{
v4 = objc_msgSend(a1, "_animateReplyContextPreview:", v2);
}
else
{
switch(v3)
{
case 3LL:
v4 = objc_msgSend(a1, "_animateLowerBracketToLoop:", v2);
break;
case 2LL:
v4 = objc_msgSend(a1, "_animateLineExtension:", v2);
break;
case 1LL:
v4 = objc_msgSend(a1, "_animateUpperBracket:", v2);
break;
default:
objc_msgSend(a1, "setInsertingReply:", 0LL);
v6[0] = a1;
v6[1] = off_1E0B41808;
v4 = MEMORY[0x19303E000](v6, 0x1F239794BuLL, v2);
break;
}
}
return MEMORY[0x19303E090](v4);
}
- (uint64_t)insertionAnimationType
{
uint64_t v1;
uint64_t v3;
v1 = *(_QWORD *)(a1 + 960);
if (v1 == 1 || *(_BYTE *)(a1 + 930))
return 2LL;
v3 = 3LL;
if (v1 != 5)
v3 = 0LL;
if (v1 == 2)
return 1LL;
else
return v3;
}
- (double)insertionDurationForInsertionType:(uint64_t)a3
{
char v5;
double result;
double v7;
v5 = objc_msgSend(a1, "isReplyContextPreview");
result = 0.3;
if ((v5 & 1) == 0 && a3 != 1)
{
if (a3 == 3)
{
return 1.1;
}
else if (a3 == 2)
{
objc_msgSend(a1, "_createLineViewFrameForThreadGroupLayoutAttributes:", a1[128], 0.3);
return fmax(fmin(v7 * 0.0026 + 0.06868, 0.3), 0.1);
}
else
{
return 0.0;
}
}
return result;
}
- (uint64_t)addFilter:(uint64_t)a3
{
return objc_msgSend(a1, "addFilter:fromTriggeringMessage:", a3, 0LL);
}
- (void)addFilter:(uint64_t)a3 fromTriggeringMessage:(int)a4
{
uint64_t v6;
char v7;
uint64_t v8;
int v9;
uint64_t v10;
uint64_t v11;
uint64_t vars8;
v11 = MEMORY[0x19303E1F0]();
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "prepareForDisplayIfNeeded");
MEMORY[0x19303E0C0](v6);
if (MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")))
{
v7 = objc_msgSend(a1, "animatingInDarkEffect");
MEMORY[0x19303E0C0]();
if ((v7 & 1) != 0 || a4)
{
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "addFilter:", v11);
MEMORY[0x19303E0B0](v8);
}
}
if (MEMORY[0x19303DF20](objc_msgSend(a1, "lineView")))
{
v9 = objc_msgSend(a1, "animatingInDarkEffect");
MEMORY[0x19303E0B0]();
if (v9)
{
v10 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "lineView")), "addFilter:", v11);
MEMORY[0x19303E090](v10);
}
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (uint64_t)clearFilters
{
uint64_t v2;
uint64_t v3;
uint64_t result;
uint64_t vars8;
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "clearFilters");
MEMORY[0x19303E0B0](v2);
v3 = MEMORY[0x19303DF20](objc_msgSend(a1, "lineView"));
result = MEMORY[0x19303E0B0]();
if (v3)
{
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "lineView")), "clearFilters");
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
return result;
}
- (uint64_t)willLayoutDrawerLabelFrame:(uint64_t)a3
{
void *v5;
void *v6;
uint64_t v7;
double v8;
double v9;
uint64_t v10;
void *v11;
double v12;
uint64_t v13;
double v15;
__int128 v16;
v5 = (void *)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors"));
v16 = 0u;
v6 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView"));
if (v6)
v6 = (void *)objc_msgSend(v6, "balloonDescriptor");
else
v16 = 0u;
v7 = MEMORY[0x19303E0D0](v6);
if (BYTE9(v16))
{
v7 = objc_msgSend(v5, "balloonMaskTailSizeForTailShape:", 0LL);
if (v8 > 0.0)
{
v9 = v8;
v10 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "contentView")), "layer");
v11 = (void *)MEMORY[0x19303DF20](v10);
if (v11)
{
v11 = (void *)objc_msgSend(v11, "transform");
v12 = v15;
}
else
{
v12 = 0.0;
}
v13 = MEMORY[0x19303E0D0](v11);
v7 = MEMORY[0x19303E0C0](v13);
*(double *)(a3 + 24) = *(double *)(a3 + 24) - v9 * v12;
}
}
return MEMORY[0x19303E0B0](v7);
}
- (uint64_t)setAnimationPauseReasons:(unint64_t)a3
{
uint64_t v5;
uint64_t v6;
_QWORD v8[2];
v8[0] = a1;
v8[1] = off_1E0B41808;
MEMORY[0x19303E000](v8, 0x1F23A9400uLL);
v5 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "setInvisibleInkEffectPaused:", a3 != 0);
MEMORY[0x19303E0C0](v5);
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "setAnimationPaused:", (a3 >> 1) & 1);
return MEMORY[0x19303E0B0](v6);
}
- (void)balloonSwipeController
{
void *v2;
void *v3;
_QWORD v4[4];
uint64_t v5;
_QWORD v6[4];
uint64_t v7;
uint64_t v8;
uint64_t vars8;
v2 = *(void **)(a1 + 1072);
if (v2)
{
MEMORY[0x19303E2E0](objc_msgSend(v2, "setBalloonView:", *(_QWORD *)(a1 + 936)));
}
else
{
v8 = 0LL;
MEMORY[0x19303DFD0](&v8, a1);
v3 = (void *)MEMORY[0x19303DEA0](off_1E0AFC298);
v6[0] = MEMORY[0x1E05D4328];
v6[1] = 3221225472LL;
v6[2] = __49__CKTranscriptBalloonCell_balloonSwipeController__block_invoke;
v6[3] = &unk_1E0B01018;
MEMORY[0x19303DF40](&v7, &v8);
v4[0] = MEMORY[0x1E05D4328];
v4[1] = 3221225472LL;
v4[2] = __49__CKTranscriptBalloonCell_balloonSwipeController__block_invoke_2;
v4[3] = &unk_1E0B01040;
MEMORY[0x19303DF40](&v5, &v8);
*(_QWORD *)(a1 + 1072) = objc_msgSend(v3, "initForCell:swipeCompletionHandler:swipeChangedHandler:", a1, v6, v4);
MEMORY[0x19303E140]();
MEMORY[0x19303E2E0](objc_msgSend(*(id *)(a1 + 1072), "setBalloonView:", *(_QWORD *)(a1 + 936)));
MEMORY[0x19303DF50](&v5);
MEMORY[0x19303DF50](&v7);
MEMORY[0x19303DF50](&v8);
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
void __49__CKTranscriptBalloonCell_balloonSwipeController__block_invoke(uint64_t a1)
{
uint64_t v1;
void *v2;
uint64_t v3;
void *v4;
uint64_t v5;
uint64_t v6;
void *v7;
uint64_t vars8;
v1 = a1 + 32;
v7 = (void *)MEMORY[0x19303DFE0](a1 + 32);
v2 = (void *)MEMORY[0x19303DF20](objc_msgSend(v7, "balloonCellDelegate"));
v3 = MEMORY[0x19303DFE0](v1);
v4 = (void *)MEMORY[0x19303E190](v3);
objc_msgSend(v4, "swipeToReplyLayoutOffset");
v5 = MEMORY[0x19303E090](objc_msgSend(v2, "transcriptBalloonCell:didEndBalloonSwipeWithDelta:swipeVelocity:", v4));
v6 = MEMORY[0x19303E090](v5);
MEMORY[0x19303E0B0](v6);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
void __49__CKTranscriptBalloonCell_balloonSwipeController__block_invoke_2(uint64_t a1, double a2)
{
uint64_t v3;
uint64_t v4;
void *v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
uint64_t vars8;
v3 = a1 + 32;
v4 = objc_msgSend((id)MEMORY[0x19303DFE0](a1 + 32), "balloonCellDelegate");
v5 = (void *)MEMORY[0x19303DF20](v4);
v6 = objc_msgSend(v5, "transcriptBalloonCell:didTranslateBalloonByDelta:", MEMORY[0x19303DFE0](v3), a2);
v7 = MEMORY[0x19303E0D0](v6);
v8 = MEMORY[0x19303E0C0](v7);
MEMORY[0x19303E0B0](v8);
v9 = objc_msgSend((id)MEMORY[0x19303DFE0](v3), "setNeedsLayout");
MEMORY[0x19303E0B0](v9);
objc_msgSend((id)MEMORY[0x19303DFE0](v3), "layoutIfNeeded");
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)setBalloonView:(void *)a3
{
id *v5;
int v6;
uint64_t v7;
int v8;
uint64_t v9;
uint64_t v10;
uint64_t v11;
uint64_t v12;
uint64_t vars8;
v5 = a1 + 117;
if (a1[117] != (id)MEMORY[0x19303E210]())
{
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isExpressiveTextEnabled");
MEMORY[0x19303E0D0]();
if (v6)
{
v7 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(*v5, "asTextBalloonView")), "setTextEffectsDelegate:", 0LL);
MEMORY[0x19303E0D0](v7);
}
objc_msgSend(*v5, "removeFromSuperview");
objc_storeStrong(a1 + 117, a3);
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isExpressiveTextEnabled");
MEMORY[0x19303E0C0]();
if (v8)
{
v9 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(*v5, "asTextBalloonView")), "setTextEffectsDelegate:", a1);
MEMORY[0x19303E0C0](v9);
}
v10 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonSwipeController")), "setBalloonView:", *v5);
MEMORY[0x19303E0D0](v10);
v11 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "contentView")), "addSubview:", *v5);
MEMORY[0x19303E0C0](v11);
v12 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "layer")), "setAllowsGroupOpacity:", objc_msgSend(*v5, "needsGroupOpacity"));
MEMORY[0x19303E0C0](v12);
objc_msgSend(a1, "setNeedsLayout");
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (double)swipeToReplyLayoutOffset
{
uint64_t v2;
double v3;
uint64_t v4;
double v5;
v2 = MEMORY[0x19303DF20](objc_msgSend(a1, "layoutAttributes"));
if (!v2 || (v3 = *(double *)(v2 + 448), v3 <= 0.0))
{
v4 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonSwipeController")), "offsetDelta");
v3 = v5;
v2 = MEMORY[0x19303E0B0](v4);
}
MEMORY[0x19303E090](v2);
return v3;
}
- (uint64_t)allowsSwipeToReply
{
int v2;
int v3;
int v4;
v2 = objc_msgSend(a1, "canInlineReply");
v3 = objc_msgSend(a1, "isReplyContextPreview");
v4 = objc_msgSend(a1, "isInReplyContext");
return v2 & ~v3 & ((v4 | (unsigned int)objc_msgSend(a1, "isAudioMessage")) ^ 1);
}
- (void)isPointInAllowedSwipingArea:(void *)a1
{
uint64_t vars8;
objc_msgSend(a1, "_swipeToReplySafeSwipeRect");
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303C040LL);
}
- (double)_swipeToReplySafeSwipeRect
{
double v2;
double v3;
double v4;
double v5;
int v6;
int v7;
double v8;
double v9;
double v10;
int v11;
double v12;
objc_msgSend(a1[117], "frame");
v3 = v2;
v5 = v4;
v6 = objc_msgSend(a1, "_shouldReverseLayoutDirection");
v7 = objc_msgSend(a1, "orientation");
v8 = v3 + -28.0;
if (!v7)
v8 = v3;
v9 = v3 + 28.0;
if (v7)
v9 = v3;
if (v6)
v10 = v8;
else
v10 = v9;
if (v5 < 156.0)
{
v11 = objc_msgSend(a1, "orientation");
v12 = 0.0;
if (v11)
v12 = 156.0 - v5;
return v10 - v12;
}
return v10;
}
- (void)swipeToReplyGestureHandler:(void *)a1
{
double v2;
uint64_t v3;
uint64_t v4;
uint64_t vars8;
v4 = MEMORY[0x19303E1F0]();
objc_msgSend(a1, "drawerPercentRevealed");
if (v2 <= 0.0)
{
v3 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonSwipeController")), "swipeToReplyGestureHandler:", v4);
MEMORY[0x19303E090](v3);
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (uint64_t)prepareForReuse
{
int v2;
uint64_t v3;
uint64_t v4;
char v5;
uint64_t v6;
void *v7;
uint64_t v8;
uint64_t v9;
uint64_t v10;
void *v11;
double v12;
uint64_t v13;
void *v14;
double v15;
uint64_t v16;
uint64_t v17;
uint64_t v18;
uint64_t v19;
uint64_t v20;
uint64_t v21;
_QWORD v23[2];
v2 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "isExpressiveTextEnabled");
MEMORY[0x19303E0B0]();
if (v2)
{
v3 = MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView"));
v4 = MEMORY[0x19303E010](off_1E0AFD0A8);
v5 = MEMORY[0x19303E020](v3, v4);
MEMORY[0x19303E0B0]();
if ((v5 & 1) != 0)
{
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "textView");
v7 = (void *)MEMORY[0x19303DF20](v6);
v8 = objc_msgSend(v7, "allowsTextAnimations");
if ((_DWORD)v8)
v8 = objc_msgSend(v7, "ck_invalidateAllAnimators");
v9 = MEMORY[0x19303E0C0](v8);
MEMORY[0x19303E0B0](v9);
}
}
v23[0] = a1;
v23[1] = off_1E0B41808;
MEMORY[0x19303E000](v23, 0x1F18DF3B8uLL);
objc_msgSend(a1, "setLayoutAttributes:", 0LL);
objc_msgSend(a1, "setThreadGroupLayoutAttributes:", 0LL);
objc_msgSend(a1, "setInsertingReply:", 0LL);
objc_msgSend(a1, "setLineType:", 0LL);
v10 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "contactImageView")), "layer");
v11 = (void *)MEMORY[0x19303DF20](v10);
MEMORY[0x19303E0C0]();
LODWORD(v12) = 1.0;
objc_msgSend(v11, "setOpacity:", v12);
objc_msgSend(v11, "removeAllAnimations");
v13 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "layer");
v14 = (void *)MEMORY[0x19303DF20](v13);
MEMORY[0x19303E0D0]();
LODWORD(v15) = 1.0;
objc_msgSend(v14, "setOpacity:", v15);
objc_msgSend(v14, "removeAllAnimations");
v16 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "quickActionButton")), "removeFromSuperview");
v17 = MEMORY[0x19303E0D0](v16);
a1[126] = 0LL;
MEMORY[0x19303E150](v17);
v18 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E06285B0], "sharedInstance")), "unregisterPhotoLibraryPersistenceManagerListener:", a1);
MEMORY[0x19303E0D0](v18);
objc_msgSend(a1, "setHasQueuedQuickActionButtonRemoval:", 0LL);
v19 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView")), "setHidden:", 0LL);
MEMORY[0x19303E0D0](v19);
v20 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonSwipeController")), "prepareForReuse");
MEMORY[0x19303E0D0](v20);
v21 = MEMORY[0x19303E0C0](objc_msgSend(a1, "setBalloonCellDelegate:", 0LL));
return MEMORY[0x19303E0B0](v21);
}
- (void)setThreadGroupLayoutAttributes:(void *)a3
{
char v5;
id v6;
void *v7;
void *v8;
id v9;
void *v10;
uint64_t v11;
void *v12;
uint64_t v13;
uint64_t v14;
uint64_t v15;
uint64_t v16;
uint64_t v17;
uint64_t v18;
uint64_t v19;
void *v20;
uint64_t v21;
uint64_t v22;
uint64_t v23;
void *v24;
uint64_t vars8;
v24 = (void *)MEMORY[0x19303E200]();
v5 = objc_msgSend(v24, "isEqualToArray:", MEMORY[0x19303DF20](objc_msgSend(a1, "threadGroupLayoutAttributes")));
MEMORY[0x19303E0C0]();
if ((v5 & 1) == 0)
{
objc_storeStrong(a1 + 128, a3);
v6 = a1[128];
v7 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "lineView"));
v8 = v7;
if (v6)
{
MEMORY[0x19303E0B0]();
if (!v8)
{
MEMORY[0x19303DEA0](&OBJC_CLASS___CKLineView);
v10 = (void *)objc_msgSend(v9, "initWithFrame:", *MEMORY[0x1E05DD558], *(double *)(MEMORY[0x1E05DD558] + 8LL), *(double *)(MEMORY[0x1E05DD558] + 16LL), *(double *)(MEMORY[0x1E05DD558] + 24LL));
v11 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v10, "lineShapeLayer")), "setFillColor:", 0LL);
MEMORY[0x19303E0C0](v11);
v12 = (void *)MEMORY[0x19303DF20](objc_msgSend(v10, "lineShapeLayer"));
v13 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "theme");
v14 = objc_msgSend((id)MEMORY[0x19303DF20](v13), "replyLineColor");
v15 = MEMORY[0x19303DF20](v14);
v16 = objc_msgSend(v12, "setStrokeColor:", objc_msgSend((id)MEMORY[0x19303E170](v15), "CGColor"));
v17 = MEMORY[0x19303E0F0](v16);
v18 = MEMORY[0x19303E0E0](v17);
v19 = MEMORY[0x19303E0D0](v18);
MEMORY[0x19303E0C0](v19);
v20 = (void *)MEMORY[0x19303DF20](objc_msgSend(v10, "lineShapeLayer"));
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineWidth");
v21 = MEMORY[0x19303E0D0](objc_msgSend(v20, "setLineWidth:"));
MEMORY[0x19303E0C0](v21);
v22 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v10, "lineShapeLayer")), "setLineCap:", *MEMORY[0x1E05F8EF8]);
MEMORY[0x19303E0C0](v22);
v23 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v10, "lineShapeLayer")), "setLineJoin:", *MEMORY[0x1E05F8F10]);
MEMORY[0x19303E0C0](v23);
objc_msgSend(a1, "setLineView:", v10);
MEMORY[0x19303E0B0](objc_msgSend(a1, "addSubview:", v10));
}
}
else
{
MEMORY[0x19303E0B0](objc_msgSend(v7, "removeFromSuperview"));
objc_msgSend(a1, "setLineView:", 0LL);
}
objc_msgSend(a1, "setNeedsLayout");
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)_updateLineForThreadGroupLayoutAttributes:(uint64_t)a1
{
uint64_t v2;
double v3;
double v4;
double v5;
double v6;
double v7;
double v8;
double v9;
double v10;
uint64_t v11;
void *v12;
uint64_t v13;
uint64_t v14;
uint64_t v15;
uint64_t vars8;
v2 = MEMORY[0x19303E1F0]();
if (v2)
{
if (!*(_BYTE *)(a1 + 929))
{
v15 = v2;
if ((objc_msgSend((id)a1, "shouldFreezeReplyDecorationsForTimestampReveal") & 1) == 0)
{
objc_msgSend((id)a1, "_createLineViewFrameForThreadGroupLayoutAttributes:", v15);
v4 = v3;
v6 = v5;
v8 = v7;
v10 = v9;
objc_msgSend(*(id *)(a1 + 1040), "setFrame:");
v11 = MEMORY[0x19303DF20](objc_msgSend((id)a1, "_createLinePathForFrame:withThreadGroupLayoutAttributes:", v15, v4, v6, v8, v10));
v12 = (void *)MEMORY[0x19303DF20](objc_msgSend(*(id *)(a1 + 1040), "lineShapeLayer"));
v13 = objc_msgSend(v12, "setPath:", objc_msgSend((id)MEMORY[0x19303E170](v11), "CGPath"));
v14 = MEMORY[0x19303E090](v13);
MEMORY[0x19303E0B0](v14);
}
}
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E070LL);
}
- (double)_createLineViewFrameForThreadGroupLayoutAttributes:(uint64_t)a1
{
void *v2;
double v3;
double v4;
double v5;
double v6;
double *v7;
double v8;
double v9;
double v10;
double v11;
double v12;
double v13;
double v14;
double v15;
double v16;
double v17;
void *v18;
double *v19;
double v20;
double v21;
double v22;
double v23;
void *v24;
uint64_t v25;
double v26;
uint64_t v27;
double v28;
double v29;
uint64_t v30;
double v31;
double v32;
double v33;
double v34;
double v35;
double v36;
double v37;
double v38;
double v39;
double v40;
uint64_t v41;
uint64_t v42;
double v43;
double v44;
uint64_t v45;
double v46;
uint64_t v47;
uint64_t v48;
uint64_t v49;
double v51;
double v52;
double v53;
double v54;
double v55;
double v56;
double v57;
double v58;
double v59;
double v60;
double v61;
double v62;
double v63;
double v64;
double v65;
if (!*(_QWORD *)(a1 + 1040))
return *MEMORY[0x1E05DD558];
v2 = (void *)MEMORY[0x19303E1F0]();
objc_msgSend((id)a1, "contentAlignmentRect");
v59 = v3;
v60 = v4;
v61 = v5;
v62 = v6;
v7 = (double *)MEMORY[0x19303DF20](objc_msgSend(v2, "firstObject"));
objc_msgSend(v7, "frame");
v9 = v8;
v11 = v10;
v13 = v12;
v15 = v14;
v17 = v7[44];
v16 = v7[45];
v63 = v7[46];
v64 = v7[47];
v18 = (void *)MEMORY[0x19303DF20](objc_msgSend(v7, "chatItem"));
v19 = (double *)MEMORY[0x19303DF20](objc_msgSend(v2, "lastObject"));
MEMORY[0x19303E0E0]();
objc_msgSend(v19, "frame");
v51 = v20;
v52 = v21;
v53 = v22;
v54 = v23;
v55 = v19[44];
v56 = v19[45];
v57 = v19[46];
v58 = v19[47];
v24 = (void *)MEMORY[0x19303DF20](objc_msgSend(v19, "chatItem"));
v25 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "transcriptContactImageDiameter");
v65 = v26;
MEMORY[0x19303E0F0](v25);
v27 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineViewVerticalPadding");
v29 = v28;
MEMORY[0x19303E0F0](v27);
v30 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineWidth");
v32 = v31;
MEMORY[0x19303E0F0](v30);
if ((unsigned int)objc_msgSend(v18, "itemIsFromMe"))
{
v33 = MEMORY[0x19303C0B0](v9, v11, v13, v15);
v34 = MEMORY[0x19303C0B0](v17, v16, v63, v64);
}
else
{
v33 = v29 + MEMORY[0x19303C090](v9, v11, v13, v15);
v34 = v29 + MEMORY[0x19303C090](v17, v16, v63, v64);
}
*(double *)(a1 + 1056) = v33;
v36 = v32;
if ((unsigned int)objc_msgSend(v24, "itemIsFromMe"))
{
v37 = v32 + 1.0;
v38 = v37 + MEMORY[0x19303C0B0](v51, v52, v53, v54);
v39 = v37 + MEMORY[0x19303C0B0](v55, v56, v57, v58);
MEMORY[0x19303C0B0](v59, v60, v61, v62);
objc_msgSend((id)a1, "chatEligibleForContactImage");
v40 = v65;
}
else
{
v41 = MEMORY[0x19303DF20](objc_msgSend((id)a1, "contactImageView"));
v42 = MEMORY[0x19303E0F0]();
v40 = v65;
if (v41)
{
v43 = v65 + v29;
v38 = MEMORY[0x19303C090](v42, v51, v52, v53, v54) - v43;
v39 = MEMORY[0x19303C090](v55, v56, v57, v58) - v43;
MEMORY[0x19303C090](v59, v60, v61, v62);
}
else
{
v38 = MEMORY[0x19303C0D0](v42, v51, v52, v53, v54) - v29;
v39 = MEMORY[0x19303C0D0](v55, v56, v57, v58) - v29;
MEMORY[0x19303C0D0](v59, v60, v61, v62);
}
}
*(double *)(a1 + 1064) = (v38 - v33) / (v39 - v34);
v44 = *(double *)(a1 + 1048) + v40 * 0.5 - v36 * 0.5;
v45 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineViewMaxWidth");
MEMORY[0x19303E0D0](v45);
if (CKMainScreenScale_once_12 != -1)
dispatch_once(&CKMainScreenScale_once_12, &__block_literal_global_27);
v46 = *(double *)&CKMainScreenScale_sMainScreenScale_12;
if (*(double *)&CKMainScreenScale_sMainScreenScale_12 == 0.0)
v46 = 1.0;
v35 = round(v44 * v46) / v46;
v47 = MEMORY[0x19303E0E0]();
v48 = MEMORY[0x19303E0C0](v47);
v49 = MEMORY[0x19303E0B0](v48);
MEMORY[0x19303E090](v49);
return v35;
}
- (void)_createLinePathForFrame:(double)a3 withThreadGroupLayoutAttributes:(double)a4
{
void *v10;
uint64_t v11;
double v12;
double v13;
double v14;
double v15;
double v16;
void *v17;
uint64_t v18;
double v19;
double v20;
uint64_t v21;
uint64_t v22;
uint64_t v23;
double v24;
double v25;
uint64_t v26;
uint64_t v27;
_BOOL8 v28;
uint64_t v29;
void *v30;
void *v31;
void *v32;
void *v33;
uint64_t vars8;
v10 = (void *)MEMORY[0x19303E1F0]();
v11 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineWidth");
v13 = v12;
MEMORY[0x19303E0C0](v11);
v14 = v13 * 0.5;
v15 = MEMORY[0x19303C070](a2, a3, a4, a5);
v16 = MEMORY[0x19303C0E0](a2, a3, a4, a5);
v17 = (void *)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E0600550], "bezierPath"));
objc_msgSend(v17, "moveToPoint:", v14, v14);
*(_QWORD *)(a1 + 1032) = MEMORY[0x19303DF20](objc_msgSend((id)a1, "_lineDescriptionForThreadGroupLayoutAttributes:setLineType:", v10, 1LL));
MEMORY[0x19303E140]();
if (objc_msgSend(*(id *)(a1 + 1032), "count"))
{
v18 = 0LL;
v19 = v15 - v14;
v20 = v16 - v14;
while (2)
{
v21 = MEMORY[0x19303DF20](objc_msgSend(v10, "objectAtIndex:", v18));
v22 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(*(id *)(a1 + 1032), "objectAtIndex:", v18)), "unsignedIntegerValue");
MEMORY[0x19303E0F0]();
switch(v22)
{
case 1LL:
if (*(_QWORD *)(a1 + 960) == 3LL)
{
v23 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineBracketRadius");
v25 = v24 * 1.52866;
MEMORY[0x19303E0F0](v23);
if (v25 > a5)
goto LABEL_14;
}
if (v18)
{
v26 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(*(id *)(a1 + 1032), "objectAtIndex:", v18 - 1)), "unsignedIntegerValue");
MEMORY[0x19303E100]();
}
else
{
v26 = 0LL;
}
v28 = v18 + 1 == objc_msgSend(*(id *)(a1 + 1032), "count");
v33 = v17;
v27 = objc_msgSend((id)a1, "_drawStraightLineForPath:withLayout:lineViewMaxY:isTerminal:prevLineSegmentType:", &v33, v21, v28, v26, v19);
LABEL_13:
v29 = MEMORY[0x19303E2E0](v27);
MEMORY[0x19303E0C0]();
v17 = (void *)v29;
LABEL_14:
MEMORY[0x19303E0E0]();
if (++v18 >= (unint64_t)objc_msgSend(*(id *)(a1 + 1032), "count"))
break;
continue;
case 2LL:
v32 = v17;
v27 = objc_msgSend((id)a1, "_drawUpperBracketForPath:withLayout:lineViewMaxX:lineViewMaxY:", &v32, v21, v20, v19);
goto LABEL_13;
case 3LL:
v31 = v17;
v27 = objc_msgSend((id)a1, "_drawLowerBracketForPath:lineViewMaxX:lineViewMaxY:", &v31, v20, v19);
goto LABEL_13;
case 4LL:
v30 = v17;
v27 = objc_msgSend((id)a1, "_drawLoopForPath:withLayout:", &v30, v21);
goto LABEL_13;
default:
goto LABEL_14;
}
break;
}
}
MEMORY[0x19303E090]();
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)_lineDescriptionForThreadGroupLayoutAttributes:(uint64_t)a3 setLineType:(int)a4
{
void *v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
uint64_t v10;
_QWORD v11[4];
id v12;
_QWORD *v13;
_QWORD *v14;
uint64_t *v15;
uint64_t *v16;
_QWORD *v17;
_QWORD *v18;
_QWORD v19[5];
uint64_t v20;
_QWORD v21[3];
uint64_t v22;
_QWORD v23[4];
_QWORD v24[6];
uint64_t v25;
uint64_t *v26;
uint64_t v27;
char v28;
uint64_t v29;
uint64_t *v30;
uint64_t v31;
uint64_t v32;
uint64_t vars8;
v6 = (void *)MEMORY[0x19303E1F0]();
v7 = objc_msgSend(v6, "count");
if (v7)
{
v29 = 0LL;
v30 = &v29;
v31 = 0x2020000000LL;
v32 = 1LL;
v25 = 0LL;
v26 = &v25;
v27 = 0x2020000000LL;
v28 = 0;
v24[0] = 0LL;
v24[1] = v24;
v24[2] = 0x3032000000LL;
v24[3] = __Block_byref_object_copy__10;
v24[4] = __Block_byref_object_dispose__10;
v24[5] = 0LL;
v23[0] = 0LL;
v23[1] = v23;
v23[2] = 0x2020000000LL;
v23[3] = 0LL;
v21[0] = 0LL;
v21[1] = v21;
v21[2] = 0x2020000000LL;
v22 = 0LL;
v22 = objc_msgSend(v6, "count");
v19[0] = 0LL;
v19[1] = v19;
v19[2] = 0x3032000000LL;
v19[3] = __Block_byref_object_copy__10;
v19[4] = __Block_byref_object_dispose__10;
v20 = 0LL;
v20 = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05DC4C8], "array"));
v11[0] = MEMORY[0x1E05D4328];
v11[1] = 3221225472LL;
v11[2] = __86__CKTranscriptBalloonCell__lineDescriptionForThreadGroupLayoutAttributes_setLineType___block_invoke;
v11[3] = &unk_1E0B01068;
v13 = v21;
v12 = (id)MEMORY[0x19303E1E0]();
v14 = v24;
v15 = &v29;
v16 = &v25;
v17 = v23;
v18 = v19;
v8 = objc_msgSend(v12, "enumerateObjectsUsingBlock:", v11);
if (a4)
{
*(_QWORD *)(a1 + 960) = v30[3];
*(_BYTE *)(a1 + 930) = *((_BYTE *)v26 + 24);
}
MEMORY[0x19303E2E0](v8);
MEMORY[0x19303E140]();
v9 = MEMORY[0x19303D700](v19, 8LL);
MEMORY[0x19303E140](v9);
MEMORY[0x19303D700](v21, 8LL);
MEMORY[0x19303D700](v23, 8LL);
v10 = MEMORY[0x19303D700](v24, 8LL);
MEMORY[0x19303E140](v10);
MEMORY[0x19303D700](&v25, 8LL);
v7 = MEMORY[0x19303D700](&v29, 8LL);
}
else if (a4)
{
*(_QWORD *)(a1 + 960) = 0LL;
}
MEMORY[0x19303E090](v7);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
void __86__CKTranscriptBalloonCell__lineDescriptionForThreadGroupLayoutAttributes_setLineType___block_invoke(uint64_t a1, void *a2, uint64_t a3, _BYTE *a4)
{
uint64_t v7;
uint64_t v8;
void *v9;
uint64_t v10;
uint64_t v11;
char v12;
uint64_t v13;
uint64_t v15;
uint64_t v16;
uint64_t v17;
uint64_t v18;
id obj;
uint64_t vars8;
v7 = MEMORY[0x19303DF20](objc_msgSend(a2, "chatItem"));
if (!v7)
{
*a4 = 1;
goto LABEL_34;
}
obj = (id)v7;
if ((unint64_t)(a3 + 1) >= *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 40) + 8LL) + 24LL))
{
v9 = 0LL;
}
else
{
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(*(id *)(a1 + 32), "objectAtIndex:")), "chatItem");
v9 = (void *)MEMORY[0x19303DF20](v8);
MEMORY[0x19303E0C0]();
}
if (!*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 48) + 8LL) + 40LL) && (unsigned int)objc_msgSend(obj, "itemIsFromMe"))
{
v10 = 2LL;
*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 56) + 8LL) + 24LL) = 2LL;
LABEL_33:
v18 = objc_msgSend(*(id *)(*(_QWORD *)(*(_QWORD *)(a1 + 80) + 8LL) + 40LL), "addObject:", MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E82E0], "numberWithUnsignedInteger:", v10)));
MEMORY[0x19303E0E0](v18);
objc_storeStrong((id *)(*(_QWORD *)(*(_QWORD *)(a1 + 48) + 8LL) + 40LL), obj);
*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 72) + 8LL) + 24LL) = v10;
MEMORY[0x19303E0B0]();
LABEL_34:
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
if (v9)
{
if (*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 48) + 8LL) + 40LL))
{
v11 = MEMORY[0x19303E010](off_1E0AFCB00);
v12 = MEMORY[0x19303E020](obj, v11);
if ((unsigned int)objc_msgSend(obj, "itemIsFromMe")
&& (v12 & 1) == 0
&& (objc_msgSend(v9, "itemIsFromMe") & 1) == 0 )
{
*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 56) + 8LL) + 24LL) = 5LL;
*(_BYTE *)(*(_QWORD *)(*(_QWORD *)(a1 + 64) + 8LL) + 24LL) = 0;
v10 = 4LL;
goto LABEL_33;
}
v13 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 72) + 8LL) + 24LL);
v10 = 1LL;
if (v13 != 4 && v13 != 2)
{
if (v13 != 1)
goto LABEL_33;
v15 = *(_QWORD *)(*(_QWORD *)(a1 + 64) + 8LL);
v10 = 1LL;
LABEL_30:
*(_BYTE *)(v15 + 24) = 1;
goto LABEL_33;
}
LABEL_19:
v15 = *(_QWORD *)(*(_QWORD *)(a1 + 64) + 8LL);
goto LABEL_30;
}
}
else
{
if ((objc_msgSend(obj, "itemIsFromMe") & 1) != 0)
{
v16 = *(_QWORD *)(*(_QWORD *)(a1 + 56) + 8LL);
v10 = 3LL;
if (*(_QWORD *)(v16 + 24) == 2LL)
v17 = 4LL;
else
v17 = 3LL;
*(_QWORD *)(v16 + 24) = v17;
*(_BYTE *)(*(_QWORD *)(*(_QWORD *)(a1 + 64) + 8LL) + 24LL) = 0;
goto LABEL_33;
}
if (*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 48) + 8LL) + 40LL) && (objc_msgSend(obj, "itemIsFromMe") & 1) == 0)
{
v10 = 1LL;
if (*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 72) + 8LL) + 24LL) != 1LL)
goto LABEL_33;
goto LABEL_19;
}
}
v10 = 0LL;
goto LABEL_33;
}
- (void)_drawStraightLineForPath:(uint64_t)a3 withLayout:(id *)a4 lineViewMaxY:(uint64_t)a5 isTerminal:(int)a6 prevLineSegmentType:(uint64_t)a7
{
double v12;
double v13;
double v14;
double v15;
void *v16;
uint64_t vars8;
v16 = (void *)MEMORY[0x19303E290]();
if (!a4)
goto LABEL_8;
objc_msgSend(*a4, "currentPoint");
v14 = v13;
v15 = v12;
if (a6)
{
if (a7 == 2 && v12 + 5.0 >= a2)
goto LABEL_8;
}
else
{
a2 = fmin(MEMORY[0x19303C0B0](objc_msgSend(v16, "frame")) - *(double *)(a1 + 1056), a2);
if (a2 <= v15)
goto LABEL_8;
}
objc_msgSend(*a4, "addLineToPoint:", v14, a2);
LABEL_8:
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)_drawUpperBracketForPath:(double)a3 withLayout:(uint64_t)a4 lineViewMaxX:(id *)a5 lineViewMaxY:
{
uint64_t v9;
double v10;
double v11;
double v12;
double v13;
double v14;
double v15;
double v16;
double v17;
void *v19;
uint64_t vars8;
v19 = (void *)MEMORY[0x19303E290]();
if (a5)
{
v9 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineBracketRadius");
v11 = v10;
MEMORY[0x19303E0C0](v9);
objc_msgSend(*a5, "currentPoint");
v13 = v12;
v15 = v14;
objc_msgSend(*a5, "moveToPoint:", a2);
objc_msgSend(*a5, "addCurveToPoint:controlPoint1:controlPoint2:", v13 + v11 * 0.631494, v15 + v11 * 0.0749114, v13 + v11 * 1.08849, v15, v13 + v11 * 0.868407, v15);
objc_msgSend(*a5, "addCurveToPoint:controlPoint1:controlPoint2:", v13 + v11 * 0.0749114, v15 + v11 * 0.631494, v13 + v11 * 0.372824, v15 + v11 * 0.16906, v13 + v11 * 0.16906, v15 + v11 * 0.372824);
v16 = fmin(a3, v15 + v11 * 1.52866);
v17 = fmax(v16, v15 + v11 * 1.08849);
if (v16 <= a3 && v17 <= a3 + 1.0)
{
objc_msgSend(*a5, "addCurveToPoint:controlPoint1:controlPoint2:", v13, v16, v13, v15 + v11 * 0.868407, v13, v17);
if (fmin(a3, MEMORY[0x19303C090](objc_msgSend(v19, "frame")) - *(double *)(a1 + 1056)) > v16)
objc_msgSend(*a5, "addLineToPoint:", v13);
}
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)_drawLowerBracketForPath:(uint64_t)a3 lineViewMaxX:(uint64_t)a4 lineViewMaxY:(id *)a5
{
uint64_t v8;
double v9;
double v10;
double v11;
double v12;
double v13;
double v14;
id v15;
uint64_t vars8;
if (a5)
{
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineBracketRadius");
v10 = v9;
MEMORY[0x19303E0B0](v8);
objc_msgSend(*a5, "currentPoint");
v12 = v11;
v14 = fmax(v13, a2 + v10 * -1.52866);
objc_msgSend(*a5, "addLineToPoint:", v11, v14);
objc_msgSend(*a5, "addCurveToPoint:controlPoint1:controlPoint2:", v12 + v10 * 0.0749114, a2 - v10 * 0.631494, v12, fmax(v14, a2 - v10 * 1.08849), v12, a2 - v10 * 0.868407);
objc_msgSend(*a5, "addCurveToPoint:controlPoint1:controlPoint2:", v12 + v10 * 0.631494, a2 - v10 * 0.0749114, v12 + v10 * 0.16906, a2 - v10 * 0.372824, v12 + v10 * 0.372824, a2 - v10 * 0.16906);
v15 = *a5;
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
objc_msgSend(v15, "addCurveToPoint:controlPoint1:controlPoint2:", a1, a2, v12 + v10 * 0.868407, a2, v12 + v10 * 1.08849, a2);
}
}
- (uint64_t)_drawLoopForPath:(id *)a3 withLayout:
{
uint64_t v4;
void *v5;
uint64_t v6;
double v7;
double v8;
double v9;
double v10;
double v11;
double v12;
double v13;
double v14;
double v15;
double v16;
double v17;
double v18;
double v19;
uint64_t v20;
double v21;
double v22;
double v23;
double v24;
double v25;
double v26;
double v27;
double v28;
id v29;
double v30;
double v31;
uint64_t vars8;
if (a3)
{
v4 = result;
v5 = (void *)MEMORY[0x19303E290]();
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "textBalloonMinHeight");
v8 = v7;
v30 = v7;
MEMORY[0x19303E0D0](v6);
v9 = *(double *)(v4 + 1064);
v10 = fmax(v9 * -2.77777778 + 9.37777778, 3.5);
v11 = MEMORY[0x19303C0B0](objc_msgSend(v5, "frame")) - *(double *)(v4 + 1056);
v12 = fmax(v9 * -1.11111111 + 4.41111111, 2.0);
v13 = v12 * 0.3333;
objc_msgSend(*a3, "currentPoint");
v15 = v14;
v31 = v12 * 0.8333 + v14;
v16 = v10 + v12 + v14;
v17 = MEMORY[0x19303C0D0](objc_msgSend(v5, "frame")) - *(double *)(v4 + 1056);
v18 = fmax(v17, MEMORY[0x19303C0B0](objc_msgSend(v5, "frame")) - *(double *)(v4 + 1056) - v8 * 0.5);
objc_msgSend(*a3, "addLineToPoint:", v15, v18);
objc_msgSend(*a3, "addCurveToPoint:controlPoint1:controlPoint2:", v31, v11, v15, v18 + (v11 - v10 - v18) * 0.552285);
objc_msgSend(*a3, "addCurveToPoint:controlPoint1:controlPoint2:", v16, v10 + v11);
objc_msgSend(*a3, "addCurveToPoint:controlPoint1:controlPoint2:");
objc_msgSend(*a3, "addCurveToPoint:controlPoint1:controlPoint2:", v16);
objc_msgSend(*a3, "addCurveToPoint:controlPoint1:controlPoint2:", v31, v11, v16 - v10 * 0.552285, v11 - v10, v13 + v31, v11 - v10 * 0.552285);
v19 = MEMORY[0x19303C090](objc_msgSend(v5, "frame")) - *(double *)(v4 + 1056);
v20 = objc_msgSend(v5, "frame");
v22 = v21;
v24 = v23;
v26 = v25;
v28 = v27;
MEMORY[0x19303E0C0](v20);
fmin(v19, MEMORY[0x19303C0B0](v22, v24, v26, v28) - *(double *)(v4 + 1056) + v30 * 0.5);
v29 = *a3;
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
return objc_msgSend(v29, "addCurveToPoint:controlPoint1:controlPoint2:");
}
return result;
}
- (uint64_t)_animateReplyContextPreview:(void *)a1
{
uint64_t v2;
void *v3;
uint64_t v4;
double v5;
double v6;
uint64_t v7;
uint64_t v8;
uint64_t v9;
double v10;
uint64_t v11;
double v12;
int v13;
uint64_t v14;
uint64_t v15;
uint64_t v16;
uint64_t v17;
uint64_t v18;
uint64_t result;
uint64_t v20;
int v21;
uint64_t v22;
uint64_t v23;
double v24;
uint64_t v25;
v25 = *MEMORY[0x1E05D4338];
v2 = MEMORY[0x19303E1F0]();
objc_msgSend(MEMORY[0x1E05F87A8], "begin");
v3 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "layer"));
objc_msgSend(a1, "insertionBeginTime");
v4 = objc_msgSend(v3, "convertTime:fromLayer:", 0LL);
v6 = v5;
MEMORY[0x19303E0C0](v4);
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "transcriptReplyPreviewContextContactAlpha");
MEMORY[0x19303E0C0](objc_msgSend(a1, "_fadeInContactImageAlpha:atBeginTime:"));
v7 = MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView"));
v8 = MEMORY[0x19303E010](off_1E0AFD0A8);
v9 = MEMORY[0x19303E020](v7, v8);
v10 = 1.0;
if ((v9 & 1) == 0)
{
v11 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyPreviewBalloonAlpha");
v10 = v12;
v9 = MEMORY[0x19303E0D0](v11);
}
MEMORY[0x19303E0C0](v9);
objc_msgSend(a1, "_fadeInBalloonAlpha:atBeginTime:", v10, v6);
objc_msgSend(MEMORY[0x1E05F87A8], "commit");
v13 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "fullTranscriptLoggingEnabled");
v14 = MEMORY[0x19303E0C0]();
if (v13 && (unsigned int)MEMORY[0x19303CB00](v14))
{
v15 = MEMORY[0x19303D290]("CKTranscriptBalloonCell");
v16 = MEMORY[0x19303DF20](v15);
v17 = MEMORY[0x19303E3F0](v16, 1LL);
if ((_DWORD)v17)
{
LODWORD(v24) = 134217984;
HIDWORD(v24) = LODWORD(v6);
v17 = MEMORY[0x19303D950](&dword_18EEC5000, v16, 1LL, "INSERTION: Reply Preview: Begin:%f", v24);
}
MEMORY[0x19303E0C0](v17);
}
while (1)
{
v18 = objc_msgSend(a1, "setInsertingReply:", 0LL);
if (v2)
v18 = (*(uint64_t (**)(uint64_t, uint64_t))(v2 + 16))(v2, 1LL);
result = MEMORY[0x19303E090](v18);
if (*MEMORY[0x1E05D4338] == v25)
break;
v20 = MEMORY[0x19303D8F0](result);
if (v21 != 1)
{
v23 = MEMORY[0x19303D870](v20);
return -[CKTranscriptBalloonCell _animateUpperBracket:](v23);
}
v22 = MEMORY[0x19303DF10](v20);
MEMORY[0x19303DF60](v22);
}
return result;
}
- (uint64_t)_animateUpperBracket:(uint64_t)a1
{
uint64_t v2;
double v3;
double v4;
id *v5;
void *v6;
uint64_t v7;
void *v8;
uint64_t v9;
double v10;
uint64_t v11;
void *v12;
uint64_t v13;
double v14;
double v15;
uint64_t v16;
uint64_t v17;
uint64_t v18;
int v19;
uint64_t v20;
uint64_t v21;
uint64_t v22;
uint64_t v23;
uint64_t v24;
uint64_t v25;
uint64_t result;
uint64_t v27;
int v28;
uint64_t v29;
uint64_t v30;
_BYTE v31[24];
uint64_t v32;
v32 = *MEMORY[0x1E05D4338];
v2 = MEMORY[0x19303E1F0]();
objc_msgSend((id)a1, "insertionDuration");
v4 = v3;
objc_msgSend(MEMORY[0x1E05F87A8], "begin");
v5 = (id *)(a1 + 1040);
v6 = *(void **)(a1 + 1040);
objc_msgSend((id)a1, "_createLineViewFrameForThreadGroupLayoutAttributes:", *(_QWORD *)(a1 + 1024));
objc_msgSend(v6, "setFrame:");
objc_msgSend(*(id *)(a1 + 1040), "frame");
v7 = MEMORY[0x19303DF20](objc_msgSend((id)a1, "_createLinePathForFrame:withThreadGroupLayoutAttributes:", *(_QWORD *)(a1 + 1024)));
v8 = (void *)MEMORY[0x19303DF20](objc_msgSend(*(id *)(a1 + 1040), "lineShapeLayer"));
v9 = objc_msgSend(v8, "setPath:", objc_msgSend((id)MEMORY[0x19303E170](v7), "CGPath"));
MEMORY[0x19303E0D0](v9);
v10 = 0.0;
v11 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(*(id *)(a1 + 1040), "lineShapeLayer")), "setStrokeEnd:", 0.0);
MEMORY[0x19303E0D0](v11);
if ((unsigned int)objc_msgSend((id)a1, "insertingWithReplyPreview"))
v10 = 0.3;
v12 = (void *)MEMORY[0x19303DF20](objc_msgSend((id)a1, "layer"));
objc_msgSend((id)a1, "insertionBeginTime");
v13 = objc_msgSend(v12, "convertTime:fromLayer:", 0LL);
v15 = v10 + v14;
MEMORY[0x19303E0D0](v13);
v16 = MEMORY[0x19303DF20](objc_msgSend((id)a1, "animationWithKeyPath:fromValue:toValue:beginTime:duration:timingFunctionName:", &stru_1E8DB3FB8, &unk_1E8E7CEF8, &unk_1E8E7CF08, *MEMORY[0x1E05F8F20], v15, v4));
v17 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(*v5, "lineShapeLayer")), "addAnimation:forKey:", v16, &stru_1E8DB3FD8);
MEMORY[0x19303E0E0](v17);
v18 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(*v5, "lineShapeLayer")), "setStrokeEnd:", 1.0);
MEMORY[0x19303E0E0](v18);
objc_msgSend((id)a1, "_fadeInContactImageAlpha:atBeginTime:", 1.0, v4 + v15);
objc_msgSend((id)a1, "_fadeInBalloonAlpha:atBeginTime:", 1.0, v4 + v15);
objc_msgSend(MEMORY[0x1E05F87A8], "commit");
v19 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "fullTranscriptLoggingEnabled");
MEMORY[0x19303E0E0]();
if (v19 && (unsigned int)MEMORY[0x19303CB00](objc_msgSend((id)a1, "insertionBeginTime")))
{
v20 = MEMORY[0x19303D290]("CKTranscriptBalloonCell");
v21 = MEMORY[0x19303DF20](v20);
v22 = MEMORY[0x19303E3F0](v21, 1LL);
if ((_DWORD)v22)
{
*(_DWORD *)v31 = 134218752;
*(double *)&v31[4] = v15;
*(_WORD *)&v31[12] = 2048;
*(double *)&v31[14] = v4;
*(_WORD *)&v31[22] = 2048;
v22 = MEMORY[0x19303D950](&dword_18EEC5000, v21, 1LL, "INSERTION: Upper Bracket: Begin:%f, Duration:%f, Fade:%f, Total:%f", *(double *)v31, *(double *)&v31[8], *(double *)&v31[16], v4 + v15 - v15);
}
MEMORY[0x19303E0E0](v22);
}
while (1)
{
v23 = objc_msgSend((id)a1, "setInsertingReply:", 0LL);
if (v2)
v23 = (*(uint64_t (**)(uint64_t, uint64_t))(v2 + 16))(v2, 1LL);
v24 = MEMORY[0x19303E0D0](v23);
v25 = MEMORY[0x19303E0C0](v24);
result = MEMORY[0x19303E090](v25);
if (*MEMORY[0x1E05D4338] == v32)
break;
v27 = MEMORY[0x19303D8F0](result);
if (v28 != 1)
{
v30 = MEMORY[0x19303D870](v27);
return -[CKTranscriptBalloonCell _animateLineExtension:](v30);
}
v29 = MEMORY[0x19303DF10](v27);
MEMORY[0x19303DF60](v29);
}
return result;
}
- (double)_animateLineExtension:(id *)a1
{
uint64_t v2;
double v3;
double v4;
uint64_t v5;
double v6;
double v7;
double v8;
double v9;
double v10;
double v11;
double v12;
double v13;
double v14;
double v15;
double v16;
double v17;
double v18;
double v19;
double v20;
uint64_t v21;
void *v22;
void *v23;
unint64_t v24;
double v25;
uint64_t v26;
_BOOL4 v27;
double v28;
void *v29;
uint64_t v30;
double v31;
double v32;
double v33;
uint64_t v34;
uint64_t v35;
uint64_t v36;
double v37;
int v38;
uint64_t v39;
double v40;
double v41;
uint64_t v42;
uint64_t v43;
uint64_t v44;
uint64_t v45;
uint64_t v46;
uint64_t v47;
uint64_t v48;
uint64_t v49;
uint64_t v50;
double result;
uint64_t v52;
int v53;
uint64_t v54;
uint64_t v55;
double v56;
double v57;
double v58;
double v59;
_BYTE v60[22];
__int16 v61;
double v62;
__int16 v63;
double v64;
uint64_t v65;
v65 = *MEMORY[0x1E05D4338];
v2 = MEMORY[0x19303E1F0]();
objc_msgSend(a1, "insertionDuration");
v4 = v3;
objc_msgSend(MEMORY[0x1E05F87A8], "begin");
v5 = MEMORY[0x19303DF20](objc_msgSend(a1[128], "subarrayWithRange:", 0LL, objc_msgSend(a1[128], "count") - 1));
objc_msgSend(a1, "_createLineViewFrameForThreadGroupLayoutAttributes:", v5);
v7 = v6;
v8 = COERCE_DOUBLE(MEMORY[0x19303DF20](objc_msgSend(a1, "_createLinePathForFrame:withThreadGroupLayoutAttributes:", v5)));
objc_msgSend(*(id *)&v8, "currentPoint");
v10 = v9;
v12 = v11;
objc_msgSend(a1, "_createLineViewFrameForThreadGroupLayoutAttributes:", a1[128]);
v14 = v13;
v16 = v15;
v18 = v17;
v20 = v19;
objc_msgSend(a1[130], "setFrame:");
v59 = v8;
v21 = MEMORY[0x19303DF20](objc_msgSend(a1, "_extendPath:withFrame:", &v59, v14, v16, v18, v20));
MEMORY[0x19303E2E0]();
MEMORY[0x19303E0E0]();
v22 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1[130], "lineShapeLayer"));
v23 = (void *)MEMORY[0x19303E170](v21);
MEMORY[0x19303E0F0](objc_msgSend(v22, "setPath:", objc_msgSend(v23, "CGPath")));
v24 = objc_msgSend(a1[129], "count");
v25 = 0.0;
if (v24 >= 2)
{
v26 = objc_msgSend((id)MEMORY[0x19303E170](v23), "CGPath");
v25 = calculateLengthPercentageToPointInLine(v26, v10, v12);
}
v27 = v24 < 2;
if ((unsigned int)objc_msgSend(a1, "insertingWithReplyPreview"))
v28 = 0.15;
else
v28 = 0.0;
v29 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "layer"));
objc_msgSend(a1, "insertionBeginTime");
v30 = objc_msgSend(v29, "convertTime:fromLayer:", 0LL);
v32 = v31;
MEMORY[0x19303E0F0](v30);
v33 = v28 + v32;
v34 = objc_msgSend(a1, "animationWithKeyPath:fromValue:toValue:beginTime:duration:timingFunctionName:", &stru_1E8DB3FB8, MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E82E0], "numberWithDouble:", v25)), &unk_1E8E7CF08, *MEMORY[0x1E05F8F38], v33, v4);
v35 = MEMORY[0x19303DF20](v34);
MEMORY[0x19303E100]();
v36 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1[130], "lineShapeLayer")), "addAnimation:forKey:", v35, &stru_1E8DB3FD8);
MEMORY[0x19303E100](v36);
v37 = v4 + v33;
if (v27)
{
objc_msgSend(a1, "_fadeInBalloonAlpha:atBeginTime:", 1.0, v4 + v33);
objc_msgSend(a1, "_fadeInContactImageAlpha:atBeginTime:", 1.0, v4 + v33);
}
else
{
v37 = v37 + -0.1;
objc_msgSend(a1, "_fadeInBalloonAlpha:atBeginTime:", 1.0, v37);
objc_msgSend(a1, "_slideContactImageWithTranslate:duration:beginTime:", v7 - v20, v4, v33);
}
objc_msgSend(MEMORY[0x1E05F87A8], "commit");
v38 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E062AE00], "sharedFeatureFlags")), "fullTranscriptLoggingEnabled");
MEMORY[0x19303E100]();
if (v38)
{
v39 = objc_msgSend(a1, "insertionBeginTime");
v41 = v40;
if ((unsigned int)MEMORY[0x19303CB00](v39))
{
v42 = MEMORY[0x19303D290]("CKTranscriptBalloonCell");
v43 = MEMORY[0x19303DF20](v42);
v44 = MEMORY[0x19303E3F0](v43, 1LL);
if ((_DWORD)v44)
{
*(_DWORD *)v60 = 134218752;
*(double *)&v60[4] = v33;
*(_WORD *)&v60[12] = 2048;
*(double *)&v60[14] = v4;
v61 = 2048;
v62 = v37 - v33;
v63 = 2048;
v64 = v37 + 0.3 - v41;
v44 = MEMORY[0x19303D950](&dword_18EEC5000, v43, 1LL, "INSERTION: Line Extension: Begin:%f, Duration:%f, Fade:%f, Total:%f", v58, v59, *(double *)v60, *(double *)&v60[8]);
}
MEMORY[0x19303E100](v44);
}
}
while (1)
{
v45 = objc_msgSend(a1, "setInsertingReply:", 0LL);
if (v2)
v45 = (*(uint64_t (**)(uint64_t, uint64_t))(v2 + 16))(v2, 1LL);
v46 = MEMORY[0x19303E0F0](v45);
v47 = MEMORY[0x19303E0E0](v46);
v48 = MEMORY[0x19303E0D0](v47);
v49 = MEMORY[0x19303E0B0](v48);
v50 = MEMORY[0x19303E090](v49);
if (*MEMORY[0x1E05D4338] == v65)
break;
v52 = MEMORY[0x19303D8F0](v50);
if (v53 != 1)
{
v55 = MEMORY[0x19303D870](v52);
return calculateLengthPercentageToPointInLine(v55, v56, v57);
}
v54 = MEMORY[0x19303DF10](v52);
MEMORY[0x19303DF60](v54);
}
return result;
}
- (uint64_t)_animateLowerBracketToLoop:(id *)a1
{
double v2;
double v3;
void *v4;
double v5;
double v6;
double v7;
double v8;
double v9;
double v10;
double v11;
double v12;
uint64_t v13;
uint64_t v14;
double v15;
double v16;
uint64_t v17;
uint64_t v18;
double v19;
double v20;
uint64_t v21;
uint64_t v22;
void *v23;
double v24;
double v25;
double v26;
double v27;
double v28;
double v29;
double v30;
double v31;
double v32;
double v33;
double v34;
double v35;
double v36;
uint64_t v37;
double v38;
double v39;
uint64_t v40;
void *v41;
double v42;
uint64_t v43;
void *v44;
uint64_t v45;
double v46;
double v47;
__n128 v48;
double v49;
double v50;
double v51;
uint64_t v52;
uint64_t v53;
void *v54;
uint64_t v55;
uint64_t v56;
void *v57;
uint64_t v58;
uint64_t v59;
uint64_t v60;
uint64_t v61;
uint64_t v62;
double v63;
dispatch_time_t v64;
uint64_t v65;
uint64_t v66;
uint64_t v67;
uint64_t v68;
uint64_t v69;
uint64_t v70;
uint64_t v71;
uint64_t v72;
uint64_t v73;
uint64_t v74;
uint64_t v75;
uint64_t v77;
void *v78;
uint64_t v79;
uint64_t v80;
_QWORD block[6];
v80 = MEMORY[0x19303E1F0]();
objc_msgSend(a1, "insertionDuration");
v3 = v2;
objc_msgSend(MEMORY[0x1E05F87A8], "begin");
v4 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1[128], "subarrayWithRange:", 0LL, objc_msgSend(a1[128], "count") - 1));
objc_msgSend(a1, "_createLineViewFrameForThreadGroupLayoutAttributes:", v4);
v6 = v5;
v8 = v7;
v10 = v9;
v12 = v11;
v13 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v4, "lastObject")), "chatItem");
v79 = MEMORY[0x19303DF20](v13);
MEMORY[0x19303E0B0]();
v14 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonCellDelegate")), "cellForChatItem:", v79);
v78 = (void *)MEMORY[0x19303DF20](v14);
MEMORY[0x19303E0B0]();
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v4, "lastObject")), "frame");
v16 = v15;
v17 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(v78, "layer")), "presentationLayer");
v18 = objc_msgSend((id)MEMORY[0x19303DF20](v17), "frame");
v20 = v16 - v19;
v21 = MEMORY[0x19303E0F0](v18);
v22 = MEMORY[0x19303E0D0](v21);
MEMORY[0x19303E0B0](v22);
v23 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "_createLinePathForFrame:withThreadGroupLayoutAttributes:", v4, v6, v8, v10, v12 - v20));
objc_msgSend(v23, "currentPoint");
v25 = v24;
v27 = v26;
objc_msgSend(a1, "_createLineViewFrameForThreadGroupLayoutAttributes:", a1[128]);
v29 = v28;
v31 = v30;
v33 = v32;
v35 = v34;
objc_msgSend(a1[130], "setFrame:");
v77 = MEMORY[0x19303DF20](objc_msgSend(v4, "lastObject"));
v36 = MEMORY[0x19303C070](v29, v31, v33, v35);
v37 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineWidth");
v39 = v36 + v38 * -0.5;
MEMORY[0x19303E0B0](v37);
v40 = MEMORY[0x19303DF20](objc_msgSend(a1, "_drawLowerBracketLoopForPath:withLayout:lineViewMaxY:", v23, v77, v39));
v41 = (void *)MEMORY[0x19303E170](v40);
v42 = calculateLengthPercentageToPointInLine(objc_msgSend(v41, "CGPath"), v25, v27);
objc_msgSend(a1[130], "frame");
v43 = MEMORY[0x19303DF20](objc_msgSend(a1, "_createLinePathForFrame:withThreadGroupLayoutAttributes:", a1[128]));
v44 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "layer"));
objc_msgSend(a1, "insertionBeginTime");
v45 = objc_msgSend(v44, "convertTime:fromLayer:", 0LL);
v47 = v46;
v48 = MEMORY[0x19303E110](v45);
v48.n128_u32[0] = 1060424070;
LODWORD(v49) = 995640528;
LODWORD(v50) = 1047918333;
LODWORD(v51) = 1065366638;
v52 = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05F86D0], "functionWithControlPoints::::", v48.n128_f64[0], v49, v50, v51));
v53 = objc_msgSend((id)MEMORY[0x19303E170](v41), "CGPath");
v54 = (void *)MEMORY[0x19303E170](v43);
v55 = MEMORY[0x19303DF20](objc_msgSend(a1, "animationWithKeyPath:fromValue:toValue:beginTime:duration:timingFunction:", &stru_1E8DB3FF8, v53, objc_msgSend(v54, "CGPath"), v52, v47, v3));
v56 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1[130], "lineShapeLayer")), "addAnimation:forKey:", v55, &stru_1E8DB4018);
MEMORY[0x19303E0B0](v56);
v57 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1[130], "lineShapeLayer"));
v58 = objc_msgSend(v57, "setPath:", objc_msgSend((id)MEMORY[0x19303E170](v54), "CGPath"));
MEMORY[0x19303E0E0](v58);
v59 = objc_msgSend(a1, "animationWithKeyPath:fromValue:toValue:beginTime:duration:timingFunction:", &stru_1E8DB3FB8, MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E82E0], "numberWithDouble:", v42)), &unk_1E8E7CF08, v52, v47, v3);
v60 = MEMORY[0x19303DF20](v59);
MEMORY[0x19303E0E0]();
v61 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1[130], "lineShapeLayer")), "addAnimation:forKey:", v60, &stru_1E8DB3FD8);
MEMORY[0x19303E0E0](v61);
v62 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1[130], "lineShapeLayer")), "setStrokeEnd:", 1.0);
MEMORY[0x19303E0E0](v62);
v63 = v3 + v47 + -0.25;
objc_msgSend(a1, "_fadeInContactImageAlpha:atBeginTime:", 1.0, v63);
objc_msgSend(a1, "_fadeInBalloonAlpha:atBeginTime:", 1.0, v63);
objc_msgSend(MEMORY[0x1E05F87A8], "commit");
v64 = dispatch_time(0LL, (uint64_t)(v3 * 1000000000.0));
block[0] = MEMORY[0x1E05D4328];
block[1] = 3221225472LL;
block[2] = __54__CKTranscriptBalloonCell__animateLowerBracketToLoop___block_invoke;
block[3] = &unk_1E0B01090;
block[4] = a1;
block[5] = v80;
MEMORY[0x19303E2E0]();
dispatch_after(v64, MEMORY[0x1E05D43A8], block);
v65 = MEMORY[0x19303E140]();
v66 = MEMORY[0x19303E0C0](v65);
v67 = MEMORY[0x19303E0D0](v66);
v68 = MEMORY[0x19303E130](v67);
v69 = MEMORY[0x19303E120](v68);
v70 = MEMORY[0x19303E0B0](v69);
v71 = MEMORY[0x19303E110](v70);
v72 = MEMORY[0x19303E140](v71);
v73 = MEMORY[0x19303E0F0](v72);
v74 = MEMORY[0x19303E140](v73);
v75 = MEMORY[0x19303E140](v74);
return MEMORY[0x19303E090](v75);
}
uint64_t __54__CKTranscriptBalloonCell__animateLowerBracketToLoop___block_invoke(uint64_t a1)
{
uint64_t result;
uint64_t (*v3)(void);
uint64_t vars8;
objc_msgSend(*(id *)(a1 + 32), "setInsertingReply:", 0LL);
result = *(_QWORD *)(a1 + 40);
if (result)
{
v3 = *(uint64_t (**)(void))(result + 16);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
return v3();
}
return result;
}
- (uint64_t)_slideContactImageWithTranslate:(double)a3 duration:(double)a4 beginTime:
{
uint64_t v8;
void *v9;
void *v10;
__int128 v11;
uint64_t v12;
uint64_t v13;
uint64_t v14;
uint64_t v15;
uint64_t v16;
uint64_t v17;
__int128 v19;
__int128 v20;
__int128 v21;
__int128 v22;
__int128 v23;
__int128 v24;
__int128 v25;
__int128 v26;
__int128 v27;
__int128 v28;
__int128 v29;
__int128 v30;
__int128 v31;
__int128 v32;
__int128 v33;
__int128 v34;
__int128 v35;
__int128 v36;
__int128 v37;
__int128 v38;
__int128 v39;
__int128 v40;
__int128 v41;
__int128 v42;
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "contactImageView")), "layer");
v9 = (void *)MEMORY[0x19303DF20](v8);
v10 = v9;
v11 = 0uLL;
v41 = 0u;
v42 = 0u;
v39 = 0u;
v40 = 0u;
v37 = 0u;
v38 = 0u;
v35 = 0u;
v36 = 0u;
if (v9)
{
objc_msgSend(v9, "transform");
v11 = 0uLL;
}
v33 = v11;
v34 = v11;
v31 = v11;
v32 = v11;
v29 = v11;
v30 = v11;
v27 = v11;
v28 = v11;
v23 = v39;
v24 = v40;
v25 = v41;
v26 = v42;
v19 = v35;
v20 = v36;
v21 = v37;
v22 = v38;
MEMORY[0x19303B6E0](&v27, &v19, 0.0, a2, 0.0);
v23 = v31;
v24 = v32;
v25 = v33;
v26 = v34;
v19 = v27;
v20 = v28;
v21 = v29;
v22 = v30;
v12 = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithCATransform3D:", &v19));
v23 = v39;
v24 = v40;
v25 = v41;
v26 = v42;
v19 = v35;
v20 = v36;
v21 = v37;
v22 = v38;
v13 = objc_msgSend(a1, "animationWithKeyPath:fromValue:toValue:beginTime:duration:timingFunctionName:", &stru_1E8DB1778, v12, MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E85F0], "valueWithCATransform3D:", &v19)), *MEMORY[0x1E05F8F38], a4, a3);
v14 = MEMORY[0x19303DF20](v13);
v15 = MEMORY[0x19303E0E0]();
MEMORY[0x19303E0D0](v15);
v16 = MEMORY[0x19303E0C0](objc_msgSend(v10, "addAnimation:forKey:", v14, &stru_1E8DB4038));
v17 = MEMORY[0x19303E0B0](v16);
return MEMORY[0x19303E090](v17);
}
- (void)_fadeInContactImageAlpha:(double)a3 atBeginTime:
{
void *v6;
uint64_t v7;
uint64_t v8;
double v9;
uint64_t v10;
void *v11;
uint64_t vars8;
v11 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "contactImageView"));
v6 = (void *)MEMORY[0x19303DF20](objc_msgSend(v11, "layer"));
objc_msgSend(v6, "setOpacity:", 0.0);
v7 = objc_msgSend(a1, "animationWithKeyPath:fromValue:toValue:beginTime:duration:timingFunctionName:", &stru_1E8DB1758, &unk_1E8E7CEF8, MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E82E0], "numberWithDouble:", a2)), *MEMORY[0x1E05F8F18], a3, 0.3);
v8 = MEMORY[0x19303DF20](v7);
MEMORY[0x19303E0C0]();
objc_msgSend(v6, "addAnimation:forKey:", v8, &stru_1E8DB4058);
*(float *)&v9 = a2;
v10 = MEMORY[0x19303E0B0](objc_msgSend(v6, "setOpacity:", v9));
MEMORY[0x19303E090](v10);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)_fadeInBalloonAlpha:(double)a3 atBeginTime:
{
void *v6;
uint64_t v7;
uint64_t v8;
double v9;
uint64_t v10;
void *v11;
uint64_t vars8;
v11 = (void *)MEMORY[0x19303DF20](objc_msgSend(a1, "balloonView"));
v6 = (void *)MEMORY[0x19303DF20](objc_msgSend(v11, "layer"));
objc_msgSend(v6, "setOpacity:", 0.0);
v7 = objc_msgSend(a1, "animationWithKeyPath:fromValue:toValue:beginTime:duration:timingFunctionName:", &stru_1E8DB1758, &unk_1E8E7CEF8, MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05E82E0], "numberWithDouble:", a2)), *MEMORY[0x1E05F8F18], a3, 0.3);
v8 = MEMORY[0x19303DF20](v7);
MEMORY[0x19303E0C0]();
objc_msgSend(v6, "addAnimation:forKey:", v8, &stru_1E8DB4078);
*(float *)&v9 = a2;
v10 = MEMORY[0x19303E0B0](objc_msgSend(v6, "setOpacity:", v9));
MEMORY[0x19303E090](v10);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)animationWithKeyPath:(uint64_t)a3 fromValue:(uint64_t)a4 toValue:(uint64_t)a5 beginTime:duration:timingFunctionName:
{
void *v8;
uint64_t v9;
uint64_t v10;
uint64_t v11;
void *v12;
uint64_t v13;
uint64_t vars8;
v8 = (void *)MEMORY[0x1E05F8610];
v9 = MEMORY[0x19303E2B0]();
v10 = MEMORY[0x19303E1E0]();
v11 = MEMORY[0x19303E210]();
v12 = (void *)MEMORY[0x19303DF20](objc_msgSend(v8, "animationWithKeyPath:", a5));
MEMORY[0x19303E0C0](objc_msgSend(v12, "setFromValue:", v11));
MEMORY[0x19303E0F0](objc_msgSend(v12, "setToValue:", v10));
objc_msgSend(v12, "setFillMode:", *MEMORY[0x1E05F8A48]);
objc_msgSend(v12, "setRemovedOnCompletion:", 1LL);
v13 = MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E05F86D0], "functionWithName:", v9));
MEMORY[0x19303E0B0]();
MEMORY[0x19303E0C0](objc_msgSend(v12, "setTimingFunction:", v13));
objc_msgSend(v12, "setBeginTime:", a1);
objc_msgSend(v12, "setDuration:", a2);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)animationWithKeyPath:(uint64_t)a3 fromValue:(uint64_t)a4 toValue:(uint64_t)a5 beginTime:duration:timingFunction:
{
void *v8;
uint64_t v9;
uint64_t v10;
uint64_t v11;
void *v12;
uint64_t vars8;
v8 = (void *)MEMORY[0x1E05F8610];
v9 = MEMORY[0x19303E2B0]();
v10 = MEMORY[0x19303E200]();
v11 = MEMORY[0x19303E210]();
v12 = (void *)MEMORY[0x19303DF20](objc_msgSend(v8, "animationWithKeyPath:", a5));
MEMORY[0x19303E0C0](objc_msgSend(v12, "setFromValue:", v11));
MEMORY[0x19303E0B0](objc_msgSend(v12, "setToValue:", v10));
objc_msgSend(v12, "setFillMode:", *MEMORY[0x1E05F8A48]);
objc_msgSend(v12, "setRemovedOnCompletion:", 1LL);
MEMORY[0x19303E090](objc_msgSend(v12, "setTimingFunction:", v9));
objc_msgSend(v12, "setBeginTime:", a1);
objc_msgSend(v12, "setDuration:", a2);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)_drawLowerBracketLoopForPath:(uint64_t)a1 withLayout:(double)a2 lineViewMaxY:
{
void *v4;
void *v5;
double v6;
double v7;
double v8;
double v9;
double v10;
double v11;
double v12;
double v13;
uint64_t v14;
double v15;
double v16;
double v17;
double v18;
void *v19;
double v20;
double v21;
double v22;
double v23;
double v24;
double v25;
double v26;
uint64_t v27;
double v28;
double v29;
double v30;
double v31;
double v32;
double v33;
double v34;
double v35;
uint64_t vars8;
MEMORY[0x19303E1F0]();
v4 = *(void **)(a1 + 1040);
v5 = (void *)MEMORY[0x19303E200]();
objc_msgSend(v4, "frame");
v7 = v6;
v9 = v8;
v11 = v10;
v13 = v12;
v14 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineWidth");
v16 = v15;
MEMORY[0x19303E0D0](v14);
v17 = v16 * 0.5;
v18 = v17 + MEMORY[0x19303C0E0](v7, v9, v11, v13) * 0.5;
v19 = (void *)MEMORY[0x19303E210]();
objc_msgSend(v19, "currentPoint");
v21 = v20 + -30.0;
objc_msgSend(v19, "addCurveToPoint:controlPoint1:controlPoint2:", v18, v20 + -30.0, v22 + 15.0);
v23 = v21 + 5.0;
v24 = MEMORY[0x19303C0B0](objc_msgSend(v5, "frame")) - *(double *)(a1 + 1056) + -10.0;
objc_msgSend(v19, "addCurveToPoint:controlPoint1:controlPoint2:", v17, MEMORY[0x19303C0B0](objc_msgSend(v5, "frame")) - *(double *)(a1 + 1056), v17, v23, v17, v24);
v25 = MEMORY[0x19303C0B0](objc_msgSend(v5, "frame")) - *(double *)(a1 + 1056) + 15.0;
v26 = MEMORY[0x19303C090](objc_msgSend(v5, "frame")) - *(double *)(a1 + 1056) + -15.0;
v27 = objc_msgSend(v5, "frame");
v29 = v28;
v31 = v30;
v33 = v32;
v35 = v34;
MEMORY[0x19303E0B0](v27);
objc_msgSend(v19, "addCurveToPoint:controlPoint1:controlPoint2:", v17, MEMORY[0x19303C090](v29, v31, v33, v35) - *(double *)(a1 + 1056), v17, v25, v17, v26);
MEMORY[0x19303E0C0](objc_msgSend(v19, "addLineToPoint:", v17, a2));
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)_extendPath:(double)a3 withFrame:(double)a4
{
uint64_t v12;
double v13;
double v14;
void *v15;
uint64_t v16;
double v17;
uint64_t vars8;
v12 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(off_1E0AFD2A0, "sharedBehaviors")), "replyLineWidth");
v14 = v13;
MEMORY[0x19303E0B0](v12);
v15 = (void *)objc_msgSend(*a7, "copy");
v16 = objc_msgSend(v15, "currentPoint");
objc_msgSend(v15, "addLineToPoint:", v17, MEMORY[0x19303C070](v16, a1, a2, a3, a4) + v14 * -0.5);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (uint64_t)_removeQuickActionButtonIfNeededAnimated:(int)a3
{
uint64_t result;
uint64_t v6;
void *v7;
uint64_t v8;
_QWORD v9[5];
_QWORD v10[5];
_QWORD v11[5];
uint64_t vars8;
result = objc_msgSend(a1[126], "isAnimating");
if ((_DWORD)result)
{
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
return objc_msgSend(a1, "setHasQueuedQuickActionButtonRemoval:", 1LL);
}
else if (a1[126])
{
v11[0] = MEMORY[0x1E05D4328];
v11[1] = 3221225472LL;
v11[2] = __68__CKTranscriptBalloonCell__removeQuickActionButtonIfNeededAnimated___block_invoke;
v11[3] = &unk_1E0AFFA38;
v11[4] = a1;
v6 = MEMORY[0x19303E1A0](v11);
if (a3)
{
v7 = (void *)MEMORY[0x1E0600D18];
v10[0] = MEMORY[0x1E05D4328];
v10[1] = 3221225472LL;
v10[2] = __68__CKTranscriptBalloonCell__removeQuickActionButtonIfNeededAnimated___block_invoke_2;
v10[3] = &unk_1E0AFFA38;
v10[4] = a1;
v9[0] = MEMORY[0x1E05D4328];
v9[1] = 3221225472LL;
v9[2] = __68__CKTranscriptBalloonCell__removeQuickActionButtonIfNeededAnimated___block_invoke_3;
v9[3] = &unk_1E0B010B8;
v9[4] = MEMORY[0x19303E1E0](v6);
v8 = MEMORY[0x19303E140](objc_msgSend(v7, "animateWithDuration:animations:completion:", v10, v9, 0.300000012));
}
else
{
v8 = (*(uint64_t (**)(uint64_t))(v6 + 16))(v6);
}
return MEMORY[0x19303E090](v8);
}
return result;
}
void __68__CKTranscriptBalloonCell__removeQuickActionButtonIfNeededAnimated___block_invoke(uint64_t a1)
{
uint64_t vars8;
objc_msgSend(*(id *)(*(_QWORD *)(a1 + 32) + 1008LL), "removeFromSuperview");
*(_QWORD *)(*(_QWORD *)(a1 + 32) + 1008LL) = 0LL;
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
uint64_t __68__CKTranscriptBalloonCell__removeQuickActionButtonIfNeededAnimated___block_invoke_2(uint64_t a1)
{
return objc_msgSend(*(id *)(*(_QWORD *)(a1 + 32) + 1008LL), "setAlpha:", 0.0);
}
uint64_t __68__CKTranscriptBalloonCell__removeQuickActionButtonIfNeededAnimated___block_invoke_3(uint64_t a1)
{
return (*(uint64_t (**)(void))(*(_QWORD *)(a1 + 32) + 16LL))();
}
- (uint64_t)_addQuickActionButtonIfNeededAnimated:(int)a3
{
uint64_t result;
int v6;
_QWORD *v7;
uint64_t v8;
uint64_t v9;
uint64_t v10;
uint64_t v11;
_QWORD v12[5];
uint64_t vars8;
result = objc_msgSend(a1, "hasQueuedQuickActionButtonRemoval");
if ((_DWORD)result)
result = objc_msgSend(a1, "setHasQueuedQuickActionButtonRemoval:", 0LL);
if (!a1[126])
{
v6 = objc_msgSend(a1, "isRichLink");
v7 = &off_1E0AFCDD8;
if (!v6)
v7 = &off_1E0AFCDE0;
a1[126] = (id)MEMORY[0x19303DEC0](*v7);
MEMORY[0x19303E140]();
objc_msgSend(a1[126], "setAnimationDelegate:", a1);
objc_msgSend(a1[126], "setDelegate:", a1);
if (a3)
{
objc_msgSend(a1[126], "setAlpha:", 0.0);
v8 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "contentView")), "addSubview:", a1[126]);
MEMORY[0x19303E0B0](v8);
v9 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "contentView")), "sendSubviewToBack:", a1[126]);
MEMORY[0x19303E0B0](v9);
objc_msgSend(a1, "setNeedsLayout");
v12[0] = MEMORY[0x1E05D4328];
v12[1] = 3221225472LL;
v12[2] = __65__CKTranscriptBalloonCell__addQuickActionButtonIfNeededAnimated___block_invoke;
v12[3] = &unk_1E0AFFA38;
v12[4] = a1;
return objc_msgSend(MEMORY[0x1E0600D18], "animateWithDuration:animations:", v12, 0.300000012);
}
else
{
v10 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "contentView")), "addSubview:", a1[126]);
MEMORY[0x19303E0B0](v10);
v11 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "contentView")), "sendSubviewToBack:", a1[126]);
MEMORY[0x19303E0B0](v11);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
return objc_msgSend(a1, "setNeedsLayout");
}
}
return result;
}
uint64_t __65__CKTranscriptBalloonCell__addQuickActionButtonIfNeededAnimated___block_invoke(uint64_t a1)
{
return objc_msgSend(*(id *)(*(_QWORD *)(a1 + 32) + 1008LL), "setAlpha:", 1.0);
}
- (uint64_t)setCanShowQuickActionButton:(int)a3
{
uint64_t result;
uint64_t vars8;
result = objc_msgSend(a1, "isInReplyContext");
if ((result & 1) == 0 && (unsigned __int8)a1[934] != a3)
{
a1[934] = a3;
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
return objc_msgSend(a1, "updateQuickActionButtonVisibility");
}
return result;
}
- (void)setSyndicationIdentifiers:(void *)a3
{
uint64_t vars8;
if (a1[121] != (id)MEMORY[0x19303E200]())
{
objc_storeStrong(a1 + 121, a3);
objc_msgSend(a1, "updateQuickActionButtonVisibility");
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E070LL);
}
- (uint64_t)updateQuickActionButtonVisibility
{
_BOOL4 v2;
uint64_t result;
uint64_t v4;
uint64_t v5;
uint64_t v6;
void *v7;
uint64_t v8;
uint64_t v9;
uint64_t v10;
uint64_t v11;
uint64_t v12;
char v13;
if (!(unsigned int)objc_msgSend(a1, "canShowQuickActionButton"))
return objc_msgSend(a1, "_removeQuickActionButtonIfNeededAnimated:", 1LL);
if ((objc_msgSend(a1, "isRichLink") & 1) != 0)
{
v2 = 1;
}
else
{
v13 = 0;
v4 = objc_msgSend(a1, "numberOfMomentSharePhotos");
v5 = objc_msgSend(a1, "numberOfMomentShareVideos") + v4;
if (v5)
{
if (objc_msgSend(a1, "numberOfMomentShareSavedAssets") == v5)
return objc_msgSend(a1, "_removeQuickActionButtonIfNeededAnimated:", 1LL);
return objc_msgSend(a1, "_addQuickActionButtonIfNeededAnimated:", 0LL);
}
objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E06285B0], "sharedInstance")), "registerPhotoLibraryPersistenceManagerListener:", a1);
v6 = objc_msgSend((id)MEMORY[0x19303DF20](objc_msgSend(a1, "syndicationIdentifiers")), "count");
MEMORY[0x19303E0C0]();
v7 = (void *)MEMORY[0x19303DF20](objc_msgSend(MEMORY[0x1E06285B0], "sharedInstance"));
v8 = objc_msgSend(MEMORY[0x1E05DC540], "setWithArray:", MEMORY[0x19303DF20](objc_msgSend(a1, "syndicationIdentifiers")));
v9 = objc_msgSend(v7, "cachedCountOfSyndicationIdentifiersSavedToSystemPhotoLibrary:shouldFetchAndNotifyAsNeeded:didStartFetch:", MEMORY[0x19303DF20](v8), 1LL, &v13);
v10 = MEMORY[0x19303E0E0]();
v11 = MEMORY[0x19303E0F0](v10);
v12 = MEMORY[0x19303E0C0](v11);
v2 = v9 != v6;
MEMORY[0x19303E0B0](v12);
if (!v13)
{
LABEL_10:
if (!v2)
return objc_msgSend(a1, "_removeQuickActionButtonIfNeededAnimated:", 1LL);
return objc_msgSend(a1, "_addQuickActionButtonIfNeededAnimated:", 0LL);
}
}
result = objc_msgSend(a1, "isRichLink");
if ((_DWORD)result)
goto LABEL_10;
return result;
}
- (uint64_t)quickActionButtonWasTapped:(void *)a1
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
uint64_t v8;
v2 = MEMORY[0x19303E1F0]();
v3 = MEMORY[0x19303DF20](objc_msgSend(a1, "quickActionButtonTappedCallback"));
MEMORY[0x19303E0C0]();
if (v3)
{
v4 = MEMORY[0x19303DF20](objc_msgSend(a1, "quickActionButtonTappedCallback"));
v5 = (*(uint64_t (**)(uint64_t, uint64_t))(v4 + 16))(v4, v2);
}
else
{
v6 = MEMORY[0x19303CA00]("CKTranscriptBalloonCell");
v7 = MEMORY[0x19303DF20](v6);
v5 = MEMORY[0x19303E3F0](v7, 16LL);
if ((_DWORD)v5)
v5 = -[CKTranscriptBalloonCell quickActionButtonWasTapped:].cold.1(v7);
}
v8 = MEMORY[0x19303E0B0](v5);
return MEMORY[0x19303E090](v8);
}
- (uint64_t)quickActionButtonAnimationDidEnd:(void *)a1
{
uint64_t result;
uint64_t vars8;
result = objc_msgSend(a1, "hasQueuedQuickActionButtonRemoval");
if ((_DWORD)result)
{
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
return objc_msgSend(a1, "_removeQuickActionButtonIfNeededAnimated:", 1LL);
}
return result;
}
- (void)textBalloonViewWillLayoutSubviews:(uint64_t)a1
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t vars8;
v4 = MEMORY[0x19303E1F0]();
v2 = MEMORY[0x19303DFE0](a1 + 952);
MEMORY[0x19303E0C0]();
if (v2)
{
v3 = objc_msgSend((id)MEMORY[0x19303DFE0](a1 + 952), "transcriptBalloonCell:willLayoutTextBalloonView:", a1, v4);
MEMORY[0x19303E0B0](v3);
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)textBalloonViewDidLayoutSubviews:(uint64_t)a1
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t vars8;
v4 = MEMORY[0x19303E1F0]();
v2 = MEMORY[0x19303DFE0](a1 + 952);
MEMORY[0x19303E0C0]();
if (v2)
{
v3 = objc_msgSend((id)MEMORY[0x19303DFE0](a1 + 952), "transcriptBalloonCell:didLayoutTextBalloonView:", a1, v4);
MEMORY[0x19303E0B0](v3);
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (uint64_t)textBalloonViewAllowedLayoutActionForTextBalloonView:(uint64_t)a1
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
v2 = MEMORY[0x19303E1F0]();
v3 = MEMORY[0x19303DFE0](a1 + 952);
v4 = MEMORY[0x19303E0D0]();
if (v3)
{
v5 = objc_msgSend((id)MEMORY[0x19303DFE0](a1 + 952), "transcriptBalloonCell:allowedLayoutActionForTextBalloonView:", a1, v2);
v4 = MEMORY[0x19303E0C0]();
}
else
{
v5 = 0LL;
}
MEMORY[0x19303E090](v4);
return v5;
}
- (void)textBalloonViewTextViewDidChangeRenderBounds:(uint64_t)a1
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t vars8;
v4 = MEMORY[0x19303E1F0]();
v2 = MEMORY[0x19303DFE0](a1 + 952);
MEMORY[0x19303E0C0]();
if (v2)
{
v3 = objc_msgSend((id)MEMORY[0x19303DFE0](a1 + 952), "transcriptBalloonCell:didChangeRenderBoundsOfTextBalloonView:", a1, v4);
MEMORY[0x19303E0B0](v3);
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (void)customTextRenderingDisplayLinkForTextBalloonViewTextView:(uint64_t)a1
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t vars8;
v2 = MEMORY[0x19303E1F0]();
v3 = MEMORY[0x19303DFE0](a1 + 952);
v4 = MEMORY[0x19303E0D0]();
if (v3)
{
v5 = objc_msgSend((id)MEMORY[0x19303DFE0](a1 + 952), "transcriptBalloonCell:customTextRenderingDisplayLinkForTextBalloonViewTextView:", a1, v2);
MEMORY[0x19303DF20](v5);
v4 = MEMORY[0x19303E0C0]();
}
MEMORY[0x19303E090](v4);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)textBalloonViewTextView:(uint64_t)a3 didChangeTextEffectPlaybackCandidateStatus:(uint64_t)a4
{
uint64_t v6;
uint64_t v7;
uint64_t v8;
uint64_t vars8;
v8 = MEMORY[0x19303E1F0]();
v6 = MEMORY[0x19303DFE0](a1 + 952);
MEMORY[0x19303E0D0]();
if (v6)
{
v7 = objc_msgSend((id)MEMORY[0x19303DFE0](a1 + 952), "transcriptBalloonCell:textBalloonView:didChangeTextEffectPlaybackCandidateStatus:", a1, v8, a4);
MEMORY[0x19303E0C0](v7);
}
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303E060LL);
}
- (uint64_t)balloonView
{
return *(_QWORD *)(a1 + 936);
}
- (void)balloonCellDelegate
{
uint64_t vars8;
MEMORY[0x19303DFE0](a1 + 944);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)setBalloonCellDelegate:
{
JUMPOUT(0x19303E340LL);
}
- (void)textEffectsDelegate
{
uint64_t vars8;
MEMORY[0x19303DFE0](a1 + 952);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
JUMPOUT(0x19303DF00LL);
}
- (void)setTextEffectsDelegate:
{
JUMPOUT(0x19303E340LL);
}
- (uint64_t)mayReparentPluginViews
{
return *(unsigned __int8 *)(a1 + 928);
}
- (uint64_t)setMayReparentPluginViews:(char)a3
{
*(_BYTE *)(result + 928) = a3;
return result;
}
- (uint64_t)isInsertingReply
{
return *(unsigned __int8 *)(a1 + 929);
}
- (uint64_t)setInsertingReply:(char)a3
{
*(_BYTE *)(result + 929) = a3;
return result;
}
- (uint64_t)lineType
{
return *(_QWORD *)(a1 + 960);
}
- (uint64_t)setLineType:(uint64_t)a3
{
*(_QWORD *)(result + 960) = a3;
return result;
}
- (uint64_t)lineIsExtended
{
return *(unsigned __int8 *)(a1 + 930);
}
- (uint64_t)animatingInDarkEffect
{
return *(unsigned __int8 *)(a1 + 931);
}
- (uint64_t)setAnimatingInDarkEffect:(char)a3
{
*(_BYTE *)(result + 931) = a3;
return result;
}
- (uint64_t)canInlineReply
{
return *(unsigned __int8 *)(a1 + 932);
}
- (uint64_t)setCanInlineReply:(char)a3
{
*(_BYTE *)(result + 932) = a3;
return result;
}
- (uint64_t)isRichLink
{
return *(unsigned __int8 *)(a1 + 933);
}
- (uint64_t)setIsRichLink:(char)a3
{
*(_BYTE *)(result + 933) = a3;
return result;
}
- (uint64_t)syndicationIdentifiers
{
return *(_QWORD *)(a1 + 968);
}
- (uint64_t)numberOfMomentShareSavedAssets
{
return *(_QWORD *)(a1 + 976);
}
- (uint64_t)setNumberOfMomentShareSavedAssets:(uint64_t)a3
{
*(_QWORD *)(result + 976) = a3;
return result;
}
- (uint64_t)numberOfMomentSharePhotos
{
return *(_QWORD *)(a1 + 984);
}
- (uint64_t)setNumberOfMomentSharePhotos:(uint64_t)a3
{
*(_QWORD *)(result + 984) = a3;
return result;
}
- (uint64_t)numberOfMomentShareVideos
{
return *(_QWORD *)(a1 + 992);
}
- (uint64_t)setNumberOfMomentShareVideos:(uint64_t)a3
{
*(_QWORD *)(result + 992) = a3;
return result;
}
- (uint64_t)canShowQuickActionButton
{
return *(unsigned __int8 *)(a1 + 934);
}
- (uint64_t)quickActionButtonTappedCallback
{
return *(_QWORD *)(a1 + 1000);
}
- (void)setQuickActionButtonTappedCallback:(void *)a3
{
objc_setProperty_nonatomic_copy(a1, a2, a3, 1000LL);
}
- (uint64_t)quickActionButton
{
return *(_QWORD *)(a1 + 1008);
}
- (uint64_t)layoutAttributes
{
return *(_QWORD *)(a1 + 1016);
}
- (void)setLayoutAttributes:(void *)a3
{
objc_setProperty_nonatomic_copy(a1, a2, a3, 1016LL);
}
- (uint64_t)threadGroupLayoutAttributes
{
return *(_QWORD *)(a1 + 1024);
}
- (uint64_t)threadLineDescription
{
return *(_QWORD *)(a1 + 1032);
}
- (void)setThreadLineDescription:(void *)a3
{
objc_setProperty_nonatomic_copy(a1, a2, a3, 1032LL);
}
- (uint64_t)lineView
{
return *(_QWORD *)(a1 + 1040);
}
- (void)setLineView:(id)obj
{
objc_storeStrong((id *)(a1 + 1040), obj);
}
- (double)lineHorizontalOffset
{
return *(double *)(a1 + 1048);
}
- (uint64_t)setLineHorizontalOffset:(uint64_t)result
{
*(double *)(result + 1048) = a2;
return result;
}
- (double)lineViewReferenceY
{
return *(double *)(a1 + 1056);
}
- (uint64_t)setLineViewReferenceY:(uint64_t)result
{
*(double *)(result + 1056) = a2;
return result;
}
- (double)lineViewExpansionFactor
{
return *(double *)(a1 + 1064);
}
- (uint64_t)setLineViewExpansionFactor:(uint64_t)result
{
*(double *)(result + 1064) = a2;
return result;
}
- (uint64_t)hasQueuedQuickActionButtonRemoval
{
return *(unsigned __int8 *)(a1 + 935);
}
- (uint64_t)setHasQueuedQuickActionButtonRemoval:(char)a3
{
*(_BYTE *)(result + 935) = a3;
return result;
}
- (void)setBalloonSwipeController:(id)obj
{
objc_storeStrong((id *)(a1 + 1072), obj);
}
- (void).cxx_destruct
{
uint64_t vars8;
objc_storeStrong(a1 + 134, 0LL);
objc_storeStrong(a1 + 130, 0LL);
objc_storeStrong(a1 + 129, 0LL);
objc_storeStrong(a1 + 128, 0LL);
objc_storeStrong(a1 + 127, 0LL);
objc_storeStrong(a1 + 126, 0LL);
objc_storeStrong(a1 + 125, 0LL);
objc_storeStrong(a1 + 121, 0LL);
MEMORY[0x19303DF50](a1 + 119);
MEMORY[0x19303DF50](a1 + 118);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
objc_storeStrong(a1 + 117, 0LL);
}
uint64_t __110__CKTranscriptBalloonCell_CKChatItem__configureForChatItem_context_animated_animationDuration_animationCurve___block_invoke(uint64_t a1)
{
uint64_t result;
void *v3;
uint64_t vars8;
objc_msgSend(*(id *)(a1 + 32), "setFrame:", *(double *)(a1 + 48), *(double *)(a1 + 56), *(double *)(a1 + 64), *(double *)(a1 + 72));
result = objc_msgSend(*(id *)(a1 + 40), "setNeedsLayout");
if (*(_BYTE *)(a1 + 80))
{
v3 = *(void **)(a1 + 40);
if (((vars8 ^ (2 * vars8)) & 0x4000000000000000LL) != 0)
__break(0xC471u);
return objc_msgSend(v3, "layoutIfNeeded");
}
return result;
}
- (uint64_t)quickActionButtonWasTapped:(uint64_t)a1 .cold.1(uint64_t a1)
{
_WORD v2[8];
v2[0] = 0;
return MEMORY[0x19303D930](&dword_18EEC5000, a1, 16LL, "Received quick save button tapped delegate callback, but quickActionButtonTappedCallback wasn't set on the cell.", v2, 2LL);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment