// File: /workspace/github_cpp_makefile_star2_O3/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 0x4680f
movq %rdi, %r14
leaq 0x170(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x27230
testq %rax, %rax
je 0x4681c
leaq 0x170(%rsp), %rdi
callq 0x46880
testq %rax, %rax
je 0x46825
movq %rax, %rbx
leaq 0x10071(%rip), %rdi     # 0x567a9
leaq 0x170(%rsp), %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2ceee
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x273f0
testl %eax, %eax
js 0x46836
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x6000, %eax           # imm = 0x6000
jne 0x4683f
leaq 0xfc19(%rip), %rdi      # 0x56393
leaq 0xe0(%rsp), %rsi
callq 0x273f0
testl %eax, %eax
js 0x46850
movq 0xe0(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x46859
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 0x46872
movl 0x4(%r14), %esi
movl 0x8(%r14), %edx
leaq 0x1008f(%rip), %rdi     # 0x5688f
xorl %eax, %eax
callq 0x2ceee
movq %rbx, %rdi
callq 0x27560
addq $0x1170, %rsp           # imm = 0x1170
popq %rbx
popq %r14
popq %r15
retq
leaq 0xff4e(%rip), %rdi      # 0x56771
jmp 0x46879
leaq 0xff50(%rip), %rdi      # 0x5677c
leaq 0x170(%rsp), %rsi
jmp 0x46849
leaq 0xff9e(%rip), %rdi      # 0x567db
jmp 0x46846
leaq 0xffb9(%rip), %rdi      # 0x567ff
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2cd4f
leaq 0xffcb(%rip), %rdi      # 0x56822
jmp 0x46879
leaq 0xffd6(%rip), %rdi      # 0x56836
leaq 0x170(%rsp), %rsi
movl $0x1, %edx
callq 0x2c78f
leaq 0xfffc(%rip), %rdi      # 0x56875
xorl %eax, %eax
callq 0x2cd4f