// File: /workspace/github_cpp_makefile_star2_O2/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 0x2c07(%rip), %rbx      # 0x50c0
leaq 0x5cf8(%rip), %r14      # 0x81b8
leaq 0x2b3d(%rip), %r12      # 0x5004
leaq 0x2c06(%rip), %r15      # 0x50d4
movl %ebp, %edi
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x240c
movzbl %al, %eax
leal -0x63(%rax), %ecx
cmpl $0x14, %ecx
ja 0x263c
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq 0x5cbb(%rip), %rdi      # 0x81b8
callq 0x2280
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x24ce
movq 0x5ca6(%rip), %rdi      # 0x81b8
cmpb $0x30, (%rdi)
jne 0x2521
cmpb $0x0, 0x1(%rdi)
je 0x2649
callq 0x2280
cltq
leaq 0x1(,%rax,2), %rax
movq %rax, 0x5c69(%rip)      # 0x81a0
callq 0x314c
jmp 0x24ce
movq 0x5c73(%rip), %rdi      # 0x81b8
cmpb $0x30, (%rdi)
jne 0x2554
cmpb $0x0, 0x1(%rdi)
je 0x2655
movq %r15, %rsi
callq 0x21e0
testl %eax, %eax
setne %al
movq 0x70(%rsp), %rcx
movb %al, (%rcx)
jmp 0x24ce
movq 0x5c44(%rip), %rdi      # 0x81b8
callq 0x2200
movq 0x20(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x24ce
leaq 0x2cc9(%rip), %rdi      # 0x5257
callq 0x2270
jmp 0x24ce
movq 0x5c19(%rip), %rdi      # 0x81b8
cmpb $0x30, (%rdi)
jne 0x25ae
cmpb $0x0, 0x1(%rdi)
je 0x265c
movq %r15, %rsi
callq 0x21e0
testl %eax, %eax
setne %al
movq 0x68(%rsp), %rcx
movb %al, (%rcx)
jmp 0x24ce
movq 0x5bea(%rip), %rdi      # 0x81b8
callq 0x2280
movq 0x60(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x24ce
movq 0x5bd2(%rip), %rdi      # 0x81b8
callq 0x2200
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x24ce
movq 0x5bb8(%rip), %rdi      # 0x81b8
cmpb $0x30, (%rdi)
jne 0x260b
cmpb $0x0, 0x1(%rdi)
je 0x2663
movq %r15, %rsi
callq 0x21e0
testl %eax, %eax
setne %al
movq 0x78(%rsp), %rcx
movb %al, (%rcx)
jmp 0x24ce
movq 0x5b8d(%rip), %rdi      # 0x81b8
callq 0x2280
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x24ce
cmpl $0xff, %eax
jne 0x24ce
jmp 0x2667
xorl %edi, %edi
callq 0x21a0
jmp 0x2528
xorl %eax, %eax
jmp 0x2561
xorl %eax, %eax
jmp 0x25bb
xorl %eax, %eax
jmp 0x2618
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq