// File: /workspace/github_cpp_makefile_star2_O2/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 0x4e125
movq %rdi, %r14
leaq 0x170(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x37220
testq %rax, %rax
je 0x4e132
leaq 0x170(%rsp), %rdi
callq 0x4e194
testq %rax, %rax
je 0x4e13b
movq %rax, %rbx
leaq 0xe722(%rip), %rdi      # 0x5c776
leaq 0x170(%rsp), %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3b443
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x373e0
testl %eax, %eax
js 0x4e14c
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x6000, %eax           # imm = 0x6000
jne 0x4e155
leaq 0xe2ca(%rip), %rdi      # 0x5c360
leaq 0xe0(%rsp), %rsi
callq 0x373e0
testl %eax, %eax
js 0x4e166
movq 0xe0(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x4e16f
leaq 0x98(%rsp), %r15
pushq $0x48
popq %rsi
movq %r15, %rdi
callq 0x377d0
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 0x37500
testl %eax, %eax
js 0x4e186
movl 0x4(%r14), %esi
movl 0x8(%r14), %edx
leaq 0xe746(%rip), %rdi      # 0x5c85c
xorl %eax, %eax
callq 0x3b443
movq %rbx, %rdi
callq 0x37550
addq $0x1170, %rsp           # imm = 0x1170
popq %rbx
popq %r14
popq %r15
retq
leaq 0xe605(%rip), %rdi      # 0x5c73e
jmp 0x4e18d
leaq 0xe607(%rip), %rdi      # 0x5c749
leaq 0x170(%rsp), %rsi
jmp 0x4e15f
leaq 0xe655(%rip), %rdi      # 0x5c7a8
jmp 0x4e15c
leaq 0xe670(%rip), %rdi      # 0x5c7cc
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3b2a4
leaq 0xe682(%rip), %rdi      # 0x5c7ef
jmp 0x4e18d
leaq 0xe68d(%rip), %rdi      # 0x5c803
leaq 0x170(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x3af9f
leaq 0xe6b5(%rip), %rdi      # 0x5c842
xorl %eax, %eax
callq 0x3b2a4