// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/bin/ms.c
// Function: main
int main(int argc, char *argv[]) {
  if (argc < 2 || strcmp(argv[1], "-h") == 0 ||
      strcmp(argv[1], "--help") == 0) {
    print_usage(argv[0]);
    return -1;
  }
  struct opts parsed = {0};
  int idx = parse(&parsed, argc, argv);

  measuresuite_t ms = NULL;
  if (ms_initialize(&ms, parsed.arg_width, parsed.arg_num_in,
                    parsed.arg_num_out)) {
    goto ms_error;
  }

  ms_set_checking(ms, parsed.check);

  for (; idx < argc; idx++) {
    DEBUG("loading file %s\n", argv[idx]);
    int res = load(ms, argv[idx], parsed.sym);
    if (res == 0) {
      continue;
    }
    if (res == 1) {
      goto ms_error;
    }
    return -1;
  }

  if (ms_measure(ms, parsed.batch_size, parsed.num_batches)) {
    goto ms_error;
  };

  const char *json = NULL;
  size_t len = 0;

  ms_get_json(ms, &json, &len);
  printf("%s", json);

  if (ms_terminate(ms)) {
    goto ms_error;
  }
  free(parsed.sym);

  return 0;

ms_error:
  fprintf(stderr, "Error with Measuresuite:");
  ms_fprintf_error(ms, stderr);
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jl 0x261e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x4b7b(%rip), %rsi      # 0x7176
callq 0x2160
cmpl $0x0, %eax
je 0x261e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x4b65(%rip), %rsi      # 0x7179
callq 0x2160
cmpl $0x0, %eax
jne 0x2636
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2780
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2774
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2110
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x2360
movl %eax, -0x34(%rbp)
movq $0x0, -0x40(%rbp)
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
movl -0x28(%rbp), %ecx
leaq -0x40(%rbp), %rdi
callq 0x29a0
cmpl $0x0, %eax
je 0x267d
jmp 0x2742
movq -0x40(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x2ad0
movl -0x34(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x26d7
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x18(%rbp), %rdx
callq 0x27e0
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x26b5
jmp 0x26cc
cmpl $0x1, -0x44(%rbp)
jne 0x26c0
jmp 0x2742
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2774
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2689
movq -0x40(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x2c90
cmpl $0x0, %eax
je 0x26ed
jmp 0x2742
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x2d00
movq -0x50(%rbp), %rsi
leaq 0x4a67(%rip), %rdi      # 0x7180
movb $0x0, %al
callq 0x20b0
movq -0x40(%rbp), %rdi
callq 0x2dd0
cmpl $0x0, %eax
je 0x2730
jmp 0x2742
movq -0x18(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
jmp 0x2774
movq 0x88af(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x4a30(%rip), %rsi      # 0x7183
movb $0x0, %al
callq 0x2180
movq -0x40(%rbp), %rdi
movq 0x8893(%rip), %rax      # 0xaff8
movq (%rax), %rsi
callq 0x2ef0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)