#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ bss_log(char *, char *, int);
double calc_wgt(int);
int i0(char *, char *);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, ...);
scalar_t__ strchr(char *, char);
int strlen(char *);
char *strstr(char *, char *);
int okapi_search(int nkeywords, char **keywords, int *docset, int *npostings) {
  int no_terms;
  char stem[1024];
  char gsl_class;
  char source[1024];
  int set;
  int np;
  double weight;
  int current_term;
  int length;
  int chars_read;
  int return_code;
  char bss_command[1024];
  char bss_result[1024];
  char *result_buffer;
  char find_command[1024];
  char find_result[1024];
  char *find_buffer;
  char search_command[1024];
  char search_result[1024];
  char *search_buffer;
  if (nkeywords <= 0)
    return 1;
  sprintf(search_command, "f");
  char *keyword;
  int n = nkeywords;
  while (n--) {
    keyword = *keywords++;
    sprintf(bss_command, "sp t=%s", keyword);
    if ((return_code = i0(bss_command, bss_result)) != 0) {
      bss_log("bass_search", bss_command, return_code);
      return -1;
    }
    bss_result[strlen(bss_result) - 1] = '\0';
    result_buffer = bss_result;
    sscanf(result_buffer, "%d %n", &no_terms, &chars_read);
    result_buffer += chars_read;
    for (current_term = 0; current_term < no_terms; current_term++) {
      result_buffer += 2;
      length = strstr(result_buffer, " c=") - result_buffer;
      memcpy(stem, result_buffer, length);
      stem[length] = '\0';
      result_buffer += length + 1;
      sscanf(result_buffer, "c=%c s=%n", &gsl_class, &chars_read);
      result_buffer += chars_read;
      if (current_term < no_terms - 1) {
        length = strstr(result_buffer, " t=") - result_buffer;
        memcpy(source, result_buffer, length);
        source[length] = '\0';
        result_buffer += length + 1;
      } else {
        length = strlen(result_buffer) - 1;
        sprintf(source, "%s", result_buffer);
        source[length] = '\0';
      }
      if (strchr("FH", gsl_class) == 0) {
        sprintf(find_command, "f t=%s", stem);
        if ((return_code = i0(find_command, find_result)) != 0) {
          bss_log("bass_search", find_command, return_code);
          return -1;
        }
        find_result[strlen(find_result) - 1] = '\0';
        find_buffer = find_result;
        sscanf(find_buffer, "S%d np=%d", &set, &np);
        if (np > 0) {
          weight = calc_wgt(np);
          sprintf(search_command + strlen(search_command), " s=%d w=%.3f", set,
                  weight);
        } else {
          sprintf(bss_command, "delete %d", set);
          if ((return_code = i0(bss_command, bss_result)) != 0) {
            bss_log("term_input()", bss_command, return_code);
            return -1;
          }
        }
      }
    }
  }
  if (strlen(search_command) > 1) {
    sprintf(search_command + strlen(search_command), " op=bm25");
    if ((return_code = i0(search_command, search_result)) != 0) {
      bss_log("term_input()", search_command, return_code);
      *docset = -1;
      *npostings = -1;
      return -1;
    }
    search_buffer = search_result;
    sscanf(search_buffer, "S%d np=%d", docset, npostings);
    return 0;
  } else {
    *docset = -1;
    *npostings = -1;
    return 1;
  }
}


x86 assembly (clang, -O0):
<okapi_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20b0,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     11c0 <okapi_search+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1717 <okapi_search+0x587>
lea    -0x1c80(%rbp),%rdi
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x2094(%rbp)
mov    -0x2094(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x2094(%rbp)
cmp    $0x0,%eax
je     1621 <okapi_search+0x491>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x2090(%rbp)
lea    -0xc60(%rbp),%rdi
mov    -0x2090(%rbp),%rdx
lea    0xdda(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0xc60(%rbp),%rdi
lea    -0x1060(%rbp),%rsi
call   10a0 <i0@plt>
mov    %eax,-0x860(%rbp)
cmp    $0x0,%eax
je     1274 <okapi_search+0xe4>
lea    -0xc60(%rbp),%rsi
mov    -0x860(%rbp),%edx
lea    0xda5(%rip),%rdi
call   1080 <bss_log@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1717 <okapi_search+0x587>
lea    -0x1060(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x1060(%rbp,%rax,1)
lea    -0x1060(%rbp),%rax
mov    %rax,-0x1068(%rbp)
mov    -0x1068(%rbp),%rdi
lea    0xd6b(%rip),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x85c(%rbp),%rcx
mov    $0x0,%al
call   1070 <sscanf@plt>
mov    -0x85c(%rbp),%ecx
mov    -0x1068(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x1068(%rbp)
movl   $0x0,-0x854(%rbp)
mov    -0x854(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    161c <okapi_search+0x48c>
mov    -0x1068(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x1068(%rbp)
mov    -0x1068(%rbp),%rdi
lea    0xd0c(%rip),%rsi
call   10b0 <strstr@plt>
mov    -0x1068(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x858(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x1068(%rbp),%rsi
mov    -0x858(%rbp),%edx
call   1060 <memcpy@plt>
movslq -0x858(%rbp),%rax
movb   $0x0,-0x430(%rbp,%rax,1)
mov    -0x858(%rbp),%ecx
add    $0x1,%ecx
mov    -0x1068(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x1068(%rbp)
mov    -0x1068(%rbp),%rdi
lea    0xca8(%rip),%rsi
lea    -0x431(%rbp),%rdx
lea    -0x85c(%rbp),%rcx
mov    $0x0,%al
call   1070 <sscanf@plt>
mov    -0x85c(%rbp),%ecx
mov    -0x1068(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x1068(%rbp)
mov    -0x854(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1426 <okapi_search+0x296>
mov    -0x1068(%rbp),%rdi
lea    0xc61(%rip),%rsi
call   10b0 <strstr@plt>
mov    -0x1068(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x858(%rbp)
lea    -0x840(%rbp),%rdi
mov    -0x1068(%rbp),%rsi
mov    -0x858(%rbp),%edx
call   1060 <memcpy@plt>
movslq -0x858(%rbp),%rax
movb   $0x0,-0x840(%rbp,%rax,1)
mov    -0x858(%rbp),%ecx
add    $0x1,%ecx
mov    -0x1068(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x1068(%rbp)
jmp    1466 <okapi_search+0x2d6>
mov    -0x1068(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x858(%rbp)
lea    -0x840(%rbp),%rdi
mov    -0x1068(%rbp),%rdx
lea    0xbe3(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
movslq -0x858(%rbp),%rax
movb   $0x0,-0x840(%rbp,%rax,1)
lea    0xbbf(%rip),%rdi
movsbl -0x431(%rbp),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
jne    1603 <okapi_search+0x473>
lea    -0x1470(%rbp),%rdi
lea    -0x430(%rbp),%rdx
lea    0xb97(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0x1470(%rbp),%rdi
lea    -0x1870(%rbp),%rsi
call   10a0 <i0@plt>
mov    %eax,-0x860(%rbp)
cmp    $0x0,%eax
je     14e6 <okapi_search+0x356>
lea    -0x1470(%rbp),%rsi
mov    -0x860(%rbp),%edx
lea    0xb33(%rip),%rdi
call   1080 <bss_log@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1717 <okapi_search+0x587>
lea    -0x1870(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x1870(%rbp,%rax,1)
lea    -0x1870(%rbp),%rax
mov    %rax,-0x1878(%rbp)
mov    -0x1878(%rbp),%rdi
lea    0xb1b(%rip),%rsi
lea    -0x844(%rbp),%rdx
lea    -0x848(%rbp),%rcx
mov    $0x0,%al
call   1070 <sscanf@plt>
cmpl   $0x0,-0x848(%rbp)
jle    1597 <okapi_search+0x407>
mov    -0x848(%rbp),%edi
call   1050 <calc_wgt@plt>
movsd  %xmm0,-0x850(%rbp)
ff
lea    -0x1c80(%rbp),%rax
mov    %rax,-0x20a0(%rbp)
lea    -0x1c80(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20a0(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x844(%rbp),%edx
movsd  -0x850(%rbp),%xmm0
ff
lea    0xab5(%rip),%rsi
mov    $0x1,%al
call   1090 <sprintf@plt>
jmp    15fe <okapi_search+0x46e>
lea    -0xc60(%rbp),%rdi
mov    -0x844(%rbp),%edx
lea    0xaa2(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0xc60(%rbp),%rdi
lea    -0x1060(%rbp),%rsi
call   10a0 <i0@plt>
mov    %eax,-0x860(%rbp)
cmp    $0x0,%eax
je     15f9 <okapi_search+0x469>
lea    -0xc60(%rbp),%rsi
mov    -0x860(%rbp),%edx
lea    0xa6f(%rip),%rdi
call   1080 <bss_log@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1717 <okapi_search+0x587>
jmp    15fe <okapi_search+0x46e>
jmp    1603 <okapi_search+0x473>
jmp    1608 <okapi_search+0x478>
mov    -0x854(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x854(%rbp)
jmp    12df <okapi_search+0x14f>
jmp    11de <okapi_search+0x4e>
lea    -0x1c80(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jle    16fc <okapi_search+0x56c>
lea    -0x1c80(%rbp),%rax
mov    %rax,-0x20a8(%rbp)
lea    -0x1c80(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20a8(%rbp),%rdi
cltq
add    %rax,%rdi
lea    0xa01(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0x1c80(%rbp),%rdi
lea    -0x2080(%rbp),%rsi
call   10a0 <i0@plt>
mov    %eax,-0x860(%rbp)
cmp    $0x0,%eax
je     16c5 <okapi_search+0x535>
lea    -0x1c80(%rbp),%rsi
mov    -0x860(%rbp),%edx
lea    0x9b7(%rip),%rdi
call   1080 <bss_log@plt>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x20(%rbp),%rax
movl   $0xffffffff,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1717 <okapi_search+0x587>
lea    -0x2080(%rbp),%rax
mov    %rax,-0x2088(%rbp)
mov    -0x2088(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0x94d(%rip),%rsi
mov    $0x0,%al
call   1070 <sscanf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1717 <okapi_search+0x587>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x20(%rbp),%rax
movl   $0xffffffff,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<okapi_search>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2048,%rsp
mov    $0x1,%r14d
test   %edi,%edi
jle    14bc <okapi_search+0x31c>
mov    %rsi,%rbp
mov    %edi,%ebx
mov    %rdx,0x18(%rsp)
mov    %rcx,0x20(%rsp)
movabs $0x100000000,%r12
movw   $0x66,0x40(%rsp)
lea    0x1840(%rsp),%r14
jmp    1208 <okapi_search+0x68>
nopl   0x0(%rax)
mov    0x28(%rsp),%ebx
add    $0xffffffff,%ebx
mov    0x30(%rsp),%rbp
add    $0x8,%rbp
test   %ebx,%ebx
je     14d1 <okapi_search+0x331>
mov    0x0(%rbp),%rdx
lea    0x440(%rsp),%r15
mov    %r15,%rdi
lea    0xde2(%rip),%rsi
xor    %eax,%eax
call   10a0 <sprintf@plt>
mov    %r15,%rdi
lea    0x840(%rsp),%r15
mov    %r15,%rsi
call   10b0 <i0@plt>
test   %eax,%eax
jne    14a0 <okapi_search+0x300>
mov    %ebx,0x28(%rsp)
mov    %rbp,0x30(%rsp)
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r15,1)
mov    %r15,%rdi
lea    0xdb1(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1080 <sscanf@plt>
cmpl   $0x0,0x10(%rsp)
jle    11f0 <okapi_search+0x50>
movslq 0xc(%rsp),%rax
lea    (%rsp,%rax,1),%rbx
add    $0x840,%rbx
xor    %r15d,%r15d
jmp    12e6 <okapi_search+0x146>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1060 <calc_wgt@plt>
movsd  %xmm0,0x38(%rsp)
lea    0x40(%rsp),%rdi
call   1040 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rdi
add    $0x40,%rdi
mov    0x14(%rsp),%edx
lea    0xd76(%rip),%rsi
movsd  0x38(%rsp),%xmm0
mov    $0x1,%al
call   10a0 <sprintf@plt>
add    $0x1,%r15d
cmp    0x10(%rsp),%r15d
jge    11f0 <okapi_search+0x50>
mov    %r12,%rbp
lea    0x2(%rbx),%r12
mov    %r12,%rdi
lea    0xd23(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,%r13
sub    %r12,%r13
lea    0xc40(%rsp),%rdi
mov    %r12,%rsi
mov    %rbp,%r12
mov    %r13d,%edx
call   1070 <memcpy@plt>
mov    %r13,%rax
shl    $0x20,%rax
movslq %r13d,%rcx
movb   $0x0,0xc40(%rsp,%rcx,1)
add    %rbp,%rax
sar    $0x20,%rax
lea    (%rbx,%rax,1),%rbp
add    $0x2,%rbp
mov    %rbp,%rdi
lea    0xcdb(%rip),%rsi
lea    0xb(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1080 <sscanf@plt>
movslq 0xc(%rsp),%rbx
add    %rbp,%rbx
mov    0x10(%rsp),%eax
add    $0xffffffff,%eax
mov    %rbx,%rdi
cmp    %eax,%r15d
jge    13b0 <okapi_search+0x210>
lea    0xcb6(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,%rbp
sub    %rbx,%rbp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1070 <memcpy@plt>
mov    %rbp,%rax
shl    $0x20,%rax
movslq %ebp,%rcx
movb   $0x0,0x1840(%rsp,%rcx,1)
add    %r12,%rax
sar    $0x20,%rax
add    %rax,%rbx
jmp    13c9 <okapi_search+0x229>
nopl   0x0(%rax,%rax,1)
call   1040 <strlen@plt>
movslq %eax,%rbp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movb   $0x0,-0x1(%rbp,%r14,1)
movsbl 0xb(%rsp),%esi
lea    0xc57(%rip),%rdi
call   1050 <strchr@plt>
test   %rax,%rax
jne    12d7 <okapi_search+0x137>
lea    0x1440(%rsp),%rbp
mov    %rbp,%rdi
lea    0xc3a(%rip),%rsi
lea    0xc40(%rsp),%rdx
xor    %eax,%eax
call   10a0 <sprintf@plt>
mov    %rbp,%rdi
lea    0x1c40(%rsp),%rbp
mov    %rbp,%rsi
call   10b0 <i0@plt>
test   %eax,%eax
jne    148f <okapi_search+0x2ef>
mov    %rbp,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %rbp,%rdi
lea    0xc02(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x2c(%rsp),%rcx
xor    %eax,%eax
call   1080 <sscanf@plt>
mov    0x2c(%rsp),%edi
test   %edi,%edi
jg     12a0 <okapi_search+0x100>
mov    0x14(%rsp),%edx
lea    0x440(%rsp),%rbp
mov    %rbp,%rdi
lea    0xbe6(%rip),%rsi
xor    %eax,%eax
call   10a0 <sprintf@plt>
mov    %rbp,%rdi
lea    0x840(%rsp),%rsi
call   10b0 <i0@plt>
test   %eax,%eax
je     12d7 <okapi_search+0x137>
lea    0xbca(%rip),%rdi
jmp    14a7 <okapi_search+0x307>
lea    0xb72(%rip),%rdi
lea    0x1440(%rsp),%rsi
jmp    14af <okapi_search+0x30f>
lea    0xb61(%rip),%rdi
lea    0x440(%rsp),%rsi
mov    %eax,%edx
call   1090 <bss_log@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x2048,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x40(%rsp),%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jl     1545 <okapi_search+0x3a5>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movabs $0x35326d623d706f20,%rcx
6d 32 35
mov    %rcx,0x40(%rsp,%rax,1)
movb   $0x0,0x48(%rsp,%rax,1)
lea    0x1040(%rsp),%rsi
mov    %rbx,%rdi
call   10b0 <i0@plt>
test   %eax,%eax
je     1566 <okapi_search+0x3c6>
lea    0xb39(%rip),%rdi
lea    0x40(%rsp),%rsi
mov    %eax,%edx
call   1090 <bss_log@plt>
mov    0x18(%rsp),%rax
movl   $0xffffffff,(%rax)
mov    0x20(%rsp),%rax
movl   $0xffffffff,(%rax)
jmp    14b6 <okapi_search+0x316>
mov    0x18(%rsp),%rax
movl   $0xffffffff,(%rax)
mov    0x20(%rsp),%rax
movl   $0xffffffff,(%rax)
mov    $0x1,%r14d
jmp    14bc <okapi_search+0x31c>
lea    0xac9(%rip),%rsi
xor    %r14d,%r14d
lea    0x1040(%rsp),%rdi
mov    0x18(%rsp),%rdx
mov    0x20(%rsp),%rcx
xor    %eax,%eax
call   1080 <sscanf@plt>
jmp    14bc <okapi_search+0x31c>

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
@.str.1 = [8 x i8] c"sp t=%s\00"
@.str.2 = [12 x i8] c"bass_search\00"
@.str.3 = [6 x i8] c"%d %n\00"
@.str.4 = [4 x i8] c" c=\00"
@.str.5 = [10 x i8] c"c=%c s=%n\00"
@.str.6 = [4 x i8] c" t=\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [3 x i8] c"FH\00"
@.str.9 = [7 x i8] c"f t=%s\00"
@.str.10 = [10 x i8] c"S%d np=%d\00"
@.str.11 = [13 x i8] c" s=%d w=%.3f\00"
@.str.12 = [10 x i8] c"delete %d\00"
@.str.13 = [13 x i8] c"term_input()\00"
@.str.14 = [9 x i8] c" op=bm25\00"
define i32 @okapi_search(i32 %0, i8** %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca [1024 x i8]
%12 = alloca i8
%13 = alloca [1024 x i8]
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [1024 x i8]
%22 = alloca [1024 x i8]
%23 = alloca i8*
%24 = alloca [1024 x i8]
%25 = alloca [1024 x i8]
%26 = alloca i8*
%27 = alloca [1024 x i8]
%28 = alloca [1024 x i8]
%29 = alloca i8*
%30 = alloca i8*
%31 = alloca i32
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%32 = load i32, i32* %6
%33 = icmp sle i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %4
store i32 1, i32* %5
br label %224
35: ; preds = %4
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %27, i64 0, i64 0
%37 = call i32 (i8*, i8*, ...) @sprintf(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%38 = load i32, i32* %6
store i32 %38, i32* %31
br label %39
39: ; preds = %193, %35
%40 = load i32, i32* %31
%41 = add nsw i32 %40, -1
store i32 %41, i32* %31
%42 = icmp ne i32 %40, 0
br i1 %42, label %43, label %194
43: ; preds = %39
%44 = load i8**, i8*** %7
%45 = getelementptr inbounds i8*, i8** %44, i32 1
store i8** %45, i8*** %7
%46 = load i8*, i8** %44
store i8* %46, i8** %30
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %21, i64 0, i64 0
%48 = load i8*, i8** %30
%49 = call i32 (i8*, i8*, ...) @sprintf(i8* %47, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %48)
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %21, i64 0, i64 0
%51 = getelementptr inbounds [1024 x i8], [1024 x i8]* %22, i64 0, i64 0
%52 = call i32 @i0(i8* %50, i8* %51)
store i32 %52, i32* %20
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %43
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %21, i64 0, i64 0
%56 = load i32, i32* %20
%57 = call i32 @bss_log(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %55, i32 %56)
store i32 -1, i32* %5
br label %224
58: ; preds = %43
%59 = getelementptr inbounds [1024 x i8], [1024 x i8]* %22, i64 0, i64 0
%60 = call i32 @strlen(i8* %59)
%61 = sub nsw i32 %60, 1
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %22, i64 0, i64 %62
store i8 0, i8* %63
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %22, i64 0, i64 0
store i8* %64, i8** %23
%65 = load i8*, i8** %23
%66 = call i32 (i8*, i8*, ...) @sscanf(i8* %65, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %10, i32* %19)
%67 = load i32, i32* %19
%68 = load i8*, i8** %23
%69 = sext i32 %67 to i64
%70 = getelementptr inbounds i8, i8* %68, i64 %69
store i8* %70, i8** %23
store i32 0, i32* %17
br label %71
71: ; preds = %190, %58
%72 = load i32, i32* %17
%73 = load i32, i32* %10
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %193
75: ; preds = %71
%76 = load i8*, i8** %23
%77 = getelementptr inbounds i8, i8* %76, i64 2
store i8* %77, i8** %23
%78 = load i8*, i8** %23
%79 = call i8* @strstr(i8* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%80 = load i8*, i8** %23
%81 = ptrtoint i8* %79 to i64
%82 = ptrtoint i8* %80 to i64
%83 = sub i64 %81, %82
%84 = trunc i64 %83 to i32
store i32 %84, i32* %18
%85 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%86 = load i8*, i8** %23
%87 = load i32, i32* %18
%88 = call i32 @memcpy(i8* %85, i8* %86, i32 %87)
%89 = load i32, i32* %18
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 %90
store i8 0, i8* %91
%92 = load i32, i32* %18
%93 = add nsw i32 %92, 1
%94 = load i8*, i8** %23
%95 = sext i32 %93 to i64
%96 = getelementptr inbounds i8, i8* %94, i64 %95
store i8* %96, i8** %23
%97 = load i8*, i8** %23
%98 = call i32 (i8*, i8*, ...) @sscanf(i8* %97, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %12, i32* %19)
%99 = load i32, i32* %19
%100 = load i8*, i8** %23
%101 = sext i32 %99 to i64
%102 = getelementptr inbounds i8, i8* %100, i64 %101
store i8* %102, i8** %23
%103 = load i32, i32* %17
%104 = load i32, i32* %10
%105 = sub nsw i32 %104, 1
%106 = icmp slt i32 %103, %105
br i1 %106, label %107, label %127
107: ; preds = %75
%108 = load i8*, i8** %23
%109 = call i8* @strstr(i8* %108, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%110 = load i8*, i8** %23
%111 = ptrtoint i8* %109 to i64
%112 = ptrtoint i8* %110 to i64
%113 = sub i64 %111, %112
%114 = trunc i64 %113 to i32
store i32 %114, i32* %18
%115 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%116 = load i8*, i8** %23
%117 = load i32, i32* %18
%118 = call i32 @memcpy(i8* %115, i8* %116, i32 %117)
%119 = load i32, i32* %18
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %120
store i8 0, i8* %121
%122 = load i32, i32* %18
%123 = add nsw i32 %122, 1
%124 = load i8*, i8** %23
%125 = sext i32 %123 to i64
%126 = getelementptr inbounds i8, i8* %124, i64 %125
store i8* %126, i8** %23
br label %137
127: ; preds = %75
%128 = load i8*, i8** %23
%129 = call i32 @strlen(i8* %128)
%130 = sub nsw i32 %129, 1
store i32 %130, i32* %18
%131 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%132 = load i8*, i8** %23
%133 = call i32 (i8*, i8*, ...) @sprintf(i8* %131, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %132)
%134 = load i32, i32* %18
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %135
store i8 0, i8* %136
br label %137
137: ; preds = %127, %107
%138 = load i8, i8* %12
%139 = call i64 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8 signext %138)
%140 = icmp eq i64 %139, 0
br i1 %140, label %141, label %189
141: ; preds = %137
%142 = getelementptr inbounds [1024 x i8], [1024 x i8]* %24, i64 0, i64 0
%143 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%144 = call i32 (i8*, i8*, ...) @sprintf(i8* %142, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %143)
%145 = getelementptr inbounds [1024 x i8], [1024 x i8]* %24, i64 0, i64 0
%146 = getelementptr inbounds [1024 x i8], [1024 x i8]* %25, i64 0, i64 0
%147 = call i32 @i0(i8* %145, i8* %146)
store i32 %147, i32* %20
%148 = icmp ne i32 %147, 0
br i1 %148, label %149, label %153
149: ; preds = %141
%150 = getelementptr inbounds [1024 x i8], [1024 x i8]* %24, i64 0, i64 0
%151 = load i32, i32* %20
%152 = call i32 @bss_log(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %150, i32 %151)
store i32 -1, i32* %5
br label %224
153: ; preds = %141
%154 = getelementptr inbounds [1024 x i8], [1024 x i8]* %25, i64 0, i64 0
%155 = call i32 @strlen(i8* %154)
%156 = sub nsw i32 %155, 1
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds [1024 x i8], [1024 x i8]* %25, i64 0, i64 %157
store i8 0, i8* %158
%159 = getelementptr inbounds [1024 x i8], [1024 x i8]* %25, i64 0, i64 0
store i8* %159, i8** %26
%160 = load i8*, i8** %26
%161 = call i32 (i8*, i8*, ...) @sscanf(i8* %160, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32* %14, i32* %15)
%162 = load i32, i32* %15
%163 = icmp sgt i32 %162, 0
br i1 %163, label %164, label %175
164: ; preds = %153
%165 = load i32, i32* %15
%166 = call double @calc_wgt(i32 %165)
store double %166, double* %16
%167 = getelementptr inbounds [1024 x i8], [1024 x i8]* %27, i64 0, i64 0
%168 = getelementptr inbounds [1024 x i8], [1024 x i8]* %27, i64 0, i64 0
%169 = call i32 @strlen(i8* %168)
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds i8, i8* %167, i64 %170
%172 = load i32, i32* %14
%173 = load double, double* %16
%174 = call i32 (i8*, i8*, ...) @sprintf(i8* %171, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %172, double %173)
br label %188
175: ; preds = %153
%176 = getelementptr inbounds [1024 x i8], [1024 x i8]* %21, i64 0, i64 0
%177 = load i32, i32* %14
%178 = call i32 (i8*, i8*, ...) @sprintf(i8* %176, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %177)
%179 = getelementptr inbounds [1024 x i8], [1024 x i8]* %21, i64 0, i64 0
%180 = getelementptr inbounds [1024 x i8], [1024 x i8]* %22, i64 0, i64 0
%181 = call i32 @i0(i8* %179, i8* %180)
store i32 %181, i32* %20
%182 = icmp ne i32 %181, 0
br i1 %182, label %183, label %187
183: ; preds = %175
%184 = getelementptr inbounds [1024 x i8], [1024 x i8]* %21, i64 0, i64 0
%185 = load i32, i32* %20
%186 = call i32 @bss_log(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8* %184, i32 %185)
store i32 -1, i32* %5
br label %224
187: ; preds = %175
br label %188
188: ; preds = %187, %164
br label %189
189: ; preds = %188, %137
br label %190
190: ; preds = %189
%191 = load i32, i32* %17
%192 = add nsw i32 %191, 1
store i32 %192, i32* %17
br label %71
193: ; preds = %71
br label %39
194: ; preds = %39
%195 = getelementptr inbounds [1024 x i8], [1024 x i8]* %27, i64 0, i64 0
%196 = call i32 @strlen(i8* %195)
%197 = icmp sgt i32 %196, 1
br i1 %197, label %198, label %221
198: ; preds = %194
%199 = getelementptr inbounds [1024 x i8], [1024 x i8]* %27, i64 0, i64 0
%200 = getelementptr inbounds [1024 x i8], [1024 x i8]* %27, i64 0, i64 0
%201 = call i32 @strlen(i8* %200)
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds i8, i8* %199, i64 %202
%204 = call i32 (i8*, i8*, ...) @sprintf(i8* %203, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
%205 = getelementptr inbounds [1024 x i8], [1024 x i8]* %27, i64 0, i64 0
%206 = getelementptr inbounds [1024 x i8], [1024 x i8]* %28, i64 0, i64 0
%207 = call i32 @i0(i8* %205, i8* %206)
store i32 %207, i32* %20
%208 = icmp ne i32 %207, 0
br i1 %208, label %209, label %215
209: ; preds = %198
%210 = getelementptr inbounds [1024 x i8], [1024 x i8]* %27, i64 0, i64 0
%211 = load i32, i32* %20
%212 = call i32 @bss_log(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8* %210, i32 %211)
%213 = load i32*, i32** %8
store i32 -1, i32* %213
%214 = load i32*, i32** %9
store i32 -1, i32* %214
store i32 -1, i32* %5
br label %224
215: ; preds = %198
%216 = getelementptr inbounds [1024 x i8], [1024 x i8]* %28, i64 0, i64 0
store i8* %216, i8** %29
%217 = load i8*, i8** %29
%218 = load i32*, i32** %8
%219 = load i32*, i32** %9
%220 = call i32 (i8*, i8*, ...) @sscanf(i8* %217, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32* %218, i32* %219)
store i32 0, i32* %5
br label %224
221: ; preds = %194
%222 = load i32*, i32** %8
store i32 -1, i32* %222
%223 = load i32*, i32** %9
store i32 -1, i32* %223
store i32 1, i32* %5
br label %224
224: ; preds = %221, %215, %209, %183, %149, %54, %34
%225 = load i32, i32* %5
ret i32 %225
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"sp t=%s\00"
@.str.2 = [12 x i8] c"bass_search\00"
@.str.3 = [6 x i8] c"%d %n\00"
@.str.4 = [4 x i8] c" c=\00"
@.str.5 = [10 x i8] c"c=%c s=%n\00"
@.str.6 = [4 x i8] c" t=\00"
@.str.8 = [3 x i8] c"FH\00"
@.str.9 = [7 x i8] c"f t=%s\00"
@.str.10 = [10 x i8] c"S%d np=%d\00"
@.str.11 = [13 x i8] c" s=%d w=%.3f\00"
@.str.12 = [10 x i8] c"delete %d\00"
@.str.13 = [13 x i8] c"term_input()\00"
@.str.14 = [9 x i8] c" op=bm25\00"
define i32 @okapi_search(i32 %0, i8** nocapture %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca [1024 x i8]
%7 = alloca i8
%8 = alloca [1024 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [1024 x i8]
%13 = alloca [1024 x i8]
%14 = alloca [1024 x i8]
%15 = alloca [1024 x i8]
%16 = alloca [1024 x i8]
%17 = alloca [1024 x i8]
%18 = bitcast i32* %5 to i8*
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%21 = bitcast i32* %9 to i8*
%22 = bitcast i32* %10 to i8*
%23 = bitcast i32* %11 to i8*
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 0
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%30 = icmp slt i32 %0, 1
br i1 %30, label %151, label %31
31: ; preds = %4
%32 = bitcast [1024 x i8]* %16 to i16*
store i16 102, i16* %32
br label %35
33: ; preds = %133, %46
%34 = icmp eq i32 %38, 0
br i1 %34, label %137, label %35
35: ; preds = %31, %33
%36 = phi i32 [ %0, %31 ], [ %38, %33 ]
%37 = phi i8** [ %1, %31 ], [ %39, %33 ]
%38 = add nsw i32 %36, -1
%39 = getelementptr inbounds i8*, i8** %37, i64 1
%40 = load i8*, i8** %37
%41 = call i32 (i8*, i8*, ...) @sprintf(i8* %24, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %40)
%42 = call i32 @i0(i8* %24, i8* %25)
%43 = icmp eq i32 %42, 0
br i1 %43, label %46, label %44
44: ; preds = %35
%45 = call i32 @bss_log(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %24, i32 %42)
br label %151
46: ; preds = %35
%47 = call i32 @strlen(i8* %25)
%48 = add nsw i32 %47, -1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %49
store i8 0, i8* %50
%51 = call i32 (i8*, i8*, ...) @sscanf(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %5, i32* %11)
%52 = load i32, i32* %5
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %33
54: ; preds = %46
%55 = load i32, i32* %11
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %56
br label %58
58: ; preds = %54, %133
%59 = phi i32 [ %134, %133 ], [ 0, %54 ]
%60 = phi i8* [ %101, %133 ], [ %57, %54 ]
%61 = getelementptr inbounds i8, i8* %60, i64 2
%62 = call i8* @strstr(i8* %61, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%63 = ptrtoint i8* %62 to i64
%64 = ptrtoint i8* %61 to i64
%65 = sub i64 %63, %64
%66 = trunc i64 %65 to i32
%67 = call i32 @memcpy(i8* %19, i8* %61, i32 %66)
%68 = shl i64 %65, 32
%69 = ashr exact i64 %68, 32
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 %69
store i8 0, i8* %70
%71 = add i64 %68, 4294967296
%72 = ashr exact i64 %71, 32
%73 = getelementptr inbounds i8, i8* %61, i64 %72
%74 = call i32 (i8*, i8*, ...) @sscanf(i8* %73, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %7, i32* %11)
%75 = load i32, i32* %11
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8, i8* %73, i64 %76
%78 = load i32, i32* %5
%79 = add nsw i32 %78, -1
%80 = icmp slt i32 %59, %79
br i1 %80, label %81, label %94
81: ; preds = %58
%82 = call i8* @strstr(i8* %77, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%83 = ptrtoint i8* %82 to i64
%84 = ptrtoint i8* %77 to i64
%85 = sub i64 %83, %84
%86 = trunc i64 %85 to i32
%87 = call i32 @memcpy(i8* %20, i8* %77, i32 %86)
%88 = shl i64 %85, 32
%89 = ashr exact i64 %88, 32
%90 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %89
store i8 0, i8* %90
%91 = add i64 %88, 4294967296
%92 = ashr exact i64 %91, 32
%93 = getelementptr inbounds i8, i8* %77, i64 %92
br label %100
94: ; preds = %58
%95 = call i32 @strlen(i8* %77)
%96 = add nsw i32 %95, -1
%97 = call i8* @strcpy(i8* %20, i8* %77)
%98 = sext i32 %96 to i64
%99 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %98
store i8 0, i8* %99
br label %100
100: ; preds = %94, %81
%101 = phi i8* [ %93, %81 ], [ %77, %94 ]
%102 = load i8, i8* %7
%103 = call i64 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8 signext %102)
%104 = icmp eq i64 %103, 0
br i1 %104, label %105, label %133
105: ; preds = %100
%106 = call i32 (i8*, i8*, ...) @sprintf(i8* %26, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %19)
%107 = call i32 @i0(i8* %26, i8* %27)
%108 = icmp eq i32 %107, 0
br i1 %108, label %111, label %109
109: ; preds = %105
%110 = call i32 @bss_log(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %26, i32 %107)
br label %151
111: ; preds = %105
%112 = call i32 @strlen(i8* %27)
%113 = add nsw i32 %112, -1
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 %114
store i8 0, i8* %115
%116 = call i32 (i8*, i8*, ...) @sscanf(i8* %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32* %9, i32* %10)
%117 = load i32, i32* %10
%118 = icmp sgt i32 %117, 0
br i1 %118, label %119, label %126
119: ; preds = %111
%120 = call double @calc_wgt(i32 %117)
%121 = call i32 @strlen(i8* %28)
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 %122
%124 = load i32, i32* %9
%125 = call i32 (i8*, i8*, ...) @sprintf(i8* %123, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %124, double %120)
br label %133
126: ; preds = %111
%127 = load i32, i32* %9
%128 = call i32 (i8*, i8*, ...) @sprintf(i8* %24, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %127)
%129 = call i32 @i0(i8* %24, i8* %25)
%130 = icmp eq i32 %129, 0
br i1 %130, label %133, label %131
131: ; preds = %126
%132 = call i32 @bss_log(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8* %24, i32 %129)
br label %151
133: ; preds = %100, %126, %119
%134 = add nuw nsw i32 %59, 1
%135 = load i32, i32* %5
%136 = icmp slt i32 %134, %135
br i1 %136, label %58, label %33
137: ; preds = %33
%138 = call i32 @strlen(i8* %28)
%139 = icmp sgt i32 %138, 1
br i1 %139, label %140, label %150
140: ; preds = %137
%141 = call i32 @strlen(i8* %28)
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 %142
%144 = call i32 @i0(i8* %28, i8* %29)
%145 = icmp eq i32 %144, 0
br i1 %145, label %148, label %146
146: ; preds = %140
%147 = call i32 @bss_log(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8* %28, i32 %144)
store i32 -1, i32* %2
store i32 -1, i32* %3
br label %151
148: ; preds = %140
%149 = call i32 (i8*, i8*, ...) @sscanf(i8* %29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32* %2, i32* %3)
br label %151
150: ; preds = %137
store i32 -1, i32* %2
store i32 -1, i32* %3
br label %151
151: ; preds = %44, %109, %131, %146, %148, %150, %4
%152 = phi i32 [ 1, %4 ], [ -1, %44 ], [ -1, %109 ], [ -1, %131 ], [ -1, %146 ], [ 0, %148 ], [ 1, %150 ]
ret i32 %152
}