#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 */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ atoi(char *);
scalar_t__ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char const *,
                           char *, char const *, ...);
int /*<<< orphan*/ free(char *);
scalar_t__ getline(char **, size_t *, int /*<<< orphan*/ *);
scalar_t__ isalpha(char);
scalar_t__ mktime(struct tm *);
int split(char **, char **, char **, char **, char **, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ *strptime(char *, char *, struct tm *);
int qhost_j_filter(FILE *in, FILE *out, const char *dot_domain,
                   const char *clus) {
  char *line[2] = {NULL, NULL};
  size_t line_size[2] = {0, 0};
  char *host = NULL;
  char *s0, *arch, *ncpu;
  int i = 0;
  while (1) {
    if (host == NULL) {
      if (getline(&line[i], &line_size[i], in) <= 0)
        goto out;
      if (!isalpha(*line[i]))
        continue;
    again:
      s0 = line[i];
      if (split(&s0, &host, &arch, &ncpu, (char **)NULL) != 3) {
        host = NULL;
        continue;
      }
      if (atoi(ncpu) == 0) {
        host = NULL;
        continue;
      }
    }
    int found_job = 0;
    while (1) {
      char *s1, *jobid, *pri, *owner, *title, *r;
      struct tm st_tm;
      if (getline(&line[!i], &line_size[!i], in) <= 0)
        goto out;
      s1 = line[!i];
      if (isalpha(*s1)) {
        if (!found_job)
          fprintf(out, "%s%s %s@%s\n", host, dot_domain, "IDLE", clus);
        i = !i;
        goto again;
      }
      if (split(&s1, &jobid, &pri, &title, &owner, &r, (char **)NULL) != 5 ||
          s1 == NULL)
        continue;
      if (strcmp(r, "r") != 0)
        continue;
      if (strptime(s1, "%m/%d/%Y %T", &st_tm) == NULL)
        continue;
      fprintf(out, "%s%s %s@%s %s %s %lld\n", host, dot_domain, jobid, clus,
              owner, title, (long long)mktime(&st_tm));
      found_job = 1;
    }
  }
out:
  free(line[0]);
  free(line[1]);
  if (fflush(out) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<qhost_j_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movq   $0x0,-0x58(%rbp)
movl   $0x0,-0x74(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    12c4 <qhost_j_filter+0x114>
movslq -0x74(%rbp),%rax
lea    -0x40(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
movslq -0x74(%rbp),%rax
lea    -0x50(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
call   10c0 <getline@plt>
cmp    $0x0,%rax
jg     123b <qhost_j_filter+0x8b>
jmp    14e1 <qhost_j_filter+0x331>
movslq -0x74(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rax
movsbl (%rax),%edi
call   10a0 <isalpha@plt>
cmp    $0x0,%rax
jne    125b <qhost_j_filter+0xab>
jmp    11fa <qhost_j_filter+0x4a>
jmp    1260 <qhost_j_filter+0xb0>
movslq -0x74(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rax
mov    %rax,-0x60(%rbp)
lea    -0x60(%rbp),%rdi
lea    -0x58(%rbp),%rsi
lea    -0x68(%rbp),%rdx
lea    -0x70(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1050 <split@plt>
cmp    $0x3,%eax
je     129f <qhost_j_filter+0xef>
movq   $0x0,-0x58(%rbp)
jmp    11fa <qhost_j_filter+0x4a>
mov    -0x70(%rbp),%rdi
call   10b0 <atoi@plt>
cmp    $0x0,%rax
jne    12bf <qhost_j_filter+0x10f>
movq   $0x0,-0x58(%rbp)
jmp    11fa <qhost_j_filter+0x4a>
jmp    12c4 <qhost_j_filter+0x114>
movl   $0x0,-0x78(%rbp)
cmpl   $0x0,-0x74(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
lea    -0x40(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
cmpl   $0x0,-0x74(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
lea    -0x50(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
call   10c0 <getline@plt>
cmp    $0x0,%rax
jg     1319 <qhost_j_filter+0x169>
jmp    14e1 <qhost_j_filter+0x331>
cmpl   $0x0,-0x74(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    -0x40(%rbp,%rax,8),%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
movsbl (%rax),%edi
call   10a0 <isalpha@plt>
cmp    $0x0,%rax
je     138d <qhost_j_filter+0x1dd>
cmpl   $0x0,-0x78(%rbp)
jne    1377 <qhost_j_filter+0x1c7>
mov    -0x18(%rbp),%rdi
mov    -0x58(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r9
lea    0xc97(%rip),%rsi
lea    0xc9c(%rip),%r8
mov    $0x0,%al
call   1070 <fprintf@plt>
cmpl   $0x0,-0x74(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x74(%rbp)
jmp    1260 <qhost_j_filter+0xb0>
lea    -0x80(%rbp),%rdi
lea    -0x88(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
lea    -0x98(%rbp),%r8
lea    -0xa8(%rbp),%r9
xor    %eax,%eax
movq   $0x0,(%rsp)
mov    $0x0,%al
call   1050 <split@plt>
cmp    $0x5,%eax
jne    13d9 <qhost_j_filter+0x229>
cmpq   $0x0,-0x80(%rbp)
jne    13de <qhost_j_filter+0x22e>
jmp    12cb <qhost_j_filter+0x11b>
mov    -0xa8(%rbp),%rdi
lea    0xc25(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1400 <qhost_j_filter+0x250>
jmp    12cb <qhost_j_filter+0x11b>
mov    -0x80(%rbp),%rdi
lea    0xc08(%rip),%rsi
lea    -0xb0(%rbp),%rdx
call   10d0 <strptime@plt>
cmp    $0x0,%rax
jne    1426 <qhost_j_filter+0x276>
jmp    12cb <qhost_j_filter+0x11b>
mov    -0x18(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0xb8(%rbp)
lea    -0xb0(%rbp),%rdi
call   1090 <mktime@plt>
mov    -0xe8(%rbp),%rdi
mov    -0xe0(%rbp),%rdx
mov    -0xd8(%rbp),%rcx
mov    -0xd0(%rbp),%r8
mov    -0xc8(%rbp),%r9
mov    -0xc0(%rbp),%r11
mov    -0xb8(%rbp),%r10
lea    0xb5f(%rip),%rsi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x78(%rbp)
jmp    12cb <qhost_j_filter+0x11b>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1080 <fflush@plt>
cmp    $0x0,%rax
jge    1512 <qhost_j_filter+0x362>
movl   $0xffffffff,-0x4(%rbp)
jmp    1519 <qhost_j_filter+0x369>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qhost_j_filter>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rcx,0x40(%rsp)
mov    %rdx,0x38(%rsp)
mov    %rsi,0x10(%rsp)
mov    %rdi,%r15
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x50(%rsp)
movq   $0x0,(%rsp)
lea    0x48(%rsp),%r12
xor    %r14d,%r14d
jmp    11f8 <qhost_j_filter+0x58>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movq   $0x0,(%rsp)
mov    %r14d,%eax
lea    (%rsp,%rax,8),%rbp
add    $0x20,%rbp
lea    (%rsp,%rax,8),%rbx
add    $0x50,%rbx
xor    %eax,%eax
test   %rax,%rax
jne    12b1 <qhost_j_filter+0x111>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   10b0 <getline@plt>
test   %rax,%rax
jle    147a <qhost_j_filter+0x2da>
mov    0x0(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isalpha@plt>
test   %rax,%rax
jne    1265 <qhost_j_filter+0xc5>
mov    (%rsp),%rax
test   %rax,%rax
je     1220 <qhost_j_filter+0x80>
jmp    12b1 <qhost_j_filter+0x111>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x48(%rsp),%r12
mov    %r14d,%eax
mov    0x20(%rsp,%rax,8),%rax
mov    %rax,0x48(%rsp)
mov    %r12,%rdi
mov    %rsp,%rsi
lea    0xa0(%rsp),%rdx
lea    0x90(%rsp),%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <split@plt>
cmp    $0x3,%eax
jne    11f0 <qhost_j_filter+0x50>
mov    0x90(%rsp),%rdi
call   10a0 <atoi@plt>
test   %rax,%rax
je     11f0 <qhost_j_filter+0x50>
xor    %r13d,%r13d
test   %r14d,%r14d
sete   %r13b
lea    0x20(%rsp,%r13,8),%r12
lea    (%rsp,%r13,8),%rsi
add    $0x50,%rsi
mov    %r12,%rdi
mov    %r15,%rdx
call   10b0 <getline@plt>
test   %rax,%rax
jle    147a <qhost_j_filter+0x2da>
xor    %ebx,%ebx
test   %r14d,%r14d
sete   %bl
lea    0x20(%rsp,%rbx,8),%rbp
lea    0x50(%rsp,%rbx,8),%r14
mov    (%r12),%rax
mov    %rax,0x8(%rsp)
movsbl (%rax),%edi
call   1090 <isalpha@plt>
xor    %r12d,%r12d
test   %rax,%rax
jne    1440 <qhost_j_filter+0x2a0>
xor    %r12d,%r12d
xchg   %ax,%ax
sub    $0x8,%rsp
lea    0x10(%rsp),%rdi
lea    0x90(%rsp),%rsi
lea    0xa0(%rsp),%rdx
lea    0x80(%rsp),%rcx
lea    0x88(%rsp),%r8
lea    0x78(%rsp),%r9
xor    %eax,%eax
push   $0x0
call   1040 <split@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%rcx
cmp    $0x5,%eax
jne    1410 <qhost_j_filter+0x270>
test   %rcx,%rcx
je     1410 <qhost_j_filter+0x270>
mov    0x70(%rsp),%rdi
lea    0xca3(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1410 <qhost_j_filter+0x270>
mov    0x8(%rsp),%rdi
lea    0xc8b(%rip),%rsi
lea    0x18(%rsp),%rdx
call   10c0 <strptime@plt>
test   %rax,%rax
je     1410 <qhost_j_filter+0x270>
mov    (%rsp),%r13
mov    0x88(%rsp),%r12
mov    0x80(%rsp),%rax
mov    %rax,0x68(%rsp)
mov    0x78(%rsp),%rax
mov    %rax,0x60(%rsp)
lea    0x18(%rsp),%rdi
call   1080 <mktime@plt>
mov    %rbx,%r10
mov    %rax,%rbx
sub    $0x8,%rsp
mov    0x18(%rsp),%rdi
lea    0xc45(%rip),%rsi
mov    %r13,%rdx
mov    0x40(%rsp),%rcx
mov    %r12,%r8
mov    0x48(%rsp),%r9
xor    %eax,%eax
push   %rbx
mov    %r10,%rbx
push   0x70(%rsp)
push   0x80(%rsp)
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    $0x1,%r12d
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   10b0 <getline@plt>
test   %rax,%rax
jle    147a <qhost_j_filter+0x2da>
mov    0x0(%rbp),%rax
mov    %rax,0x8(%rsp)
movsbl (%rax),%edi
call   1090 <isalpha@plt>
test   %rax,%rax
je     1310 <qhost_j_filter+0x170>
mov    %ebx,%r13d
movzbl %r13b,%r14d
test   %r12d,%r12d
jne    1260 <qhost_j_filter+0xc0>
mov    (%rsp),%rdx
mov    0x10(%rsp),%rdi
lea    0xba3(%rip),%rsi
mov    0x38(%rsp),%rcx
lea    0xba3(%rip),%r8
mov    0x40(%rsp),%r9
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1260 <qhost_j_filter+0xc0>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1070 <fflush@plt>
sar    $0x3f,%rax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%s%s %s@%s\0A\00"
@.str.1 = [5 x i8] c"IDLE\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [12 x i8] c"%m/%d/%Y %T\00"
@.str.4 = [23 x i8] c"%s%s %s@%s %s %s %lld\0A\00"
define i32 @qhost_j_filter(i32* %0, i32* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca [2 x i8*]
%11 = alloca [2 x i64]
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca %struct.tm
store i32* %0, i32** %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%25 = bitcast [2 x i8*]* %10 to i8*
%26 = bitcast [2 x i64]* %11 to i8*
store i8* null, i8** %12
store i32 0, i32* %16
br label %27
27: ; preds = %4, %49, %58, %63
%28 = load i8*, i8** %12
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %65
30: ; preds = %27
%31 = load i32, i32* %16
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [2 x i8*], [2 x i8*]* %10, i64 0, i64 %32
%34 = load i32, i32* %16
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 %35
%37 = load i32*, i32** %6
%38 = call i64 @getline(i8** %33, i64* %36, i32* %37)
%39 = icmp sle i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %30
br label %136
41: ; preds = %30
%42 = load i32, i32* %16
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [2 x i8*], [2 x i8*]* %10, i64 0, i64 %43
%45 = load i8*, i8** %44
%46 = load i8, i8* %45
%47 = call i64 @isalpha(i8 signext %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %50, label %49
49: ; preds = %41
br label %27
50: ; preds = %41
br label %51
51: ; preds = %104, %50
%52 = load i32, i32* %16
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [2 x i8*], [2 x i8*]* %10, i64 0, i64 %53
%55 = load i8*, i8** %54
store i8* %55, i8** %13
%56 = call i32 (i8**, i8**, i8**, i8**, i8**, ...) @split(i8** %13, i8** %12, i8** %14, i8** %15, i8** null)
%57 = icmp ne i32 %56, 3
br i1 %57, label %58, label %59
58: ; preds = %51
store i8* null, i8** %12
br label %27
59: ; preds = %51
%60 = load i8*, i8** %15
%61 = call i64 @atoi(i8* %60)
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %59
store i8* null, i8** %12
br label %27
64: ; preds = %59
br label %65
65: ; preds = %64, %27
store i32 0, i32* %17
br label %66
66: ; preds = %65, %115, %120, %125, %126
%67 = load i32, i32* %16
%68 = icmp ne i32 %67, 0
%69 = xor i1 %68, true
%70 = zext i1 %69 to i32
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [2 x i8*], [2 x i8*]* %10, i64 0, i64 %71
%73 = load i32, i32* %16
%74 = icmp ne i32 %73, 0
%75 = xor i1 %74, true
%76 = zext i1 %75 to i32
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 %77
%79 = load i32*, i32** %6
%80 = call i64 @getline(i8** %72, i64* %78, i32* %79)
%81 = icmp sle i64 %80, 0
br i1 %81, label %82, label %83
82: ; preds = %66
br label %136
83: ; preds = %66
%84 = load i32, i32* %16
%85 = icmp ne i32 %84, 0
%86 = xor i1 %85, true
%87 = zext i1 %86 to i32
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [2 x i8*], [2 x i8*]* %10, i64 0, i64 %88
%90 = load i8*, i8** %89
store i8* %90, i8** %18
%91 = load i8*, i8** %18
%92 = load i8, i8* %91
%93 = call i64 @isalpha(i8 signext %92)
%94 = icmp ne i64 %93, 0
br i1 %94, label %95, label %109
95: ; preds = %83
%96 = load i32, i32* %17
%97 = icmp ne i32 %96, 0
br i1 %97, label %104, label %98
98: ; preds = %95
%99 = load i32*, i32** %7
%100 = load i8*, i8** %12
%101 = load i8*, i8** %8
%102 = load i8*, i8** %9
%103 = call i32 (i32*, i8*, i8*, i8*, i8*, i8*, ...) @fprintf(i32* %99, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %100, i8* %101, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %102)
br label %104
104: ; preds = %98, %95
%105 = load i32, i32* %16
%106 = icmp ne i32 %105, 0
%107 = xor i1 %106, true
%108 = zext i1 %107 to i32
store i32 %108, i32* %16
br label %51
109: ; preds = %83
%110 = call i32 (i8**, i8**, i8**, i8**, i8**, ...) @split(i8** %18, i8** %19, i8** %20, i8** %22, i8** %21, i8** %23, i8** null)
%111 = icmp ne i32 %110, 5
br i1 %111, label %115, label %112
112: ; preds = %109
%113 = load i8*, i8** %18
%114 = icmp eq i8* %113, null
br i1 %114, label %115, label %116
115: ; preds = %112, %109
br label %66
116: ; preds = %112
%117 = load i8*, i8** %23
%118 = call i64 @strcmp(i8* %117, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %121
120: ; preds = %116
br label %66
121: ; preds = %116
%122 = load i8*, i8** %18
%123 = call i32* @strptime(i8* %122, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %24)
%124 = icmp eq i32* %123, null
br i1 %124, label %125, label %126
125: ; preds = %121
br label %66
126: ; preds = %121
%127 = load i32*, i32** %7
%128 = load i8*, i8** %12
%129 = load i8*, i8** %8
%130 = load i8*, i8** %19
%131 = load i8*, i8** %9
%132 = load i8*, i8** %21
%133 = load i8*, i8** %22
%134 = call i64 @mktime(%struct.tm* %24)
%135 = call i32 (i32*, i8*, i8*, i8*, i8*, i8*, ...) @fprintf(i32* %127, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %128, i8* %129, i8* %130, i8* %131, i8* %132, i8* %133, i64 %134)
store i32 1, i32* %17
br label %66
136: ; preds = %82, %40
%137 = getelementptr inbounds [2 x i8*], [2 x i8*]* %10, i64 0, i64 0
%138 = load i8*, i8** %137
%139 = call i32 @free(i8* %138)
%140 = getelementptr inbounds [2 x i8*], [2 x i8*]* %10, i64 0, i64 1
%141 = load i8*, i8** %140
%142 = call i32 @free(i8* %141)
%143 = load i32*, i32** %7
%144 = call i64 @fflush(i32* %143)
%145 = icmp slt i64 %144, 0
br i1 %145, label %146, label %147
146: ; preds = %136
store i32 -1, i32* %5
br label %148
147: ; preds = %136
store i32 0, i32* %5
br label %148
148: ; preds = %147, %146
%149 = load i32, i32* %5
ret i32 %149
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%s%s %s@%s\0A\00"
@.str.1 = [5 x i8] c"IDLE\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [12 x i8] c"%m/%d/%Y %T\00"
@.str.4 = [23 x i8] c"%s%s %s@%s %s %s %lld\0A\00"
define i32 @qhost_j_filter(i32* %0, i32* nocapture %1, i8* %2, i8* %3) {
%5 = alloca [2 x i8*]
%6 = alloca [2 x i64]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca %struct.tm
%18 = bitcast [2 x i8*]* %5 to i8*
%19 = bitcast [2 x i64]* %6 to i8*
%20 = bitcast i8** %7 to i8*
store i8* null, i8** %7
%21 = bitcast i8** %8 to i8*
%22 = bitcast i8** %9 to i8*
%23 = bitcast i8** %10 to i8*
%24 = bitcast i8** %11 to i8*
%25 = bitcast i8** %12 to i8*
%26 = bitcast i8** %13 to i8*
%27 = bitcast i8** %14 to i8*
%28 = bitcast i8** %15 to i8*
%29 = bitcast i8** %16 to i8*
%30 = bitcast %struct.tm* %17 to i8*
br label %53
31: ; preds = %39
%32 = load i8*, i8** %7
br label %33
33: ; preds = %53, %31
%34 = phi i8* [ %32, %31 ], [ null, %53 ]
%35 = icmp eq i8* %34, null
br i1 %35, label %36, label %62
36: ; preds = %33
%37 = call i64 @getline(i8** %56, i64* %57, i32* %0)
%38 = icmp slt i64 %37, 1
br i1 %38, label %119, label %39
39: ; preds = %36
%40 = load i8*, i8** %56
%41 = load i8, i8* %40
%42 = call i64 @isalpha(i8 signext %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %31, label %45
44: ; preds = %90, %85
br label %45
45: ; preds = %39, %44
%46 = phi i32 [ %88, %44 ], [ %54, %39 ]
%47 = zext i32 %46 to i64
%48 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 %47
%49 = load i8*, i8** %48
store i8* %49, i8** %8
%50 = call i32 (i8**, i8**, i8**, i8**, i8**, ...) @split(i8** %8, i8** %7, i8** %9, i8** %10, i8** null)
%51 = icmp eq i32 %50, 3
br i1 %51, label %58, label %52
52: ; preds = %58, %45
store i8* null, i8** %7
br label %53
53: ; preds = %4, %52
%54 = phi i32 [ 0, %4 ], [ %46, %52 ]
%55 = zext i32 %54 to i64
%56 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 %55
%57 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 %55
br label %33
58: ; preds = %45
%59 = load i8*, i8** %10
%60 = call i64 @atoi(i8* %59)
%61 = icmp eq i64 %60, 0
br i1 %61, label %52, label %62
62: ; preds = %33, %58
%63 = phi i32 [ %46, %58 ], [ %54, %33 ]
%64 = icmp eq i32 %63, 0
%65 = zext i1 %64 to i64
%66 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 %65
%67 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 %65
%68 = call i64 @getline(i8** %66, i64* %67, i32* %0)
%69 = icmp slt i64 %68, 1
br i1 %69, label %79, label %70
70: ; preds = %62
%71 = icmp eq i32 %63, 0
%72 = zext i1 %71 to i64
%73 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 %72
%74 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 %72
%75 = load i8*, i8** %66
store i8* %75, i8** %11
%76 = load i8, i8* %75
%77 = call i64 @isalpha(i8 signext %76)
%78 = icmp eq i64 %77, 0
br i1 %78, label %93, label %85
79: ; preds = %62, %115
br label %119
80: ; preds = %115
%81 = load i8*, i8** %73
store i8* %81, i8** %11
%82 = load i8, i8* %81
%83 = call i64 @isalpha(i8 signext %82)
%84 = icmp eq i64 %83, 0
br i1 %84, label %93, label %85
85: ; preds = %80, %70
%86 = phi i1 [ %64, %70 ], [ %71, %80 ]
%87 = phi i32 [ 0, %70 ], [ %116, %80 ]
%88 = zext i1 %86 to i32
%89 = icmp eq i32 %87, 0
br i1 %89, label %90, label %44
90: ; preds = %85
%91 = load i8*, i8** %7
%92 = call i32 (i32*, i8*, i8*, i8*, i8*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %91, i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %44
93: ; preds = %70, %80
%94 = phi i32 [ %116, %80 ], [ 0, %70 ]
%95 = call i32 (i8**, i8**, i8**, i8**, i8**, ...) @split(i8** %11, i8** %12, i8** %13, i8** %15, i8** %14, i8** %16, i8** null)
%96 = icmp ne i32 %95, 5
%97 = load i8*, i8** %11
%98 = icmp eq i8* %97, null
%99 = select i1 %96, i1 true, i1 %98
br i1 %99, label %115, label %100
100: ; preds = %93
%101 = load i8*, i8** %16
%102 = call i64 @strcmp(i8* %101, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%103 = icmp eq i64 %102, 0
br i1 %103, label %104, label %115
104: ; preds = %100
%105 = load i8*, i8** %11
%106 = call i32* @strptime(i8* %105, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %17)
%107 = icmp eq i32* %106, null
br i1 %107, label %115, label %108
108: ; preds = %104
%109 = load i8*, i8** %7
%110 = load i8*, i8** %12
%111 = load i8*, i8** %14
%112 = load i8*, i8** %15
%113 = call i64 @mktime(%struct.tm* %17)
%114 = call i32 (i32*, i8*, i8*, i8*, i8*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %109, i8* %2, i8* %110, i8* %3, i8* %111, i8* %112, i64 %113)
br label %115
115: ; preds = %108, %93, %100, %104
%116 = phi i32 [ %94, %104 ], [ %94, %100 ], [ %94, %93 ], [ 1, %108 ]
%117 = call i64 @getline(i8** %73, i64* %74, i32* %0)
%118 = icmp slt i64 %117, 1
br i1 %118, label %79, label %80
119: ; preds = %36, %79
%120 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 0
%121 = load i8*, i8** %120
%122 = call i32 @free(i8* %121)
%123 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 1
%124 = load i8*, i8** %123
%125 = call i32 @free(i8* %124)
%126 = call i64 @fflush(i32* %1)
%127 = ashr i64 %126, 63
%128 = trunc i64 %127 to i32
ret i32 %128
}