// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0xa8, %rsp
testq %rsi, %rsi
je 0x29f81
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x88(%rsp), %r15
leaq 0x50(%rsp), %rdx
movq %r15, %rdi
callq 0x1a132
leaq 0x70(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movaps %xmm0, -0x20(%rax)
movaps %xmm1, -0x10(%rax)
leaq 0x28910(%rip), %rsi     # 0x527f4
movq %r15, %rdi
callq 0x19be0
testb %al, %al
je 0x29fe7
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x2a09c
movq 0x50(%rsp), %rdi
pushq $0x11
popq %rsi
leaq 0x28(%rsp), %rdx
callq *%rax
testq %rax, %rax
je 0x2a09c
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x2a2c5
movq 0x50(%rsp), %rdi
pushq $0x11
popq %rsi
leaq 0x8(%rsp), %rdx
callq *%rax
testq %rax, %rax
je 0x2a2c5
movl $0x178, %edi            # imm = 0x178
callq 0xb540
movq %rax, %r14
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x2a98c
movl $0x178, %edi            # imm = 0x178
callq 0xb540
movq %rax, %r15
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x2a98c
addq $0x68, %r14
addq $0x68, %r15
jmp 0x2a1e0
leaq 0x4b5f8(%rip), %rbx     # 0x75580
movq (%rbx), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x29fe0
addq $0x20, %rdi
callq 0xb800
movq (%rbx), %rax
movq 0x8(%rax), %rdi
leaq 0x271df(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x28823(%rip), %rsi     # 0x527d8
movq %rax, %rdi
callq 0xb520
leaq 0x2881a(%rip), %rsi     # 0x527de
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
callq 0xb270
movq (%rbx), %rdi
addq $0x20, %rdi
callq 0xb3e0
xorl %ebp, %ebp
jmp 0x2a3fc
leaq 0x27246(%rip), %rsi     # 0x51234
leaq 0x88(%rsp), %rdi
callq 0x19be0
testb %al, %al
je 0x2a0e8
andq $0x0, 0x28(%rsp)
andq $0x0, 0x8(%rsp)
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x2a1fe
movq 0x50(%rsp), %rdi
pushq $0x7
popq %rsi
leaq 0x28(%rsp), %rdx
callq *%rax
testq %rax, %rax
je 0x2a1fe
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x2a37d
movq 0x50(%rsp), %rdi
pushq $0x7
popq %rsi
leaq 0x8(%rsp), %rdx
callq *%rax
testq %rax, %rax
je 0x2a37d
movl $0x170, %edi            # imm = 0x170
callq 0xb540
movq %rax, %r14
movq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x2aa1a
movl $0x170, %edi            # imm = 0x170
callq 0xb540
movq %rax, %r15
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x2aa1a
addq $0x60, %r14
addq $0x60, %r15
jmp 0x2a1e0
leaq 0x4b4dd(%rip), %rbx     # 0x75580
movq (%rbx), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x2a3e3
addq $0x20, %rdi
callq 0xb800
movq (%rbx), %rax
movq 0x8(%rax), %rdi
leaq 0x270c0(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x28704(%rip), %rsi     # 0x527d8
movq %rax, %rdi
callq 0xb520
leaq 0x2871d(%rip), %rsi     # 0x52800
jmp 0x2a30c
leaq 0x28789(%rip), %rsi     # 0x52878
leaq 0x88(%rsp), %rdi
callq 0x19be0
testb %al, %al
je 0x2a24a
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x2a321
movq 0x50(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0x48(%rsp), %rdx
callq *%rax
testq %rax, %rax
je 0x2a321
movl $0x200, %edi            # imm = 0x200
callq 0xb540
movq %rax, %r14
movq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1a132
leaq 0x2874b(%rip), %rdx     # 0x5289d
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1cb18
movq 0x28(%rsp), %rsi
pushq $0x10
popq %rdx
movq %r14, %rdi
callq 0xb5d0
leaq 0x28(%rsp), %rdi
callq 0xb230
leaq 0x8(%rsp), %rdi
callq 0xb230
movl $0x200, %edi            # imm = 0x200
callq 0xb540
movq %rax, %r15
movq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1a132
leaq 0x286f5(%rip), %rdx     # 0x528a2
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1cb18
movq 0x28(%rsp), %rsi
pushq $0x10
popq %rdx
movq %r15, %rdi
callq 0xb5d0
leaq 0x28(%rsp), %rdi
callq 0xb230
leaq 0x8(%rsp), %rdi
callq 0xb230
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a53c
movb $0x1, %bpl
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2a578
jmp 0x2a3e5
leaq 0x4b37b(%rip), %rbx     # 0x75580
movq (%rbx), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x2a3e3
addq $0x20, %rdi
callq 0xb800
movq (%rbx), %rax
movq 0x8(%rax), %rdi
leaq 0x26f5e(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x285a2(%rip), %rsi     # 0x527d8
movq %rax, %rdi
callq 0xb520
leaq 0x285fe(%rip), %rsi     # 0x52843
jmp 0x2a3c0
leaq 0x4b32f(%rip), %rbx     # 0x75580
movq (%rbx), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x2a3e3
addq $0x20, %rdi
callq 0xb800
movq (%rbx), %rax
movq 0x8(%rax), %rdi
leaq 0x26f12(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x28556(%rip), %rsi     # 0x527d8
movq %rax, %rdi
callq 0xb520
leaq 0x28616(%rip), %rsi     # 0x528a7
movq %rax, %rdi
callq 0xb520
leaq 0x88(%rsp), %rsi
movq %rax, %rdi
callq 0xb490
leaq 0x290b3(%rip), %rsi     # 0x53363
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
callq 0xb270
jmp 0x2a378
leaq 0x4b2b4(%rip), %rbx     # 0x75580
movq (%rbx), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x2a3e3
addq $0x20, %rdi
callq 0xb800
movq (%rbx), %rax
movq 0x8(%rax), %rdi
leaq 0x26e97(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x284db(%rip), %rsi     # 0x527d8
movq %rax, %rdi
callq 0xb520
leaq 0x28516(%rip), %rsi     # 0x52822
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
callq 0xb270
jmp 0x2a3d0
leaq 0x4b258(%rip), %rbx     # 0x75580
movq (%rbx), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x2a3e3
addq $0x20, %rdi
callq 0xb800
movq (%rbx), %rax
movq 0x8(%rax), %rdi
leaq 0x26e3b(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x2847f(%rip), %rsi     # 0x527d8
movq %rax, %rdi
callq 0xb520
leaq 0x2851d(%rip), %rsi     # 0x52885
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
callq 0xb270
movq (%rbx), %rdi
jmp 0x2a3da
leaq 0x4b1fc(%rip), %rbx     # 0x75580
movq (%rbx), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x2a3e3
addq $0x20, %rdi
callq 0xb800
movq (%rbx), %rax
movq 0x8(%rax), %rdi
leaq 0x26de3(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x28427(%rip), %rsi     # 0x527d8
movq %rax, %rdi
callq 0xb520
leaq 0x2849e(%rip), %rsi     # 0x5285e
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
callq 0xb270
leaq 0x4b1a9(%rip), %rax     # 0x75580
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3e0
xorl %ebp, %ebp
leaq 0x50(%rsp), %rdi
callq 0x19a94
leaq 0x88(%rsp), %rdi
callq 0xb230
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x170, %esi            # imm = 0x170
jmp 0x2a478
movq %rax, %rbx
movl $0x170, %esi            # imm = 0x170
jmp 0x2a485
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xb230
jmp 0x2a432
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb230
jmp 0x2a441
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
jmp 0x2a478
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xb230
jmp 0x2a45a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb230
jmp 0x2a469
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
jmp 0x2a485
movq %rax, %rbx
movl $0x178, %esi            # imm = 0x178
movq %r15, %rdi
jmp 0x2a488
movq %rax, %rbx
movl $0x178, %esi            # imm = 0x178
movq %r14, %rdi
callq 0xb550
jmp 0x2a498
jmp 0x2a495
jmp 0x2a495
jmp 0x2a495
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x19a94
leaq 0x88(%rsp), %rdi
callq 0xb230
movq %rbx, %rdi
callq 0xb9a0
nop