// File: /workspace/github_cpp_makefile_star2_O3/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 0xed4e(%rip), %rdi      # 0x1adb5
callq 0x64d0
leaq 0xe199(%rip), %rdx      # 0x1a20c
leaq 0xed4b(%rip), %r8       # 0x1adc5
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 0x7172
leaq 0x80(%rsp), %rdi
leaq 0x288(%rsp), %rsi
movl $0x8, %edx
callq 0x6660
movq 0x288(%rsp), %rdi
cmpq %r13, %rdi
je 0xc0fa
movq 0x298(%rsp), %rsi
incq %rsi
callq 0x63a0
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
movl 0xa0(%rsp,%rax), %eax
testb $0x5, %al
je 0xc222
leaq 0xeca4(%rip), %rdi      # 0x1adc0
callq 0x64d0
leaq 0xe0e4(%rip), %rdx      # 0x1a20c
leaq 0xec96(%rip), %r8       # 0x1adc5
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 0x7172
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 0xc1bd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x63a0
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
movl 0xa0(%rsp,%rax), %eax
testb $0x5, %al
je 0xc222
leaq 0xebfa(%rip), %rsi      # 0x1add5
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
movl 0xa0(%rsp,%rax), %eax
testb $0x5, %al
jne 0xc238
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xb038
leaq 0x20(%rsp), %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0xbccd
leaq 0x80(%rsp), %rdi
callq 0x60c0
leaq 0x20(%rsp), %rdi
callq 0x93d0
movzbl %ah, %ebp
leaq 0x38(%rsp), %rbx
movq 0x18(%rbx), %rdi
cmpq %r12, %rdi
je 0xc27c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x63a0
movq %rbx, %rdi
callq 0xc5cc
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 0xc322
jmp 0xc31c
movq %rdx, %r14
movq %rax, %r15
leaq 0x288(%rsp), %rdi
callq 0x60c0
jmp 0xc2ca
movq %rdx, %r14
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xc322
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x63a0
jmp 0xc322
jmp 0xc31c
movq %rdx, %r14
movq %rax, %r15
jmp 0xc3c5
movq %rdx, %r14
movq %rax, %r15
movq 0x288(%rsp), %rdi
cmpq %r13, %rdi
je 0xc32f
movq 0x298(%rsp), %rsi
incq %rsi
callq 0x63a0
jmp 0xc32f
movq %rdx, %r14
movq %rax, %r15
jmp 0xc32f
movq %rdx, %r14
movq %rax, %r15
leaq 0x80(%rsp), %rdi
callq 0x60c0
cmpl $0x3, %r14d
jne 0xc3c5
movq %r15, %rdi
callq 0x6160
movq %rax, %r14
movq (%rbx), %rsi
movq 0x18c9a(%rip), %rdi     # 0x24fe8
callq 0x6360
movq %rax, %r15
leaq 0xe4b1(%rip), %rsi      # 0x1a80e
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 0x18c53(%rip), %rdi     # 0x24fe8
leaq 0xe5cf(%rip), %rsi      # 0x1a96b
movl $0x3c7, %edx            # imm = 0x3C7
callq 0x6460
movl $0x1, %ebp
callq 0x6690
jmp 0xc261
jmp 0xc2e4
movq %rdx, %r14
movq %rax, %r15
callq 0x6690
leaq 0x20(%rsp), %rdi
callq 0xc5a2
movq %r15, %rdi
callq 0x6160
movq (%rbx), %rsi
cmpl $0x2, %r14d
jne 0xc430
movq %rax, %r15
movq 0x18bfe(%rip), %rdi     # 0x24fe8
callq 0x6360
movq %rax, %rbx
leaq 0xe415(%rip), %rsi      # 0x1a80e
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 0xe9db(%rip), %rsi      # 0x1adfc
movl $0xa, %edx
movq %rax, %rdi
callq 0x6460
jmp 0xc450
movq 0x18bb1(%rip), %rdi     # 0x24fe8
callq 0x6360
leaq 0xe9a6(%rip), %rsi      # 0x1ade9
movl $0x1d, %edx
movq %rax, %rdi
callq 0x6460
callq 0x6690
movl $0x1, %ebp
jmp 0xc284
movq %rax, %rbx
callq 0x6690
jmp 0xc471
movq %rax, %rbx
callq 0x6690
movq %rbx, %rdi
callq 0x6700
movq %rax, %rdi
callq 0x89bb
nop