// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
cmpl $0x2, %edi
jl 0x287f
movl %edi, %r12d
movq 0x8(%r14), %r15
leaq 0x2ab6(%rip), %rsi      # 0x50b6
movq %r15, %rdi
callq 0x2170
testl %eax, %eax
je 0x287f
leaq 0x2aa2(%rip), %rsi      # 0x50b9
movq %r15, %rdi
callq 0x2170
testl %eax, %eax
je 0x287f
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %r15
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq %r15, %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x23fc
movl %eax, %ebp
leaq 0x10(%rsp), %rdi
movq $0x0, (%rdi)
movl (%r15), %esi
movl 0x4(%r15), %edx
movl 0x8(%r15), %ecx
callq 0x28f8
testl %eax, %eax
jne 0x28e6
movq 0x10(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x29a0
subl %ebp, %r12d
jle 0x281a
movslq %ebp, %rax
leaq (%r14,%rax,8), %rax
movq %rax, 0x30(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x28(%rsp)
movq %r12, 0x18(%rsp)
movq 0x10(%rsp), %r14
movq 0x30(%rsp), %rax
movq (%rax,%rbx,8), %r15
movq 0x58(%rsp), %r13
movq %r15, %rdi
movl $0x2e, %esi
callq 0x20f0
testq %rax, %rax
je 0x2799
movq %rax, %r12
cmpq %r15, %rax
je 0x2799
incq %r12
movq %r12, %rdi
leaq 0x2ed5(%rip), %rsi      # 0x55b6
callq 0x2170
testl %eax, %eax
je 0x27ac
movq %r14, 0x38(%rsp)
movq %r12, %rdi
leaq 0x2f24(%rip), %rsi      # 0x5621
callq 0x2170
xorl %r14d, %r14d
testl %eax, %eax
sete %bpl
movq %r12, %rdi
leaq 0x2f10(%rip), %rsi      # 0x5625
callq 0x2170
testl %eax, %eax
je 0x2723
movb %bpl, %r14b
jmp 0x2740
testq %r13, %r13
je 0x27d0
cmpb $0x0, (%r13)
je 0x27d0
movb $0x1, %bpl
movl $0x3, %r14d
movq %r12, %rdi
leaq 0x2e46(%rip), %rsi      # 0x5590
callq 0x2170
testl %eax, %eax
setne %cl
testb %bpl, %bpl
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x27b3
testl %eax, %eax
movq 0x18(%rsp), %r12
jne 0x2770
movl $0x2, %r14d
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rdi
movl %r14d, %esi
movq %r15, %rdx
movq %r13, %rcx
leaq 0x24(%rsp), %r8
callq 0x29b1
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
jmp 0x27df
movq 0x6858(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x2de8(%rip), %rsi      # 0x5592
jmp 0x27c4
callq 0x22b2
jmp 0x27d5
movq 0x683e(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x2e95(%rip), %rsi      # 0x5659
movq %r15, %rdx
xorl %eax, %eax
callq 0x2190
jmp 0x27d5
callq 0x2290
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq 0x18(%rsp), %r12
testl %ecx, %ecx
je 0x27ef
cmpl $0x1, %ecx
jne 0x27f6
movl $0x2, %eax
jmp 0x2805
movl $0x5, %eax
jmp 0x2805
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x28(%rsp)
cmpl $0x5, %eax
jne 0x28dc
incq %rbx
cmpl %ebx, %r12d
jne 0x269f
movq 0x10(%rsp), %rdi
movl 0x4c(%rsp), %edx
movl 0x50(%rsp), %esi
callq 0x2a60
testl %eax, %eax
jne 0x28e6
xorl %r14d, %r14d
leaq 0x70(%rsp), %rbx
movq %r14, (%rbx)
leaq 0x68(%rsp), %rdx
movq %r14, (%rdx)
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x2aa7
movq (%rbx), %rsi
leaq 0x2862(%rip), %rdi      # 0x50c0
xorl %eax, %eax
callq 0x20d0
movq 0x10(%rsp), %rdi
callq 0x2af5
testl %eax, %eax
jne 0x28e6
movq 0x58(%rsp), %rdi
callq 0x2040
jmp 0x28ca
movq (%r14), %rsi
leaq 0x2853(%rip), %rdi      # 0x50dc
xorl %eax, %eax
callq 0x20d0
leaq 0x2cf8(%rip), %rax      # 0x558f
movq %rax, (%rsp)
leaq 0x285a(%rip), %rdi      # 0x50fc
movl $0xa, %esi
movl $0x1, %edx
movl $0x2, %ecx
movl $0x1f, %r8d
movl $0x96, %r9d
xorl %eax, %eax
callq 0x20d0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %eax
movq 0x28(%rsp), %r14
jne 0x28ca
leaq 0x10(%rsp), %rdi
callq 0x22d4
movl $0x1, %r14d
jmp 0x28ca