// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Main.cpp
// Function: AssignOptionValue(char*, OptionTemplate const*, char const*, bool)
static int AssignOptionValue(char* option_base, const OptionTemplate* templ, const char* value, bool is_short)
{
  char* dest = option_base + templ->m_Offset;

  switch (templ->m_Type)
  {
    case OptionType::kBool:
      *(bool*)dest = true;
      return 1;

    case OptionType::kInt:
      if (value)
      {
        *(int*)dest = atoi(value);
        return is_short ? 2 : 1;
      }
      else
      {
        if (is_short)
          fprintf(stderr, "option requires an argument: %c\n", templ->m_ShortName);
        else
          fprintf(stderr, "option requires an argument: --%s\n", templ->m_LongName);
        return 0;
      }
      break;

    case OptionType::kString:
      if (value)
      {
        *(const char**)dest = value;
        return is_short ? 2 : 1;
      }
      else
      {
        if (is_short)
          fprintf(stderr, "option requires an argument: %c\n", templ->m_ShortName);
        else
          fprintf(stderr, "option requires an argument: --%s\n", templ->m_LongName);
        return 0;
      }
      break;

    default:
      return 0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x34(%rbp)
testl %eax, %eax
je 0x44c9
jmp 0x44ae
movl -0x34(%rbp), %eax
subl $0x1, %eax
je 0x44dc
jmp 0x44b8
movl -0x34(%rbp), %eax
subl $0x2, %eax
je 0x4562
jmp 0x45dc
movq -0x30(%rbp), %rax
movb $0x1, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x45e3
cmpq $0x0, -0x20(%rbp)
je 0x450f
movq -0x20(%rbp), %rdi
callq 0x3530
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movb -0x21(%rbp), %dl
movl $0x1, %eax
movl $0x2, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x45e3
testb $0x1, -0x21(%rbp)
je 0x4536
movq 0x2aab4(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movsbl (%rax), %edx
leaq 0x1f2ae(%rip), %rsi     # 0x237db
movb $0x0, %al
callq 0x3470
jmp 0x4556
movq 0x2aa93(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x1f2ad(%rip), %rsi     # 0x237fc
movb $0x0, %al
callq 0x3470
movl $0x0, -0x4(%rbp)
jmp 0x45e3
cmpq $0x0, -0x20(%rbp)
je 0x458c
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movb -0x21(%rbp), %dl
movl $0x1, %eax
movl $0x2, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x45e3
testb $0x1, -0x21(%rbp)
je 0x45b3
movq 0x2aa37(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movsbl (%rax), %edx
leaq 0x1f231(%rip), %rsi     # 0x237db
movb $0x0, %al
callq 0x3470
jmp 0x45d3
movq 0x2aa16(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x1f230(%rip), %rsi     # 0x237fc
movb $0x0, %al
callq 0x3470
movl $0x0, -0x4(%rbp)
jmp 0x45e3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)