int bsearch_test() {
  const int arr_odd[] = {1, 2, 2, 4, 5, 6, 7, 8, 9};
  const int arr_even[] = {1, 2, 2, 4, 5, 6, 7, 8, 9, 10};
  const int arr_same[] = {2, 2, 2, 2, 2, 2, 2, 2, 2};
  const int arr_tiny[] = {2};
  int nitems;
  int key;
  int i;
  nitems = sizeof(arr_odd) / sizeof(int);
  for (i = 0; i < nitems; ++i) {
    int n = call_bsearch(arr_odd, nitems, arr_odd[i]);
    ((void)((arr_odd[n] == arr_odd[i])
                ? 0
                : __test_assert(
                      "arr_odd[n] == arr_odd[i]",
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/"
                      "refs/heads/master/src/libc/test/search_sort_test.c",
                      48, __func__)));
  }
  ((void)((call_bsearch(arr_odd, nitems, 0) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_odd, nitems, 0) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    50, __func__)));
  ((void)((call_bsearch(arr_odd, nitems, 3) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_odd, nitems, 3) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    51, __func__)));
  ((void)((call_bsearch(arr_odd, nitems, 10) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_odd, nitems, 10) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    52, __func__)));
  nitems = sizeof(arr_even) / sizeof(int);
  for (i = 0; i < nitems; ++i) {
    int n = call_bsearch(arr_even, nitems, arr_even[i]);
    ((void)((arr_even[n] == arr_even[i])
                ? 0
                : __test_assert(
                      "arr_even[n] == arr_even[i]",
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/"
                      "refs/heads/master/src/libc/test/search_sort_test.c",
                      57, __func__)));
  }
  ((void)((call_bsearch(arr_even, nitems, 0) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_even, nitems, 0) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    59, __func__)));
  ((void)((call_bsearch(arr_even, nitems, 3) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_even, nitems, 3) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    60, __func__)));
  ((void)((call_bsearch(arr_even, nitems, 11) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_even, nitems, 11) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    61, __func__)));
  nitems = sizeof(arr_same) / sizeof(int);
  for (i = 0; i < nitems; ++i) {
    int n = call_bsearch(arr_same, nitems, arr_same[i]);
    ((void)((arr_same[n] == arr_same[i])
                ? 0
                : __test_assert(
                      "arr_same[n] == arr_same[i]",
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/"
                      "refs/heads/master/src/libc/test/search_sort_test.c",
                      66, __func__)));
  }
  ((void)((call_bsearch(arr_same, nitems, 1) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_same, nitems, 1) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    68, __func__)));
  ((void)((call_bsearch(arr_same, nitems, 3) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_same, nitems, 3) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    69, __func__)));
  nitems = sizeof(arr_tiny) / sizeof(int);
  for (i = 0; i < nitems; ++i) {
    int n = call_bsearch(arr_tiny, nitems, arr_tiny[i]);
    ((void)((arr_tiny[n] == arr_tiny[i])
                ? 0
                : __test_assert(
                      "arr_tiny[n] == arr_tiny[i]",
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/"
                      "refs/heads/master/src/libc/test/search_sort_test.c",
                      74, __func__)));
  }
  ((void)((call_bsearch(arr_tiny, nitems, 0) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_tiny, nitems, 0) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    76, __func__)));
  ((void)((call_bsearch(arr_tiny, nitems, 1) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_tiny, nitems, 1) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    77, __func__)));
  ((void)((call_bsearch(arr_tiny, nitems, 3) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_tiny, nitems, 3) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    78, __func__)));
  ((void)((call_bsearch(arr_tiny, 0, 1) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_tiny, 0, 1) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    81, __func__)));
  ((void)((call_bsearch(arr_tiny, 0, 2) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_tiny, 0, 2) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    82, __func__)));
  ((void)((call_bsearch(arr_tiny, 0, 3) == -1)
              ? 0
              : __test_assert(
                    "call_bsearch(arr_tiny, 0, 3) == -1",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/"
                    "heads/master/src/libc/test/search_sort_test.c",
                    83, __func__)));
  return 0;
}


x86 assembly (clang, -O0):
<bsearch_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
lea    -0x30(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xeed(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
mov    0xf01(%rip),%eax
mov    %eax,-0x94(%rbp)
movl   $0x9,-0x98(%rbp)
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x98(%rbp),%eax
jge    1227 <bsearch_test+0xf7>
lea    -0x30(%rbp),%rdi
mov    -0x98(%rbp),%esi
movslq -0xa0(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
mov    %eax,-0xa4(%rbp)
movslq -0xa4(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
movslq -0xa0(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    11f2 <bsearch_test+0xc2>
jmp    1213 <bsearch_test+0xe3>
lea    0xe8f(%rip),%rdi
lea    0xea1(%rip),%rsi
mov    $0x30,%edx
lea    0xf34(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    119d <bsearch_test+0x6d>
lea    -0x30(%rbp),%rdi
mov    -0x98(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    1248 <bsearch_test+0x118>
jmp    1269 <bsearch_test+0x139>
lea    0xefe(%rip),%rdi
lea    0xe4b(%rip),%rsi
mov    $0x32,%edx
lea    0xede(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x30(%rbp),%rdi
mov    -0x98(%rbp),%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    128d <bsearch_test+0x15d>
jmp    12ae <bsearch_test+0x17e>
lea    0xee0(%rip),%rdi
lea    0xe06(%rip),%rsi
mov    $0x33,%edx
lea    0xe99(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x30(%rbp),%rdi
mov    -0x98(%rbp),%esi
mov    $0xa,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    12d2 <bsearch_test+0x1a2>
jmp    12f3 <bsearch_test+0x1c3>
lea    0xec2(%rip),%rdi
lea    0xdc1(%rip),%rsi
mov    $0x34,%edx
lea    0xe54(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
movl   $0xa,-0x98(%rbp)
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x98(%rbp),%eax
jge    1391 <bsearch_test+0x261>
lea    -0x60(%rbp),%rdi
mov    -0x98(%rbp),%esi
movslq -0xa0(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
mov    %eax,-0xa8(%rbp)
movslq -0xa8(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
movslq -0xa0(%rbp),%rcx
cmp    -0x60(%rbp,%rcx,4),%eax
jne    135c <bsearch_test+0x22c>
jmp    137d <bsearch_test+0x24d>
lea    0xe60(%rip),%rdi
lea    0xd37(%rip),%rsi
mov    $0x39,%edx
lea    0xdca(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    1307 <bsearch_test+0x1d7>
lea    -0x60(%rbp),%rdi
mov    -0x98(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    13b2 <bsearch_test+0x282>
jmp    13d3 <bsearch_test+0x2a3>
lea    0xe25(%rip),%rdi
lea    0xce1(%rip),%rsi
mov    $0x3b,%edx
lea    0xd74(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x60(%rbp),%rdi
mov    -0x98(%rbp),%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    13f7 <bsearch_test+0x2c7>
jmp    1418 <bsearch_test+0x2e8>
lea    0xe08(%rip),%rdi
lea    0xc9c(%rip),%rsi
mov    $0x3c,%edx
lea    0xd2f(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x60(%rbp),%rdi
mov    -0x98(%rbp),%esi
mov    $0xb,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    143c <bsearch_test+0x30c>
jmp    145d <bsearch_test+0x32d>
lea    0xdeb(%rip),%rdi
lea    0xc57(%rip),%rsi
mov    $0x3d,%edx
lea    0xcea(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
movl   $0x9,-0x98(%rbp)
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x98(%rbp),%eax
jge    1507 <bsearch_test+0x3d7>
lea    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%esi
movslq -0xa0(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
mov    %eax,-0xac(%rbp)
movslq -0xac(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
movslq -0xa0(%rbp),%rcx
cmp    -0x90(%rbp,%rcx,4),%eax
jne    14d2 <bsearch_test+0x3a2>
jmp    14f3 <bsearch_test+0x3c3>
lea    0xd7e(%rip),%rdi
lea    0xbc1(%rip),%rsi
mov    $0x42,%edx
lea    0xc54(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    1471 <bsearch_test+0x341>
lea    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    152e <bsearch_test+0x3fe>
jmp    154f <bsearch_test+0x41f>
lea    0xd3d(%rip),%rdi
lea    0xb65(%rip),%rsi
mov    $0x44,%edx
lea    0xbf8(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    1576 <bsearch_test+0x446>
jmp    1597 <bsearch_test+0x467>
lea    0xd1d(%rip),%rdi
lea    0xb1d(%rip),%rsi
mov    $0x45,%edx
lea    0xbb0(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
movl   $0x1,-0x98(%rbp)
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x98(%rbp),%eax
jge    1641 <bsearch_test+0x511>
lea    -0x94(%rbp),%rdi
mov    -0x98(%rbp),%esi
movslq -0xa0(%rbp),%rax
mov    -0x94(%rbp,%rax,4),%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
mov    %eax,-0xb0(%rbp)
movslq -0xb0(%rbp),%rax
mov    -0x94(%rbp,%rax,4),%eax
movslq -0xa0(%rbp),%rcx
cmp    -0x94(%rbp,%rcx,4),%eax
jne    160c <bsearch_test+0x4dc>
jmp    162d <bsearch_test+0x4fd>
lea    0xcaf(%rip),%rdi
lea    0xa87(%rip),%rsi
mov    $0x4a,%edx
lea    0xb1a(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    15ab <bsearch_test+0x47b>
lea    -0x94(%rbp),%rdi
mov    -0x98(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    1665 <bsearch_test+0x535>
jmp    1686 <bsearch_test+0x556>
lea    0xc71(%rip),%rdi
lea    0xa2e(%rip),%rsi
mov    $0x4c,%edx
lea    0xac1(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x94(%rbp),%rdi
mov    -0x98(%rbp),%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    16ad <bsearch_test+0x57d>
jmp    16ce <bsearch_test+0x59e>
lea    0xc51(%rip),%rdi
lea    0x9e6(%rip),%rsi
mov    $0x4d,%edx
lea    0xa79(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x94(%rbp),%rdi
mov    -0x98(%rbp),%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    16f5 <bsearch_test+0x5c5>
jmp    1716 <bsearch_test+0x5e6>
lea    0xc31(%rip),%rdi
lea    0x99e(%rip),%rsi
mov    $0x4e,%edx
lea    0xa31(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x94(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    1739 <bsearch_test+0x609>
jmp    175a <bsearch_test+0x62a>
lea    0xc15(%rip),%rdi
lea    0x95a(%rip),%rsi
mov    $0x51,%edx
lea    0x9ed(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x94(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    177d <bsearch_test+0x64d>
jmp    179e <bsearch_test+0x66e>
lea    0xbf4(%rip),%rdi
lea    0x916(%rip),%rsi
mov    $0x52,%edx
lea    0x9a9(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
lea    -0x94(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <call_bsearch@plt>
cmp    $0xffffffff,%eax
jne    17c1 <bsearch_test+0x691>
jmp    17e2 <bsearch_test+0x6b2>
lea    0xbd3(%rip),%rdi
lea    0x8d2(%rip),%rsi
mov    $0x53,%edx
lea    0x965(%rip),%rcx
mov    $0x0,%al
call   1050 <__test_assert@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsearch_test>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa0,%rsp
mov    0xeea(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0xef7(%rip),%rax
mov    %rax,0x90(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
mov    0xefe(%rip),%eax
mov    %eax,0x60(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movl   $0x2,0xc(%rsp)
mov    $0x1,%edx
lea    0x10(%rsp),%r13
lea    0xecd(%rip),%r14
lea    0xedf(%rip),%r15
lea    0xf77(%rip),%r12
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cltq
mov    0x10(%rsp,%rax,4),%eax
cmp    0x10(%rsp,%rbx,4),%eax
je     1200 <bsearch_test+0xe0>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x30,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1040 <__test_assert@plt>
cmp    $0x8,%rbx
je     1210 <bsearch_test+0xf0>
mov    0x14(%rsp,%rbx,4),%edx
add    $0x1,%rbx
jmp    11d0 <bsearch_test+0xb0>
lea    0x10(%rsp),%rdi
mov    $0x9,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     1249 <bsearch_test+0x129>
lea    0xf1a(%rip),%rdi
lea    0xe67(%rip),%rsi
lea    0xeff(%rip),%rcx
mov    $0x32,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0x10(%rsp),%rdi
mov    $0x9,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     1285 <bsearch_test+0x165>
lea    0xf05(%rip),%rdi
lea    0xe2b(%rip),%rsi
lea    0xec3(%rip),%rcx
mov    $0x33,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0x10(%rsp),%rdi
mov    $0x9,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     12c1 <bsearch_test+0x1a1>
lea    0xef0(%rip),%rdi
lea    0xdef(%rip),%rsi
lea    0xe87(%rip),%rcx
mov    $0x34,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
mov    $0x1,%edx
mov    $0x1,%ebx
lea    0x70(%rsp),%r13
lea    0xee8(%rip),%r14
lea    0xdbf(%rip),%r15
lea    0xe57(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cltq
mov    0x70(%rsp,%rax,4),%eax
cmp    0x6c(%rsp,%rbx,4),%eax
je     1320 <bsearch_test+0x200>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x39,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1040 <__test_assert@plt>
cmp    $0xa,%rbx
je     1330 <bsearch_test+0x210>
mov    0x70(%rsp,%rbx,4),%edx
add    $0x1,%rbx
jmp    12f0 <bsearch_test+0x1d0>
lea    0x70(%rsp),%rdi
mov    $0xa,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     1369 <bsearch_test+0x249>
lea    0xe8b(%rip),%rdi
lea    0xd47(%rip),%rsi
lea    0xddf(%rip),%rcx
mov    $0x3b,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0x70(%rsp),%rdi
mov    $0xa,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     13a5 <bsearch_test+0x285>
lea    0xe77(%rip),%rdi
lea    0xd0b(%rip),%rsi
lea    0xda3(%rip),%rcx
mov    $0x3c,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0x70(%rsp),%rdi
mov    $0xa,%esi
mov    $0xb,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     13e1 <bsearch_test+0x2c1>
lea    0xe63(%rip),%rdi
lea    0xccf(%rip),%rsi
lea    0xd67(%rip),%rcx
mov    $0x3d,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
mov    $0x2,%edx
lea    0x40(%rsp),%r13
lea    0xe61(%rip),%r14
lea    0xca4(%rip),%r15
lea    0xd3c(%rip),%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cltq
mov    0x40(%rsp,%rax,4),%eax
cmp    0x40(%rsp,%rbx,4),%eax
je     1440 <bsearch_test+0x320>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x42,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1040 <__test_assert@plt>
cmp    $0x8,%rbx
je     1450 <bsearch_test+0x330>
mov    0x44(%rsp,%rbx,4),%edx
add    $0x1,%rbx
jmp    1410 <bsearch_test+0x2f0>
lea    0x40(%rsp),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     148c <bsearch_test+0x36c>
lea    0xdfc(%rip),%rdi
lea    0xc24(%rip),%rsi
lea    0xcbc(%rip),%rcx
mov    $0x44,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0x40(%rsp),%rdi
mov    $0x9,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     14c8 <bsearch_test+0x3a8>
lea    0xde8(%rip),%rdi
lea    0xbe8(%rip),%rsi
lea    0xc80(%rip),%rcx
mov    $0x45,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     1518 <bsearch_test+0x3f8>
lea    0xdc0(%rip),%rdi
lea    0xb98(%rip),%rsi
lea    0xc30(%rip),%rcx
mov    $0x4c,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     1554 <bsearch_test+0x434>
lea    0xdac(%rip),%rdi
lea    0xb5c(%rip),%rsi
lea    0xbf4(%rip),%rcx
mov    $0x4d,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     1590 <bsearch_test+0x470>
lea    0xd98(%rip),%rdi
lea    0xb20(%rip),%rsi
lea    0xbb8(%rip),%rcx
mov    $0x4e,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0xc(%rsp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     15c9 <bsearch_test+0x4a9>
lea    0xd87(%rip),%rdi
lea    0xae7(%rip),%rsi
lea    0xb7f(%rip),%rcx
mov    $0x51,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0xc(%rsp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     1602 <bsearch_test+0x4e2>
lea    0xd71(%rip),%rdi
lea    0xaae(%rip),%rsi
lea    0xb46(%rip),%rcx
mov    $0x52,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
lea    0xc(%rsp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <call_bsearch@plt>
cmp    $0xffffffff,%eax
je     163b <bsearch_test+0x51b>
lea    0xd5b(%rip),%rdi
lea    0xa75(%rip),%rsi
lea    0xb0d(%rip),%rcx
mov    $0x53,%edx
xor    %eax,%eax
call   1040 <__test_assert@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.bsearch_test.arr_odd = [9 x i32] [i32 1, i32 2, i32 2, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.bsearch_test.arr_even = [10 x i32] [i32 1, i32 2, i32 2, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@__const.bsearch_test.arr_same = [9 x i32] [i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2]
@__const.bsearch_test.arr_tiny = [1 x i32] [i32 2]
@.str = [25 x i8] c"arr_odd[n] == arr_odd[i]\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/heads/master/src/libc/test/search_sort_test.c\00"
@__func__.bsearch_test = [13 x i8] c"bsearch_test\00"
@.str.2 = [39 x i8] c"call_bsearch(arr_odd, nitems, 0) == -1\00"
@.str.3 = [39 x i8] c"call_bsearch(arr_odd, nitems, 3) == -1\00"
@.str.4 = [40 x i8] c"call_bsearch(arr_odd, nitems, 10) == -1\00"
@.str.5 = [27 x i8] c"arr_even[n] == arr_even[i]\00"
@.str.6 = [40 x i8] c"call_bsearch(arr_even, nitems, 0) == -1\00"
@.str.7 = [40 x i8] c"call_bsearch(arr_even, nitems, 3) == -1\00"
@.str.8 = [41 x i8] c"call_bsearch(arr_even, nitems, 11) == -1\00"
@.str.9 = [27 x i8] c"arr_same[n] == arr_same[i]\00"
@.str.10 = [40 x i8] c"call_bsearch(arr_same, nitems, 1) == -1\00"
@.str.11 = [40 x i8] c"call_bsearch(arr_same, nitems, 3) == -1\00"
@.str.12 = [27 x i8] c"arr_tiny[n] == arr_tiny[i]\00"
@.str.13 = [40 x i8] c"call_bsearch(arr_tiny, nitems, 0) == -1\00"
@.str.14 = [40 x i8] c"call_bsearch(arr_tiny, nitems, 1) == -1\00"
@.str.15 = [40 x i8] c"call_bsearch(arr_tiny, nitems, 3) == -1\00"
@.str.16 = [35 x i8] c"call_bsearch(arr_tiny, 0, 1) == -1\00"
@.str.17 = [35 x i8] c"call_bsearch(arr_tiny, 0, 2) == -1\00"
@.str.18 = [35 x i8] c"call_bsearch(arr_tiny, 0, 3) == -1\00"
define i32 @bsearch_test() {
%1 = alloca [9 x i32]
%2 = alloca [10 x i32]
%3 = alloca [9 x i32]
%4 = alloca [1 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = bitcast [9 x i32]* %1 to i8*
%13 = bitcast [10 x i32]* %2 to i8*
%14 = bitcast [9 x i32]* %3 to i8*
%15 = bitcast [1 x i32]* %4 to i8*
store i32 9, i32* %5
store i32 0, i32* %7
br label %16
16: ; preds = %42, %0
%17 = load i32, i32* %7
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %45
20: ; preds = %16
%21 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %21, i32 %22, i32 %26)
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = icmp eq i32 %31, %35
br i1 %36, label %37, label %38
37: ; preds = %20
br label %40
38: ; preds = %20
%39 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 48, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %40
40: ; preds = %38, %37
%41 = phi i32 [ 0, %37 ], [ %39, %38 ]
br label %42
42: ; preds = %40
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %16
45: ; preds = %16
%46 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%47 = load i32, i32* %5
%48 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %46, i32 %47, i32 0)
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %51
50: ; preds = %45
br label %53
51: ; preds = %45
%52 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %53
53: ; preds = %51, %50
%54 = phi i32 [ 0, %50 ], [ %52, %51 ]
%55 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%56 = load i32, i32* %5
%57 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %55, i32 %56, i32 3)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %60
59: ; preds = %53
br label %62
60: ; preds = %53
%61 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 51, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %62
62: ; preds = %60, %59
%63 = phi i32 [ 0, %59 ], [ %61, %60 ]
%64 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%65 = load i32, i32* %5
%66 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %64, i32 %65, i32 10)
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %69
68: ; preds = %62
br label %71
69: ; preds = %62
%70 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 52, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %71
71: ; preds = %69, %68
%72 = phi i32 [ 0, %68 ], [ %70, %69 ]
store i32 10, i32* %5
store i32 0, i32* %7
br label %73
73: ; preds = %99, %71
%74 = load i32, i32* %7
%75 = load i32, i32* %5
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %102
77: ; preds = %73
%78 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%79 = load i32, i32* %5
%80 = load i32, i32* %7
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %81
%83 = load i32, i32* %82
%84 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %78, i32 %79, i32 %83)
store i32 %84, i32* %9
%85 = load i32, i32* %9
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %86
%88 = load i32, i32* %87
%89 = load i32, i32* %7
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %90
%92 = load i32, i32* %91
%93 = icmp eq i32 %88, %92
br i1 %93, label %94, label %95
94: ; preds = %77
br label %97
95: ; preds = %77
%96 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 57, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %97
97: ; preds = %95, %94
%98 = phi i32 [ 0, %94 ], [ %96, %95 ]
br label %99
99: ; preds = %97
%100 = load i32, i32* %7
%101 = add nsw i32 %100, 1
store i32 %101, i32* %7
br label %73
102: ; preds = %73
%103 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%104 = load i32, i32* %5
%105 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %103, i32 %104, i32 0)
%106 = icmp eq i32 %105, -1
br i1 %106, label %107, label %108
107: ; preds = %102
br label %110
108: ; preds = %102
%109 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 59, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %110
110: ; preds = %108, %107
%111 = phi i32 [ 0, %107 ], [ %109, %108 ]
%112 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%113 = load i32, i32* %5
%114 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %112, i32 %113, i32 3)
%115 = icmp eq i32 %114, -1
br i1 %115, label %116, label %117
116: ; preds = %110
br label %119
117: ; preds = %110
%118 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %119
119: ; preds = %117, %116
%120 = phi i32 [ 0, %116 ], [ %118, %117 ]
%121 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%122 = load i32, i32* %5
%123 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %121, i32 %122, i32 11)
%124 = icmp eq i32 %123, -1
br i1 %124, label %125, label %126
125: ; preds = %119
br label %128
126: ; preds = %119
%127 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 61, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %128
128: ; preds = %126, %125
%129 = phi i32 [ 0, %125 ], [ %127, %126 ]
store i32 9, i32* %5
store i32 0, i32* %7
br label %130
130: ; preds = %156, %128
%131 = load i32, i32* %7
%132 = load i32, i32* %5
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %159
134: ; preds = %130
%135 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%136 = load i32, i32* %5
%137 = load i32, i32* %7
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %135, i32 %136, i32 %140)
store i32 %141, i32* %10
%142 = load i32, i32* %10
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %143
%145 = load i32, i32* %144
%146 = load i32, i32* %7
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %147
%149 = load i32, i32* %148
%150 = icmp eq i32 %145, %149
br i1 %150, label %151, label %152
151: ; preds = %134
br label %154
152: ; preds = %134
%153 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 66, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %154
154: ; preds = %152, %151
%155 = phi i32 [ 0, %151 ], [ %153, %152 ]
br label %156
156: ; preds = %154
%157 = load i32, i32* %7
%158 = add nsw i32 %157, 1
store i32 %158, i32* %7
br label %130
159: ; preds = %130
%160 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%161 = load i32, i32* %5
%162 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %160, i32 %161, i32 1)
%163 = icmp eq i32 %162, -1
br i1 %163, label %164, label %165
164: ; preds = %159
br label %167
165: ; preds = %159
%166 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %167
167: ; preds = %165, %164
%168 = phi i32 [ 0, %164 ], [ %166, %165 ]
%169 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%170 = load i32, i32* %5
%171 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %169, i32 %170, i32 3)
%172 = icmp eq i32 %171, -1
br i1 %172, label %173, label %174
173: ; preds = %167
br label %176
174: ; preds = %167
%175 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 69, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %176
176: ; preds = %174, %173
%177 = phi i32 [ 0, %173 ], [ %175, %174 ]
store i32 1, i32* %5
store i32 0, i32* %7
br label %178
178: ; preds = %204, %176
%179 = load i32, i32* %7
%180 = load i32, i32* %5
%181 = icmp slt i32 %179, %180
br i1 %181, label %182, label %207
182: ; preds = %178
%183 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%184 = load i32, i32* %5
%185 = load i32, i32* %7
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %186
%188 = load i32, i32* %187
%189 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %183, i32 %184, i32 %188)
store i32 %189, i32* %11
%190 = load i32, i32* %11
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %191
%193 = load i32, i32* %192
%194 = load i32, i32* %7
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %195
%197 = load i32, i32* %196
%198 = icmp eq i32 %193, %197
br i1 %198, label %199, label %200
199: ; preds = %182
br label %202
200: ; preds = %182
%201 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 74, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %202
202: ; preds = %200, %199
%203 = phi i32 [ 0, %199 ], [ %201, %200 ]
br label %204
204: ; preds = %202
%205 = load i32, i32* %7
%206 = add nsw i32 %205, 1
store i32 %206, i32* %7
br label %178
207: ; preds = %178
%208 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%209 = load i32, i32* %5
%210 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %208, i32 %209, i32 0)
%211 = icmp eq i32 %210, -1
br i1 %211, label %212, label %213
212: ; preds = %207
br label %215
213: ; preds = %207
%214 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 76, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %215
215: ; preds = %213, %212
%216 = phi i32 [ 0, %212 ], [ %214, %213 ]
%217 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%218 = load i32, i32* %5
%219 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %217, i32 %218, i32 1)
%220 = icmp eq i32 %219, -1
br i1 %220, label %221, label %222
221: ; preds = %215
br label %224
222: ; preds = %215
%223 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 77, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %224
224: ; preds = %222, %221
%225 = phi i32 [ 0, %221 ], [ %223, %222 ]
%226 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%227 = load i32, i32* %5
%228 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %226, i32 %227, i32 3)
%229 = icmp eq i32 %228, -1
br i1 %229, label %230, label %231
230: ; preds = %224
br label %233
231: ; preds = %224
%232 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 78, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %233
233: ; preds = %231, %230
%234 = phi i32 [ 0, %230 ], [ %232, %231 ]
%235 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%236 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %235, i32 0, i32 1)
%237 = icmp eq i32 %236, -1
br i1 %237, label %238, label %239
238: ; preds = %233
br label %241
239: ; preds = %233
%240 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 81, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %241
241: ; preds = %239, %238
%242 = phi i32 [ 0, %238 ], [ %240, %239 ]
%243 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%244 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %243, i32 0, i32 2)
%245 = icmp eq i32 %244, -1
br i1 %245, label %246, label %247
246: ; preds = %241
br label %249
247: ; preds = %241
%248 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 82, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %249
249: ; preds = %247, %246
%250 = phi i32 [ 0, %246 ], [ %248, %247 ]
%251 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%252 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %251, i32 0, i32 3)
%253 = icmp eq i32 %252, -1
br i1 %253, label %254, label %255
254: ; preds = %249
br label %257
255: ; preds = %249
%256 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 83, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %257
257: ; preds = %255, %254
%258 = phi i32 [ 0, %254 ], [ %256, %255 ]
ret i32 0
}

LLVM IR (-O2):
@__const.bsearch_test.arr_odd = [9 x i32] [i32 1, i32 2, i32 2, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.bsearch_test.arr_even = [10 x i32] [i32 1, i32 2, i32 2, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@__const.bsearch_test.arr_same = [9 x i32] [i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2]
@.str = [25 x i8] c"arr_odd[n] == arr_odd[i]\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gerryg400/anvilos/refs/heads/master/src/libc/test/search_sort_test.c\00"
@__func__.bsearch_test = [13 x i8] c"bsearch_test\00"
@.str.2 = [39 x i8] c"call_bsearch(arr_odd, nitems, 0) == -1\00"
@.str.3 = [39 x i8] c"call_bsearch(arr_odd, nitems, 3) == -1\00"
@.str.4 = [40 x i8] c"call_bsearch(arr_odd, nitems, 10) == -1\00"
@.str.5 = [27 x i8] c"arr_even[n] == arr_even[i]\00"
@.str.6 = [40 x i8] c"call_bsearch(arr_even, nitems, 0) == -1\00"
@.str.7 = [40 x i8] c"call_bsearch(arr_even, nitems, 3) == -1\00"
@.str.8 = [41 x i8] c"call_bsearch(arr_even, nitems, 11) == -1\00"
@.str.9 = [27 x i8] c"arr_same[n] == arr_same[i]\00"
@.str.10 = [40 x i8] c"call_bsearch(arr_same, nitems, 1) == -1\00"
@.str.11 = [40 x i8] c"call_bsearch(arr_same, nitems, 3) == -1\00"
@.str.13 = [40 x i8] c"call_bsearch(arr_tiny, nitems, 0) == -1\00"
@.str.14 = [40 x i8] c"call_bsearch(arr_tiny, nitems, 1) == -1\00"
@.str.15 = [40 x i8] c"call_bsearch(arr_tiny, nitems, 3) == -1\00"
@.str.16 = [35 x i8] c"call_bsearch(arr_tiny, 0, 1) == -1\00"
@.str.17 = [35 x i8] c"call_bsearch(arr_tiny, 0, 2) == -1\00"
@.str.18 = [35 x i8] c"call_bsearch(arr_tiny, 0, 3) == -1\00"
define i32 @bsearch_test() {
%1 = alloca [9 x i32]
%2 = alloca [10 x i32]
%3 = alloca [9 x i32]
%4 = alloca [1 x i32]
%5 = bitcast [9 x i32]* %1 to i8*
%6 = bitcast [10 x i32]* %2 to i8*
%7 = bitcast [9 x i32]* %3 to i8*
%8 = bitcast [1 x i32]* %4 to i8*
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
store i32 2, i32* %9
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
br label %11
11: ; preds = %26, %0
%12 = phi i32 [ 1, %0 ], [ %28, %26 ]
%13 = phi i64 [ 0, %0 ], [ %24, %26 ]
%14 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 %13
%15 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %10, i32 9, i32 %12)
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %14
%20 = icmp eq i32 %18, %19
br i1 %20, label %23, label %21
21: ; preds = %11
%22 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 48, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %23
23: ; preds = %11, %21
%24 = add nuw nsw i64 %13, 1
%25 = icmp eq i64 %24, 9
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 %24
%28 = load i32, i32* %27
br label %11
29: ; preds = %23
%30 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %10, i32 9, i32 0)
%31 = icmp eq i32 %30, -1
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %34
34: ; preds = %29, %32
%35 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %10, i32 9, i32 3)
%36 = icmp eq i32 %35, -1
br i1 %36, label %39, label %37
37: ; preds = %34
%38 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 51, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %39
39: ; preds = %34, %37
%40 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %10, i32 9, i32 10)
%41 = icmp eq i32 %40, -1
br i1 %41, label %44, label %42
42: ; preds = %39
%43 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 52, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %44
44: ; preds = %39, %42
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
br label %46
46: ; preds = %61, %44
%47 = phi i32 [ 1, %44 ], [ %63, %61 ]
%48 = phi i64 [ 0, %44 ], [ %59, %61 ]
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %48
%50 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %45, i32 10, i32 %47)
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = load i32, i32* %49
%55 = icmp eq i32 %53, %54
br i1 %55, label %58, label %56
56: ; preds = %46
%57 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 57, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %58
58: ; preds = %46, %56
%59 = add nuw nsw i64 %48, 1
%60 = icmp eq i64 %59, 10
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %59
%63 = load i32, i32* %62
br label %46
64: ; preds = %58
%65 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %45, i32 10, i32 0)
%66 = icmp eq i32 %65, -1
br i1 %66, label %69, label %67
67: ; preds = %64
%68 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 59, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %69
69: ; preds = %64, %67
%70 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %45, i32 10, i32 3)
%71 = icmp eq i32 %70, -1
br i1 %71, label %74, label %72
72: ; preds = %69
%73 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %74
74: ; preds = %69, %72
%75 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %45, i32 10, i32 11)
%76 = icmp eq i32 %75, -1
br i1 %76, label %79, label %77
77: ; preds = %74
%78 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 61, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %79
79: ; preds = %74, %77
%80 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
br label %81
81: ; preds = %96, %79
%82 = phi i32 [ 2, %79 ], [ %98, %96 ]
%83 = phi i64 [ 0, %79 ], [ %94, %96 ]
%84 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %83
%85 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %80, i32 9, i32 %82)
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %86
%88 = load i32, i32* %87
%89 = load i32, i32* %84
%90 = icmp eq i32 %88, %89
br i1 %90, label %93, label %91
91: ; preds = %81
%92 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 66, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %93
93: ; preds = %81, %91
%94 = add nuw nsw i64 %83, 1
%95 = icmp eq i64 %94, 9
br i1 %95, label %99, label %96
96: ; preds = %93
%97 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %94
%98 = load i32, i32* %97
br label %81
99: ; preds = %93
%100 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %80, i32 9, i32 1)
%101 = icmp eq i32 %100, -1
br i1 %101, label %104, label %102
102: ; preds = %99
%103 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %104
104: ; preds = %99, %102
%105 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %80, i32 9, i32 3)
%106 = icmp eq i32 %105, -1
br i1 %106, label %109, label %107
107: ; preds = %104
%108 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 69, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %109
109: ; preds = %104, %107
%110 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %9, i32 1, i32 2)
%111 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %9, i32 1, i32 0)
%112 = icmp eq i32 %111, -1
br i1 %112, label %115, label %113
113: ; preds = %109
%114 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 76, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %115
115: ; preds = %109, %113
%116 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %9, i32 1, i32 1)
%117 = icmp eq i32 %116, -1
br i1 %117, label %120, label %118
118: ; preds = %115
%119 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 77, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %120
120: ; preds = %115, %118
%121 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %9, i32 1, i32 3)
%122 = icmp eq i32 %121, -1
br i1 %122, label %125, label %123
123: ; preds = %120
%124 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 78, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %125
125: ; preds = %120, %123
%126 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %9, i32 0, i32 1)
%127 = icmp eq i32 %126, -1
br i1 %127, label %130, label %128
128: ; preds = %125
%129 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 81, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %130
130: ; preds = %125, %128
%131 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %9, i32 0, i32 2)
%132 = icmp eq i32 %131, -1
br i1 %132, label %135, label %133
133: ; preds = %130
%134 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 82, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %135
135: ; preds = %130, %133
%136 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @call_bsearch to i32 (i32*, i32, i32, ...)*)(i32* %9, i32 0, i32 3)
%137 = icmp eq i32 %136, -1
br i1 %137, label %140, label %138
138: ; preds = %135
%139 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__test_assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 83, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.bsearch_test, i64 0, i64 0))
br label %140
140: ; preds = %135, %138
ret i32 0
}