// File: /workspace/github_cpp_makefile_star2_O1/establishment[P]sandman/src/rules.hpp
// Function: Rules::DiskQuota::applyQuota()
void applyQuota() {
            if (!blockQuota)
                return; // no disk quota set

            char cwd[PATH_MAX];
            if (!getcwd(cwd, sizeof(cwd)))
                Die("getcwd: %m");

            char* dev = findDevice(cwd);
            if (!dev)
                Die("Cannot identify filesystem which contains %s", cwd);
            Msg("Quota: std::mapped path %s to a filesystem on %s\n", cwd, dev);

            // Sanity check
            struct stat devStat, cwdStat;
            if (stat(dev, &devStat) < 0)
                Die("Cannot identify block device %s: %m", dev);
            if (!S_ISBLK(devStat.st_mode))
                Die("Expected that %s is a block device", dev);
            if (stat(".", &cwdStat) < 0)
                Die("Cannot stat cwd: %m");
            if (cwdStat.st_dev != devStat.st_rdev)
                Die("Identified %s as a filesystem on %s, but it is obviously false", cwd, dev);

            // Set disk quotas
            struct dqblk dq;
            bzero(&dq, sizeof(dq));
            dq.dqb_bhardlimit = blockQuota;    /* absolute limit on disk quota blocks alloc */
            dq.dqb_bsoftlimit = blockQuota;    /* preferred limit on disk quota blocks */
            dq.dqb_ihardlimit = inodeQuota;    /* maximum number of allocated inodes */
            dq.dqb_isoftlimit = inodeQuota;    /* preferred inode limit */
            dq.dqb_valid = QIF_LIMITS;          /* limit blocks and inodes */

            // Apply disk quotas
            if (quotactl(QCMD(Q_SETQUOTA, USRQUOTA), dev, processUid, (caddr_t)&dq) < 0)
                Die("Cannot set disk quota: %m");

            Msg("Quota: Set block quota %d and inode quota %d\n", blockQuota, inodeQuota);
            free(dev);
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1170, %rsp           # imm = 0x1170
cmpl $0x0, 0x4(%rdi)
je 0x46e67
movq %rdi, %r14
leaq 0x170(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x27230
testq %rax, %rax
je 0x46e74
leaq 0x170(%rsp), %rdi
callq 0x46ed8
testq %rax, %rax
je 0x46e7d
movq %rax, %rbx
leaq 0xfa19(%rip), %rdi      # 0x567a9
leaq 0x170(%rsp), %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2cfe4
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x273f0
testl %eax, %eax
js 0x46e8e
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x6000, %eax           # imm = 0x6000
jne 0x46e97
leaq 0xf5c1(%rip), %rdi      # 0x56393
leaq 0xe0(%rsp), %rsi
callq 0x273f0
testl %eax, %eax
js 0x46ea8
movq 0xe0(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x46eb1
leaq 0x98(%rsp), %r15
movl $0x48, %esi
movq %r15, %rdi
callq 0x27810
movslq 0x4(%r14), %rax
movq %rax, (%r15)
movq %rax, 0x8(%r15)
movslq 0x8(%r14), %rax
movq %rax, 0x18(%r15)
movq %rax, 0x20(%r15)
movl $0x5, 0x40(%r15)
movl (%r14), %edx
movl $0x80000800, %edi       # imm = 0x80000800
movq %rbx, %rsi
movq %r15, %rcx
callq 0x27510
testl %eax, %eax
js 0x46eca
movl 0x4(%r14), %esi
movl 0x8(%r14), %edx
leaq 0xfa37(%rip), %rdi      # 0x5688f
xorl %eax, %eax
callq 0x2cfe4
movq %rbx, %rdi
callq 0x27560
addq $0x1170, %rsp           # imm = 0x1170
popq %rbx
popq %r14
popq %r15
retq
leaq 0xf8f6(%rip), %rdi      # 0x56771
jmp 0x46ed1
leaq 0xf8f8(%rip), %rdi      # 0x5677c
leaq 0x170(%rsp), %rsi
jmp 0x46ea1
leaq 0xf946(%rip), %rdi      # 0x567db
jmp 0x46e9e
leaq 0xf961(%rip), %rdi      # 0x567ff
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2ce45
leaq 0xf973(%rip), %rdi      # 0x56822
jmp 0x46ed1
leaq 0xf97e(%rip), %rdi      # 0x56836
leaq 0x170(%rsp), %rsi
movl $0x1, %edx
callq 0x2c889
leaq 0xf9a4(%rip), %rdi      # 0x56875
xorl %eax, %eax
callq 0x2ce45