// File: /workspace/github_cpp_makefile_star2_O1/adrianphoulady[P]weighted-tsetlin-machine-cpp/./utils.h
// Function: update(int, char* const*, int&, double&, int&, double&, int&, bool&, bool&, bool&)
void update(int argc, char * const argv[], int &clauses, double &p, int &threshold, double &gamma, int &epochs, bool &shuffle, bool &write, bool &resume) {
    int opt;
    static char *optarg = nullptr;
    while ((opt = getopt(argc, argv, "c:p:t:g:e:n:s:r:w:h", optarg)) != -1)
        switch (opt) {
            case 'h':
                printf("-c clauses\n-p p\n-t threshold\n-g gamma\n-e epochs\n-n new rand\n-s shuffle\n-r resume\n-w write\n");
                break;
            case 'c':
                clauses = atoi(optarg);
                break;
            case 'p':
                p = atof(optarg);
                break;
            case 't':
                threshold = atoi(optarg);
                break;
            case 'g':
                gamma = atof(optarg);
                break;
            case 'e':
                epochs = atoi(optarg);
                break;
            case 'n':
                fastsrand(strcmp(optarg, "0")? atoi(optarg): time(nullptr));
                break;
            case 's':
                shuffle = strcmp(optarg, "0") && strcasecmp(optarg, "false");
                break;
            case 'r':
                resume =  strcmp(optarg, "0") && strcasecmp(optarg, "false");
                break;
            case 'w':
                write =  strcmp(optarg, "0") && strcasecmp(optarg, "false");
        }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %r13
movl %edi, %ebp
leaq 0x2bf7(%rip), %rbx      # 0x5110
leaq 0x5cb0(%rip), %r14      # 0x81d0
leaq 0x2add(%rip), %r15      # 0x5004
movl %ebp, %edi
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x246c
movzbl %al, %eax
leal -0x63(%rax), %ecx
cmpl $0x14, %ecx
ja 0x26a8
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x5c7a(%rip), %rdi      # 0x81d0
callq 0x22a0
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x2527
movq 0x5c65(%rip), %r12      # 0x81d0
movq %r12, %rdi
leaq 0x2baf(%rip), %rsi      # 0x5124
callq 0x2250
testl %eax, %eax
je 0x26b5
movq %r12, %rdi
callq 0x22a0
cltq
jmp 0x26bc
movq 0x5c38(%rip), %r12      # 0x81d0
movq %r12, %rdi
leaq 0x2b82(%rip), %rsi      # 0x5124
callq 0x2250
testl %eax, %eax
je 0x26e3
movq %r12, %rdi
leaq 0x2b6d(%rip), %rsi      # 0x5126
callq 0x21f0
testl %eax, %eax
setne %al
jmp 0x26e5
movq 0x5c01(%rip), %rdi      # 0x81d0
callq 0x2210
movq 0x20(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x2527
leaq 0x2cea(%rip), %rdi      # 0x52d3
callq 0x2290
jmp 0x2527
movq 0x5bd6(%rip), %r12      # 0x81d0
movq %r12, %rdi
leaq 0x2b20(%rip), %rsi      # 0x5124
callq 0x2250
testl %eax, %eax
je 0x26f1
movq %r12, %rdi
leaq 0x2b0b(%rip), %rsi      # 0x5126
callq 0x21f0
testl %eax, %eax
setne %al
jmp 0x26f3
movq 0x5b9f(%rip), %rdi      # 0x81d0
callq 0x22a0
movq 0x60(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x2527
movq 0x5b87(%rip), %rdi      # 0x81d0
callq 0x2210
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x2527
movq 0x5b6d(%rip), %r12      # 0x81d0
movq %r12, %rdi
leaq 0x2ab7(%rip), %rsi      # 0x5124
callq 0x2250
testl %eax, %eax
je 0x26ff
movq %r12, %rdi
leaq 0x2aa2(%rip), %rsi      # 0x5126
callq 0x21f0
testl %eax, %eax
setne %al
jmp 0x2701
movq 0x5b39(%rip), %rdi      # 0x81d0
callq 0x22a0
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x2527
cmpl $0xff, %eax
jne 0x2527
jmp 0x270d
xorl %edi, %edi
callq 0x21a0
movabsq $-0x4f5c17a566d501a6, %rcx # imm = 0xB0A3E85A992AFE5A
imulq %rcx, %rax
movabsq $0x5851f42d4c957f2d, %rcx # imm = 0x5851F42D4C957F2D
addq %rcx, %rax
movq %rax, 0x5ada(%rip)      # 0x81b8
jmp 0x2527
xorl %eax, %eax
movq 0x70(%rsp), %rcx
movb %al, (%rcx)
jmp 0x2527
xorl %eax, %eax
movq 0x68(%rsp), %rcx
movb %al, (%rcx)
jmp 0x2527
xorl %eax, %eax
movq 0x78(%rsp), %rcx
movb %al, (%rcx)
jmp 0x2527
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq