+ size_t normal((size + 0x1000 - 1) / 0x1000);
+ alloc = Align(alloc + (special + normal) * 0x14, 16);
+
+ offset = Align(offset, 4096);
+ allocations.push_back(CodesignAllocation(mach_header, offset, size, alloc));
+ offset += size + alloc;
+ }
+ }
+
+ asprintf(&temp, "%s.%s.cs", dir, base);
+ fclose(fopen(temp, "w+"));
+ truncate(temp, offset);
+
+ void *file(map(temp, 0, offset, NULL, false));
+ memset(file, 0, offset);
+
+ fat_arch *fat_arch;
+ if (!source.IsFat())
+ fat_arch = NULL;
+ else {
+ auto *fat_header(reinterpret_cast<struct fat_header *>(file));
+ fat_header->magic = Swap(FAT_MAGIC);
+ fat_header->nfat_arch = Swap(source.Swap(source->nfat_arch));
+ fat_arch = reinterpret_cast<struct fat_arch *>(fat_header + 1);
+ }