// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/udc.c
// Function: udcNewCreateBitmapAndSparse
static void udcNewCreateBitmapAndSparse(struct udcFile *file, 
	bits64 remoteUpdate, bits64 remoteSize, bits32 version)
/* Create a new bitmap file around the given remoteUpdate time. */
{
int fd = mustOpenFd(file->bitmapFileName, O_WRONLY | O_CREAT | O_TRUNC);
bits32 sig = udcBitmapSig;
bits32 blockSize = udcBlockSize;
bits64 reserved64 = 0;
bits32 reserved32 = 0;
int blockCount = (remoteSize + udcBlockSize - 1)/udcBlockSize;
int bitmapSize = bitToByteSize(blockCount);

/* Write out fixed part of header. */
writeOneFd(fd, sig);
writeOneFd(fd, blockSize);
writeOneFd(fd, remoteUpdate);
writeOneFd(fd, remoteSize);
writeOneFd(fd, version);
writeOneFd(fd, reserved32);
writeOneFd(fd, reserved64);
writeOneFd(fd, reserved64);
writeOneFd(fd, reserved64);
writeOneFd(fd, reserved64);
long long offset = ourMustLseek(&file->ios.bit, fd, 0, SEEK_CUR);
if (offset != udcBitmapHeaderSize)
    errAbort("offset in fd=%d, f=%s is %lld, not expected udcBitmapHeaderSize %d",
	     fd, file->bitmapFileName, offset, udcBitmapHeaderSize);

/* Write out initial all-zero bitmap, using sparse-file method: write 0 to final address. */
unsigned char zero = 0;
ourMustLseek(&file->ios.bit, fd, bitmapSize-1, SEEK_CUR);
ourMustWrite(&file->ios.bit, fd, &zero, 1);

/* Clean up bitmap file and name. */
mustCloseFd(&fd);

/* Create an empty data file. */
fd = mustOpenFd(file->sparseFileName, O_WRONLY | O_CREAT | O_TRUNC);
mustCloseFd(&fd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movl $0x241, %esi            # imm = 0x241
callq 0x2fc90
movl %eax, -0x20(%rbp)
movl $0x4187e2f6, -0x24(%rbp) # imm = 0x4187E2F6
movl $0x2000, -0x28(%rbp)    # imm = 0x2000
movq $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rax
addq $0x2000, %rax           # imm = 0x2000
subq $0x1, %rax
shrq $0xd, %rax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
addl $0x7, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x3c(%rbp)
movl -0x20(%rbp), %edi
leaq -0x24(%rbp), %rsi
movl $0x4, %edx
callq 0x2fe40
movl -0x20(%rbp), %edi
leaq -0x28(%rbp), %rsi
movl $0x4, %edx
callq 0x2fe40
movl -0x20(%rbp), %edi
leaq -0x10(%rbp), %rsi
movl $0x8, %edx
callq 0x2fe40
movl -0x20(%rbp), %edi
leaq -0x18(%rbp), %rsi
movl $0x8, %edx
callq 0x2fe40
movl -0x20(%rbp), %edi
leaq -0x1c(%rbp), %rsi
movl $0x4, %edx
callq 0x2fe40
movl -0x20(%rbp), %edi
leaq -0x34(%rbp), %rsi
movl $0x4, %edx
callq 0x2fe40
movl -0x20(%rbp), %edi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x2fe40
movl -0x20(%rbp), %edi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x2fe40
movl -0x20(%rbp), %edi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x2fe40
movl -0x20(%rbp), %edi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x2fe40
movq -0x8(%rbp), %rdi
addq $0xb8, %rdi
movl -0x20(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x5e3b0
movq %rax, -0x48(%rbp)
cmpq $0x40, -0x48(%rbp)
je 0x5f993
movl -0x20(%rbp), %esi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdx
movq -0x48(%rbp), %rcx
leaq 0x7f89b(%rip), %rdi     # 0xdf221
movl $0x40, %r8d
movb $0x0, %al
callq 0x35d40
movb $0x0, -0x49(%rbp)
movq -0x8(%rbp), %rdi
addq $0xb8, %rdi
movl -0x20(%rbp), %esi
movl -0x3c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
movl $0x1, %ecx
callq 0x5e3b0
movq -0x8(%rbp), %rdi
addq $0xb8, %rdi
movl -0x20(%rbp), %esi
leaq -0x49(%rbp), %rdx
movl $0x1, %ecx
callq 0x5fa10
leaq -0x20(%rbp), %rdi
callq 0x2ff60
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movl $0x241, %esi            # imm = 0x241
callq 0x2fc90
movl %eax, -0x20(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x2ff60
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)