// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/src/components/common/log.cc
// Function: scdc_log::init(char const*, _scdc_args_t*)
bool scdc_log::init(const char *conf, scdc_args_t *args)
{
  SCDC_TRACE("init: conf: '" << conf << "'");

  ostream *scdc_cout = 0;
  ostream *scdc_cerr = 0;

  if (!conf)
  {
    SCDC_FAIL("init: no config given");
    return false;
  }

  string c(conf);
  scdc_args xargs(*args);

  if (c == "log_handler")
  {
    scdc_log_handler_args_t outhandler, errhandler;

    if (!xargs.get<scdc_log_handler_args_t>(SCDC_ARGS_TYPE_LOG_HANDLER, &outhandler))
    {
      SCDC_FAIL("init: no output log handler given");
      return false;
    }

    if (!xargs.get<scdc_log_handler_args_t>(SCDC_ARGS_TYPE_LOG_HANDLER, &errhandler))
    {
      SCDC_FAIL("init: no error log handler given");
      return false;
    }

    scdc_cout = new ostream_log_handler(&outhandler);
    scdc_cerr = new ostream_log_handler(&errhandler);

  } else if (c == "log_FILE")
  {
    FILE *outfile = 0, *errfile = 0;

    if (!xargs.get<FILE *>(SCDC_ARGS_TYPE_OUT_STREAM, &outfile))
    {
      SCDC_FAIL("init: no output FILE given");
      return false;
    }

    if (!xargs.get<FILE *>(SCDC_ARGS_TYPE_OUT_STREAM, &errfile))
    {
      SCDC_FAIL("init: no error FILE given");
      return false;
    }

    scdc_cout = new ostream_FILE(outfile);
    scdc_cerr = new ostream_FILE(errfile);

  } else if (c == "log_filepath")
  {
    const char *filepath;

    if (!xargs.get<const char *>(SCDC_ARGS_TYPE_CSTR, &filepath))
    {
      SCDC_FAIL("init: no filepath given");
      return false;
    }

    scdc_cout = new ofstream((string(filepath) + ".out").c_str());
    scdc_cerr = new ofstream((string(filepath) + ".err").c_str());

  } else
  {
    SCDC_FAIL("init: unknown log type '" << c << "'");
    return false;
  }

  set_cout(scdc_cout);
  set_cerr(scdc_cerr);

  SCDC_TRACE("init: return");

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
testq %rsi, %rsi
je 0x31981
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rsi, %rdi
callq 0xb200
leaq (%rax,%r15), %rdx
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x1bee6
leaq 0x90(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movaps %xmm0, -0x20(%rax)
movaps %xmm1, -0x10(%rax)
leaq 0x39fc7(%rip), %rsi     # 0x6b844
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x31a18
leaq 0x389a0(%rip), %rsi     # 0x6a234
leaq 0x50(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x31a39
leaq 0x3a01b(%rip), %rsi     # 0x6b8c8
leaq 0x50(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x31a8d
leaq 0x5acaa(%rip), %r14     # 0x8c570
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x31ea7
addq $0x20, %rdi
callq 0xb7d0
movq (%r14), %rax
movq 0x8(%rax), %rbx
leaq 0x3889d(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x39f29(%rip), %rsi     # 0x6b828
movl $0x5, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x39fe4(%rip), %rsi     # 0x6b8f7
movl $0x18, %edx
movq %rbx, %rdi
callq 0xb5f0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %rbx, %rdi
callq 0xb5f0
movq %rax, %rbx
leaq 0x3aa1f(%rip), %rsi     # 0x6c35b
movl $0x1, %edx
movq %rax, %rdi
callq 0xb5f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3b0
jmp 0x31ea7
leaq 0x5abe8(%rip), %r14     # 0x8c570
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x31a11
addq $0x20, %rdi
callq 0xb7d0
movq (%r14), %rax
movq 0x8(%rax), %rbx
leaq 0x387df(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x39e6b(%rip), %rsi     # 0x6b828
movl $0x5, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x39e5d(%rip), %rsi     # 0x6b82e
movl $0x15, %edx
movq %rbx, %rdi
callq 0xb5f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3b0
xorl %ebp, %ebp
jmp 0x3200d
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0x31ab4
movq 0x70(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movl $0x11, %esi
callq *%rax
jmp 0x31ab6
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %rax, 0x28(%rsp)
movq 0x78(%rsp), %rcx
testq %rcx, %rcx
je 0x31a60
movq 0x70(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movl $0x7, %esi
callq *%rcx
testq %rax, %rax
je 0x31b6c
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0x31d3a
movq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movl $0x7, %esi
callq *%rax
jmp 0x31d3c
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0x31cce
movq 0x70(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movl $0x4, %esi
callq *%rax
movq %rax, %r15
jmp 0x31cd1
xorl %eax, %eax
testq %rax, %rax
je 0x31adf
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0x31bf9
movq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movl $0x11, %esi
callq *%rax
jmp 0x31bfb
leaq 0x5aa8a(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x31e97
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x3867d(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x39d09(%rip), %rsi     # 0x6b828
movl $0x5, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x39d1d(%rip), %rsi     # 0x6b850
movl $0x21, %edx
movq %r14, %rdi
callq 0xb5f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
jmp 0x31e8b
leaq 0x5a9fd(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x31e97
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x385f0(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x39c7c(%rip), %rsi     # 0x6b828
movl $0x5, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x39cd3(%rip), %rsi     # 0x6b893
movl $0x1a, %edx
movq %r14, %rdi
callq 0xb5f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
jmp 0x31e8b
xorl %eax, %eax
testq %rax, %rax
je 0x31c41
movl $0x178, %edi            # imm = 0x178
callq 0xb500
movq %rax, %r14
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x32618
movl $0x178, %edi            # imm = 0x178
callq 0xb500
movq %rax, %r12
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x32618
addq $0x68, %r14
addq $0x68, %r12
jmp 0x31d81
leaq 0x5a928(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x31e97
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x3851b(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x39ba7(%rip), %rsi     # 0x6b828
movl $0x5, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x39bdd(%rip), %rsi     # 0x6b872
movl $0x20, %edx
movq %r14, %rdi
callq 0xb5f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
jmp 0x31e8b
xorl %r15d, %r15d
testq %r15, %r15
je 0x31d88
movl $0x200, %edi            # imm = 0x200
callq 0xb500
movq %rax, %r14
movq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1bdd6
leaq 0x39beb(%rip), %rsi     # 0x6b8ed
leaq 0x28(%rsp), %rdi
callq 0xba60
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x31eae
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x31eb5
xorl %eax, %eax
testq %rax, %rax
je 0x31e07
movl $0x170, %edi            # imm = 0x170
callq 0xb500
movq %rax, %r14
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x326f0
movl $0x170, %edi            # imm = 0x170
callq 0xb500
movq %rax, %r12
movq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x326f0
addq $0x60, %r14
addq $0x60, %r12
movb $0x1, %al
jmp 0x31e9f
leaq 0x5a7e1(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x31dfc
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x8(%rax), %r14
leaq 0x383d6(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x39a62(%rip), %rsi     # 0x6b828
movl $0x5, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x39afb(%rip), %rsi     # 0x6b8d5
movl $0x17, %edx
movq %r14, %rdi
callq 0xb5f0
movq %r14, %rdi
callq 0xb250
movq (%r12), %rdi
addq $0x20, %rdi
callq 0xb3b0
xorl %r14d, %r14d
xorl %r12d, %r12d
jmp 0x31fc5
leaq 0x5a762(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x31e97
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x38359(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x399e5(%rip), %rsi     # 0x6b828
movl $0x5, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x39a57(%rip), %rsi     # 0x6b8ae
movl $0x19, %edx
movq %r14, %rdi
callq 0xb5f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%r15), %rdi
addq $0x20, %rdi
callq 0xb3b0
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %eax, %eax
testb %al, %al
jne 0x31fce
xorl %ebp, %ebp
jmp 0x31fe7
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
movl $0x10, %edx
callq 0xb590
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x31ef6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x38(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x31f11
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movl $0x200, %edi            # imm = 0x200
callq 0xb500
movq %rax, %r12
movq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1bdd6
leaq 0x399b9(%rip), %rsi     # 0x6b8f2
leaq 0x28(%rsp), %rdi
callq 0xba60
movq %rbp, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x31f66
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x31f6d
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq %r12, %rdi
movl $0x10, %edx
callq 0xb590
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x31fae
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x31fc5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
testq %r15, %r15
je 0x31ea7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32198
movb $0x1, %bpl
movq %rbx, %rdi
movq %r12, %rsi
callq 0x321d0
leaq 0x70(%rsp), %rdi
callq 0x1b820
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3200d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xb510
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x32040
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x32040
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x3205c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x3205c
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
jmp 0x320c5
movq %rax, %rbx
movl $0x170, %esi            # imm = 0x170
jmp 0x320c5
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3208c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x3208c
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x320b6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x320b6
movq %rax, %rbx
movl $0x170, %esi            # imm = 0x170
jmp 0x320d2
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
jmp 0x320d2
movq %rax, %rbx
movl $0x178, %esi            # imm = 0x178
movq %r12, %rdi
jmp 0x320d5
movq %rax, %rbx
movl $0x178, %esi            # imm = 0x178
movq %r14, %rdi
callq 0xb510
jmp 0x320e5
jmp 0x320e2
jmp 0x320e2
jmp 0x320e2
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x1b820
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3210b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0
nop