Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[MXMetricManager _checkAndDeliverMetricReports]
/* @class MXMetricManager */
-(void)_checkAndDeliverMetricReports {
var_168 = self;
var_30 = **___stack_chk_guard;
r15 = [[NSFileManager defaultManager] retain];
rax = NSSearchPathForDirectoriesInDomains(0x5, 0x1, 0x1);
rax = [rax retain];
var_1B8 = rax;
rax = [rax objectAtIndex:0x0];
rax = [rax retain];
r12 = rax;
rax = [rax stringByAppendingPathComponent:@"Caches/MetricKit/Reports"];
rax = [rax retain];
r13 = rax;
var_1F0 = 0x0;
rax = [r15 contentsOfDirectoryAtPath:rax error:&var_1F0];
var_198 = [rax retain];
rax = [var_1F0 retain];
r14 = rax;
if (rax == 0x0) {
var_150 = [[NSMutableArray alloc] init];
*(int128_t *)(&var_270 + 0x30) = intrinsic_movaps(*(int128_t *)(&var_270 + 0x30), 0x0);
*(int128_t *)(&var_270 + 0x20) = intrinsic_movaps(*(int128_t *)(&var_270 + 0x20), 0x0);
*(int128_t *)(&var_270 + 0x10) = intrinsic_movaps(*(int128_t *)(&var_270 + 0x10), 0x0);
var_270 = intrinsic_movaps(var_270, 0x0);
rax = [var_198 retain];
var_180 = rax;
rax = [rax countByEnumeratingWithState:&var_270 objects:&var_B0 count:0x10];
var_1A0 = rax;
var_160 = r12;
var_178 = r15;
var_190 = r13;
if (rax != 0x0) {
rbx = *_objc_msgSend;
var_1D0 = **(&var_270 + 0x10);
var_148 = 0x0;
do {
r14 = 0x0;
do {
if (*var_260 != var_1D0) {
objc_enumerationMutation(var_180);
}
r15 = *(var_268 + r14 * 0x8);
rax = (rbx)(var_168, @selector(managerLogHandle));
rax = [rax retain];
rbx = rax;
if (os_log_type_enabled(rax, 0x0) != 0x0) {
var_C0 = 0x8400102;
rax = _os_log_impl(rip - 0x8f09, rbx, 0x0, "Metric report: %@", &var_C0, 0xc);
}
[rbx release];
rdi = r13;
var_188 = r15;
r13 = *_objc_msgSend;
rax = [rdi stringByAppendingPathComponent:r15];
rax = [rax retain];
r15 = [[var_178 contentsAtPath:rax] retain];
[rax release];
rax = [MXMetricPayload class];
rbx = r13;
rsi = @selector(unarchivedObjectOfClass:fromData:error:);
rdx = rax;
var_170 = r15;
rcx = r15;
r13 = [_objc_msgSend_e040(@class(NSKeyedUnarchiver), rsi) retain];
r15 = [var_148 retain];
[var_148 release];
if ((r13 != 0x0) && (r15 == 0x0)) {
(rbx)(var_150, @selector(addObject:), r13);
rax = (rbx)(var_190, @selector(stringByAppendingPathComponent:), var_188);
rax = [rax retain];
var_1A8 = 0x0;
rsi = @selector(removeItemAtPath:error:);
rdx = rax;
rcx = &var_1A8;
(*_objc_msgSend)(var_178, rsi);
var_148 = [var_1A8 retain];
rdi = r15;
r15 = *_objc_release;
[rdi release];
rbx = *_objc_msgSend;
[rax release];
r12 = var_160;
}
else {
if (r15 != 0x0) {
rax = (rbx)(var_168, @selector(managerLogHandle));
rax = [rax retain];
rbx = rax;
rsi = 0x10;
r12 = var_160;
if (os_log_type_enabled(rax, rsi) != 0x0) {
var_C0 = 0x8400102;
rsi = rbx;
rdx = 0x10;
rcx = "Error while processing metric data on disk: %@";
rax = _os_log_error_impl(rip - 0x8e78, rsi, rdx, rcx, &var_C0, 0xc);
}
rdi = rbx;
rbx = *_objc_release;
[rdi release];
var_148 = r15;
r15 = rbx;
rbx = *_objc_msgSend;
}
else {
var_148 = 0x0;
r12 = var_160;
r15 = *_objc_release;
}
}
(r15)(r13, rsi, rdx, rcx);
(r15)(var_170, rsi, rdx, rcx);
r14 = r14 + 0x1;
r15 = var_178;
r13 = var_190;
} while (r14 < var_1A0);
rax = (rbx)(var_180, @selector(countByEnumeratingWithState:objects:count:), &var_270, &var_B0, 0x10);
var_1A0 = rax;
} while (rax != 0x0);
}
else {
var_148 = 0x0;
}
[var_180 release];
rax = [var_150 count];
rcx = var_148;
if ((rcx == 0x0) && (rax != 0x0)) {
r13 = var_168;
rax = [r13 managerLogHandle];
rax = [rax retain];
rbx = rax;
if (os_log_type_enabled(rax, 0x0) != 0x0) {
var_C0 = 0x8400102;
*(&var_C0 + 0x4) = var_150;
_os_log_impl(rip - 0x9203, rbx, 0x0, "Delivering metric reports: %@", &var_C0, 0xc);
}
[rbx release];
rax = [r13 payloadsToAdd];
rax = [rax retain];
[rax addObjectsFromArray:var_150];
[rax release];
rax = [r13 payloadsToAdd];
rax = [rax retain];
rbx = rax;
rax = [rax copy];
rdi = *(r13 + 0x10);
*(r13 + 0x10) = rax;
[rdi release];
[rbx release];
*(int128_t *)(&var_230 + 0x30) = intrinsic_movaps(*(int128_t *)(&var_230 + 0x30), 0x0);
*(int128_t *)(&var_230 + 0x20) = intrinsic_movaps(*(int128_t *)(&var_230 + 0x20), 0x0);
*(int128_t *)(&var_230 + 0x10) = intrinsic_movaps(*(int128_t *)(&var_230 + 0x10), 0x0);
var_230 = intrinsic_movaps(var_230, 0x0);
rax = [*(r13 + 0x38) retain];
var_158 = rax;
rax = [rax countByEnumeratingWithState:&var_230 objects:&var_140 count:0x10];
var_170 = rax;
if (rax != 0x0) {
var_188 = **(&var_230 + 0x10);
do {
r15 = 0x0;
do {
if (*var_220 != var_188) {
objc_enumerationMutation(var_158);
}
rbx = *(var_228 + r15 * 0x8);
if ([rbx respondsToSelector:@selector(didReceiveMetricPayloads:)] != 0x0) {
[rbx didReceiveMetricPayloads:var_150];
}
r15 = r15 + 0x1;
} while (r15 < var_170);
rax = [var_158 countByEnumeratingWithState:&var_230 objects:&var_140 count:0x10];
var_170 = rax;
} while (rax != 0x0);
}
[var_158 release];
r15 = var_178;
r12 = var_160;
r13 = var_190;
}
else {
if (rcx != 0x0) {
rax = [var_168 managerLogHandle];
rax = [rax retain];
r14 = rax;
if (os_log_type_enabled(rax, 0x10) != 0x0) {
-[MXMetricManager _checkAndDeliverMetricReports].cold.1(var_148);
}
[r14 release];
}
}
[var_150 release];
r14 = var_148;
}
[var_198 release];
[r13 release];
[r12 release];
[var_1B8 release];
[r14 release];
[r15 release];
if (**___stack_chk_guard != var_30) {
__stack_chk_fail();
}
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.