// File: /workspace/github_c_makefile_star2_O0/panux[P]linit/src/linitctl.c
// Function: main
int main(int argc, char** argv) {
    if(argc < 2) {
        fprintf(stderr, "[FATAL] Insufficient arguments\n");
        return 1;
    }
    FILE* stream = connectToServer();
    if(strcmp(argv[1], "start") == 0) {
        cmd_start(argc - 2, argv + 2, stream);
    } else if(strcmp(argv[1], "stop") == 0) {
        cmd_stop(argc - 2, argv + 2, stream);
    } else if(strcmp(argv[1], "enable") == 0) {
        cmd_enable(argc - 2, argv + 2, stream);
    } else if(strcmp(argv[1], "disable") == 0) {
        cmd_disable(argc - 2, argv + 2, stream);
    } else if(strcmp(argv[1], "state") == 0) {
        cmd_state(argc - 2, argv + 2, stream);
    } else {
        fprintf(stderr, "[FATAL] Unrecognized subcommand: \"%s\"\n", argv[1]);
        return 1;
    }
    if(fclose(stream) != 0) {
        fprintf(stderr, "[FATAL] Failed to close stream: %s\n", strerror(errno));
        return 65;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x1cd0
movq 0x2345(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x4f0(%rip), %rsi       # 0x21ad
movb $0x0, %al
callq 0x10b0
movl $0x1, -0x4(%rbp)
jmp 0x1e5a
callq 0x1250
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x40d(%rip), %rsi       # 0x20f5
callq 0x10a0
cmpl $0x0, %eax
jne 0x1d0e
movl -0x8(%rbp), %edi
subl $0x2, %edi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movq -0x18(%rbp), %rdx
callq 0x1460
jmp 0x1e0d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x4b0(%rip), %rsi       # 0x21cd
callq 0x10a0
cmpl $0x0, %eax
jne 0x1d43
movl -0x8(%rbp), %edi
subl $0x2, %edi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movq -0x18(%rbp), %rdx
callq 0x18c0
jmp 0x1e0b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x44c(%rip), %rsi       # 0x219e
callq 0x10a0
cmpl $0x0, %eax
jne 0x1d78
movl -0x8(%rbp), %edi
subl $0x2, %edi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movq -0x18(%rbp), %rdx
callq 0x1bd0
jmp 0x1e09
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x41e(%rip), %rsi       # 0x21a5
callq 0x10a0
cmpl $0x0, %eax
jne 0x1daa
movl -0x8(%rbp), %edi
subl $0x2, %edi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movq -0x18(%rbp), %rdx
callq 0x1c30
jmp 0x1e07
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x419(%rip), %rsi       # 0x21d2
callq 0x10a0
cmpl $0x0, %eax
jne 0x1ddc
movl -0x8(%rbp), %edi
subl $0x2, %edi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movq -0x18(%rbp), %rdx
callq 0x1750
jmp 0x1e05
movq 0x2215(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x3e3(%rip), %rsi       # 0x21d8
movb $0x0, %al
callq 0x10b0
movl $0x1, -0x4(%rbp)
jmp 0x1e5a
jmp 0x1e07
jmp 0x1e09
jmp 0x1e0b
jmp 0x1e0d
movq -0x18(%rbp), %rdi
callq 0x1070
cmpl $0x0, %eax
je 0x1e53
movq 0x21d6(%rip), %rax      # 0x3ff8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
callq 0x1050
movl (%rax), %edi
callq 0x1110
movq -0x20(%rbp), %rdi
movq %rax, %rdx
leaq 0x3bc(%rip), %rsi       # 0x21ff
movb $0x0, %al
callq 0x10b0
movl $0x41, -0x4(%rbp)
jmp 0x1e5a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq