// File: /workspace/github_cpp_makefile_star2_O1/alex-courtis[P]xlayoutdisplay/main.cpp
// Function: main
int main(int argc, char **argv) {
    try {
        Settings settings;
        try {
            // file options
            ifstream ifs(resolveEnvPath("XDG_CONFIG_HOME", ".xlayoutdisplay"));
            if (!ifs)
                ifs = ifstream(resolveEnvPath("HOME", ".xlayoutdisplay"));
            if (!ifs)
                ifs = ifstream("/etc/xlayoutdisplay");
            if (ifs) {
                parseCfgFile(ifs, settings);
            }

            // command line options override
            parseArgs(argc, argv, settings);

        } catch (invalid_argument &e) {
            cerr << argv[0] << ": " << e.what() << endl << endl;
            usage(cerr);
            return EXIT_FAILURE;
        }

        // execute
        return WEXITSTATUS(layout(settings));
    } catch (const exception &e) {
        cerr << argv[0] << ": " << e.what() << ", exiting\n";
        return EXIT_FAILURE;
    } catch (...) {
        cerr << argv[0] << ": unknown exception, exiting\n";
        return EXIT_FAILURE;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1498, %rsp           # imm = 0x1498
movq %rsi, %rbx
movl %edi, %ebp
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %r12
movups %xmm0, -0x28(%r12)
xorl %eax, %eax
movq %rax, -0x18(%r12)
movaps %xmm0, -0x40(%r12)
movl $0x0, -0x31(%r12)
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
movb %al, 0x10(%r12)
movq %rax, 0x18(%r12)
leaq 0xecf9(%rip), %rdi      # 0x1ada5
callq 0x64d0
leaq 0xe154(%rip), %rdx      # 0x1a20c
leaq 0xecf6(%rip), %r8       # 0x1adb5
leaq 0x490(%rsp), %r14
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x6640
leaq 0x298(%rsp), %r13
movq %r13, -0x10(%r13)
movq %r14, %rdi
callq 0x6190
leaq (%rsp,%rax), %rdx
addq $0x490, %rdx            # imm = 0x490
leaq 0x288(%rsp), %rdi
movq %r14, %rsi
callq 0x715e
leaq 0x80(%rsp), %rdi
leaq 0x288(%rsp), %rsi
movl $0x8, %edx
callq 0x6660
movq 0x288(%rsp), %rdi
cmpq %r13, %rdi
je 0xc13f
movq 0x298(%rsp), %rsi
incq %rsi
callq 0x63a0
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xa0(%rsp,%rax)
je 0xc201
leaq 0xec50(%rip), %rdi      # 0x1adb0
callq 0x64d0
leaq 0xe0a0(%rip), %rdx      # 0x1a20c
leaq 0xec42(%rip), %r8       # 0x1adb5
leaq 0x490(%rsp), %r14
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x6640
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq %r14, %rdi
callq 0x6190
leaq (%rsp,%rax), %rdx
addq $0x490, %rdx            # imm = 0x490
movq %rsp, %rdi
movq %r14, %rsi
callq 0x715e
leaq 0x288(%rsp), %rdi
movq %rsp, %rsi
movl $0x8, %edx
callq 0x6660
leaq 0x80(%rsp), %rdi
leaq 0x288(%rsp), %rsi
callq 0x6670
leaq 0x288(%rsp), %rdi
callq 0x60c0
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xc201
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x63a0
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xa0(%rsp,%rax)
je 0xc252
leaq 0xeba7(%rip), %rsi      # 0x1adc5
leaq 0x490(%rsp), %rdi
movl $0x8, %edx
callq 0x6740
leaq 0x80(%rsp), %rdi
leaq 0x490(%rsp), %rsi
callq 0x6670
leaq 0x490(%rsp), %rdi
callq 0x60c0
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xa0(%rsp,%rax)
jne 0xc27a
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xb039
leaq 0x20(%rsp), %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0xbcfc
leaq 0x80(%rsp), %rdi
callq 0x60c0
leaq 0x20(%rsp), %rdi
callq 0x93e8
movzbl %ah, %ebp
leaq 0x38(%rsp), %rbx
movq 0x18(%rbx), %rdi
cmpq %r12, %rdi
je 0xc2be
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x63a0
movq %rbx, %rdi
callq 0xc60e
movl %ebp, %eax
addq $0x1498, %rsp           # imm = 0x1498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq %rax, %r15
leaq 0x490(%rsp), %rdi
callq 0x60c0
jmp 0xc364
movq %rdx, %r14
movq %rax, %r15
leaq 0x288(%rsp), %rdi
callq 0x60c0
jmp 0xc30c
jmp 0xc35e
movq %rdx, %r14
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xc364
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x63a0
jmp 0xc364
jmp 0xc35e
movq %rdx, %r14
movq %rax, %r15
jmp 0xc407
movq %rdx, %r14
movq %rax, %r15
movq 0x288(%rsp), %rdi
cmpq %r13, %rdi
je 0xc371
movq 0x298(%rsp), %rsi
incq %rsi
callq 0x63a0
jmp 0xc371
movq %rdx, %r14
movq %rax, %r15
jmp 0xc371
movq %rdx, %r14
movq %rax, %r15
leaq 0x80(%rsp), %rdi
callq 0x60c0
cmpl $0x3, %r14d
jne 0xc407
movq %r15, %rdi
callq 0x6160
movq %rax, %r14
movq (%rbx), %rsi
movq 0x18c58(%rip), %rdi     # 0x24fe8
callq 0x6360
movq %rax, %r15
leaq 0xe45f(%rip), %rsi      # 0x1a7fe
movl $0x2, %edx
movq %rax, %rdi
callq 0x6460
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x6360
movq %rax, %rdi
callq 0x61b0
movq %rax, %rdi
callq 0x61b0
movq 0x18c11(%rip), %rdi     # 0x24fe8
leaq 0xe57d(%rip), %rsi      # 0x1a95b
movl $0x3c7, %edx            # imm = 0x3C7
callq 0x6460
movl $0x1, %ebp
callq 0x6690
jmp 0xc2a3
jmp 0xc326
movq %rdx, %r14
movq %rax, %r15
callq 0x6690
leaq 0x20(%rsp), %rdi
callq 0xc5e4
movq %r15, %rdi
callq 0x6160
movq (%rbx), %rsi
cmpl $0x2, %r14d
jne 0xc472
movq %rax, %r15
movq 0x18bbc(%rip), %rdi     # 0x24fe8
callq 0x6360
movq %rax, %rbx
leaq 0xe3c3(%rip), %rsi      # 0x1a7fe
movl $0x2, %edx
movq %rax, %rdi
callq 0x6460
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6360
leaq 0xe989(%rip), %rsi      # 0x1adec
movl $0xa, %edx
movq %rax, %rdi
callq 0x6460
jmp 0xc492
movq 0x18b6f(%rip), %rdi     # 0x24fe8
callq 0x6360
leaq 0xe954(%rip), %rsi      # 0x1add9
movl $0x1d, %edx
movq %rax, %rdi
callq 0x6460
callq 0x6690
movl $0x1, %ebp
jmp 0xc2c6
movq %rax, %rbx
callq 0x6690
jmp 0xc4b3
movq %rax, %rbx
callq 0x6690
movq %rbx, %rdi
callq 0x6700
movq %rax, %rdi
callq 0x89bb
nop