// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: kvmap_api_helper
int
kvmap_api_helper(int argc, char ** const argv, struct kvmap_api ** const out, struct kvmap_mm * const mm, const bool use_ucache)
{
  if (argc < 3 || strcmp(argv[0], "api") != 0) {
    return -1;
  }
  const u64 mb = strtoull(argv[1], NULL, 10);
  if (mb == 0) {
    // no icache
    return 2 + kvmap_api_helper_map(argc - 2, argv + 2, out, mm);
  }

  // index + icache
  struct icache * const cache = icache_create(NULL, mb);
  if (cache == NULL) {
    fprintf(stderr, "icache_create() failed\n");
    return -1;
  }
  icache_wrap_mm(cache, mm);
  struct kvmap_api * map_api = NULL;
  const int n1 = kvmap_api_helper_map(argc - 2, argv + 2, &map_api, mm);
  if (n1 < 0) {
    icache_destroy(cache);
    return -1;
  }
  struct kvmap_api * const icache_api = use_ucache ? ucache_api_create(cache) : icache_api_create(cache);
  if (icache_api == NULL) {
    kvmap_api_destroy(map_api);
    icache_destroy(cache);
    return -1;
  }
  icache_wrap_kvmap(cache, map_api);
  *out = icache_api;
  return 2 + n1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $0x3, %edi
jl 0xbc84
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %rbx
movl %edi, %r15d
movl %r8d, -0x2c(%rbp)
movq (%rsi), %rdi
leaq 0x8a54(%rip), %rsi      # 0x14518
callq 0x62f0
testl %eax, %eax
jne 0xbc84
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
testq %rax, %rax
je 0xbc5a
movq %r12, -0x38(%rbp)
xorl %edi, %edi
movq %rax, %rsi
callq 0xbe03
testq %rax, %rax
je 0xbc96
movq %rax, %r12
vmovups (%r13), %ymm0
vmovups 0x20(%r13), %ymm1
vmovups 0x30(%r13), %ymm2
vmovups %ymm2, 0x80(%rax)
vmovups %ymm1, 0x70(%rax)
vmovups %ymm0, 0x50(%rax)
cmpq $0x0, 0x10(%r13)
je 0xbb4d
leaq 0x605b(%rip), %rax      # 0x11b91
movq %rax, 0x10(%r13)
movq %r12, 0x18(%r13)
leaq 0x60ff(%rip), %rax      # 0x11c44
movq %rax, 0x30(%r13)
movq %r12, 0x38(%r13)
leaq 0x61a9(%rip), %rax      # 0x11cfd
movq %rax, 0x20(%r13)
movq %r12, 0x28(%r13)
leaq 0x61ad(%rip), %rax      # 0x11d10
movq %rax, 0x40(%r13)
movq %r12, 0x48(%r13)
leaq -0x40(%rbp), %rdx
movq $0x0, (%rdx)
addl $-0x2, %r15d
addq $0x10, %rbx
movl %r15d, %edi
movq %rbx, %rsi
movq %r13, %rcx
vzeroupper
callq 0xbc9d
testl %eax, %eax
js 0xbc7c
movl %eax, %r14d
movl $0x58, %edi
callq 0x63a0
movq %r12, (%rax)
leaq 0x629d(%rip), %rcx      # 0x11e4b
leaq 0x5519(%rip), %rdx      # 0x110ce
cmpb $0x0, -0x2c(%rbp)
cmovneq %rcx, %rdx
leaq 0x6408(%rip), %rcx      # 0x11fcc
leaq 0x56bb(%rip), %rsi      # 0x11286
cmovneq %rcx, %rsi
leaq 0x6517(%rip), %rcx      # 0x120ed
leaq 0x5800(%rip), %rdi      # 0x113dd
cmovneq %rcx, %rdi
leaq 0x651a(%rip), %rcx      # 0x12102
leaq 0x584b(%rip), %r8       # 0x1143a
cmovneq %rcx, %r8
movq %rdx, 0x8(%rax)
movq %rsi, 0x10(%rax)
movq %rdi, 0x18(%rax)
movq %r8, 0x20(%rax)
leaq 0x588d(%rip), %rcx      # 0x11497
movq %rcx, 0x28(%rax)
leaq 0x374(%rip), %rcx       # 0xbf89
movq %rcx, 0x30(%rax)
leaq 0x591c(%rip), %rcx      # 0x1153c
movq %rcx, 0x38(%rax)
leaq 0x59a2(%rip), %rcx      # 0x115cd
movq %rcx, 0x40(%rax)
leaq 0x59d6(%rip), %rcx      # 0x1160c
movq %rcx, 0x48(%rax)
leaq 0x59eb(%rip), %rcx      # 0x1162c
movq %rcx, 0x50(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x10150(%r12)
movq -0x38(%rbp), %rcx
movq %rax, (%rcx)
jmp 0xbc76
addl $-0x2, %r15d
addq $0x10, %rbx
movl %r15d, %edi
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0xbc9d
movl %eax, %r14d
addl $0x2, %r14d
jmp 0xbc84
movq %r12, %rdi
callq 0xbf89
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6b46
jmp 0xbc84