// File: /workspace/github_cpp_makefile_star2_O3/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      # 0x5100
leaq 0x5cb8(%rip), %r14      # 0x81c8
leaq 0x2aed(%rip), %r12      # 0x5004
leaq 0x2bf6(%rip), %r15      # 0x5114
movl %ebp, %edi
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x245c
movzbl %al, %eax
leal -0x63(%rax), %ecx
cmpl $0x14, %ecx
ja 0x269a
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq 0x5c7b(%rip), %rdi      # 0x81c8
callq 0x2290
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x251e
movq 0x5c66(%rip), %rdi      # 0x81c8
cmpb $0x30, (%rdi)
jne 0x2571
cmpb $0x0, 0x1(%rdi)
je 0x26a7
callq 0x2290
cltq
movabsq $-0x4f5c17a566d501a6, %rcx # imm = 0xB0A3E85A992AFE5A
imulq %rcx, %rax
movabsq $0x5851f42d4c957f2d, %rcx # imm = 0x5851F42D4C957F2D
addq %rcx, %rax
movq %rax, 0x5c16(%rip)      # 0x81b0
jmp 0x251e
movq 0x5c25(%rip), %rdi      # 0x81c8
cmpb $0x30, (%rdi)
jne 0x25b2
cmpb $0x0, 0x1(%rdi)
je 0x26b3
movq %r15, %rsi
callq 0x21f0
testl %eax, %eax
setne %al
movq 0x70(%rsp), %rcx
movb %al, (%rcx)
jmp 0x251e
movq 0x5bf6(%rip), %rdi      # 0x81c8
callq 0x2210
movq 0x20(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x251e
leaq 0x2cd5(%rip), %rdi      # 0x52c1
callq 0x2280
jmp 0x251e
movq 0x5bcb(%rip), %rdi      # 0x81c8
cmpb $0x30, (%rdi)
jne 0x260c
cmpb $0x0, 0x1(%rdi)
je 0x26ba
movq %r15, %rsi
callq 0x21f0
testl %eax, %eax
setne %al
movq 0x68(%rsp), %rcx
movb %al, (%rcx)
jmp 0x251e
movq 0x5b9c(%rip), %rdi      # 0x81c8
callq 0x2290
movq 0x60(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x251e
movq 0x5b84(%rip), %rdi      # 0x81c8
callq 0x2210
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x251e
movq 0x5b6a(%rip), %rdi      # 0x81c8
cmpb $0x30, (%rdi)
jne 0x2669
cmpb $0x0, 0x1(%rdi)
je 0x26c1
movq %r15, %rsi
callq 0x21f0
testl %eax, %eax
setne %al
movq 0x78(%rsp), %rcx
movb %al, (%rcx)
jmp 0x251e
movq 0x5b3f(%rip), %rdi      # 0x81c8
callq 0x2290
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x251e
cmpl $0xff, %eax
jne 0x251e
jmp 0x26c5
xorl %edi, %edi
callq 0x21a0
jmp 0x2578
xorl %eax, %eax
jmp 0x25bf
xorl %eax, %eax
jmp 0x2619
xorl %eax, %eax
jmp 0x2676
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq