#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 lineFile {
  int dummy;
};

/* Variables and functions */
int chopByChar(char *, char, char **, int);
scalar_t__ lineFileNext(struct lineFile *, char **, int *);
int lineFileChopNextTab(struct lineFile *lf, char *words[], int maxWords) {
  int lineSize, wordCount;
  char *line;
  while (lineFileNext(lf, &line, &lineSize)) {
    if (line[0] == '#')
      continue;
    wordCount = chopByChar(line, '\t', words, maxWords);
    if (wordCount != 0)
      return wordCount;
  }
  return 0;
}


x86 assembly (clang, -O0):
<lineFileChopNextTab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <lineFileNext@plt>
cmp    $0x0,%rax
je     1195 <lineFileChopNextTab+0x75>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1163 <lineFileChopNextTab+0x43>
jmp    1133 <lineFileChopNextTab+0x13>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x9,%esi
call   1040 <chopByChar@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1190 <lineFileChopNextTab+0x70>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119c <lineFileChopNextTab+0x7c>
jmp    1133 <lineFileChopNextTab+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineFileChopNextTab>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r14d
mov    %rsi,%r12
mov    %rdi,%rbp
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <lineFileNext@plt>
xor    %r15d,%r15d
test   %rax,%rax
je     1194 <lineFileChopNextTab+0x74>
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%rbx
jmp    1173 <lineFileChopNextTab+0x53>
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1030 <lineFileNext@plt>
test   %rax,%rax
je     1194 <lineFileChopNextTab+0x74>
mov    0x10(%rsp),%rdi
cmpb   $0x23,(%rdi)
je     1160 <lineFileChopNextTab+0x40>
mov    $0x9,%esi
mov    %r12,%rdx
mov    %r14d,%ecx
call   1040 <chopByChar@plt>
test   %eax,%eax
je     1160 <lineFileChopNextTab+0x40>
mov    %eax,%r15d
mov    %r15d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.lineFile = type { i32 }
define i32 @lineFileChopNextTab(%struct.lineFile* %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.lineFile*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store %struct.lineFile* %0, %struct.lineFile** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
br label %11
11: ; preds = %31, %21, %3
%12 = load %struct.lineFile*, %struct.lineFile** %5
%13 = call i64 @lineFileNext(%struct.lineFile* %12, i8** %10, i32* %8)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %32
15: ; preds = %11
%16 = load i8*, i8** %10
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 35
br i1 %20, label %21, label %22
21: ; preds = %15
br label %11
22: ; preds = %15
%23 = load i8*, i8** %10
%24 = load i8**, i8*** %6
%25 = load i32, i32* %7
%26 = call i32 @chopByChar(i8* %23, i8 signext 9, i8** %24, i32 %25)
store i32 %26, i32* %9
%27 = load i32, i32* %9
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %22
%30 = load i32, i32* %9
store i32 %30, i32* %4
br label %33
31: ; preds = %22
br label %11
32: ; preds = %11
store i32 0, i32* %4
br label %33
33: ; preds = %32, %29
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
%struct.lineFile = type { i32 }
define i32 @lineFileChopNextTab(%struct.lineFile* %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = bitcast i32* %4 to i8*
%7 = bitcast i8** %5 to i8*
%8 = call i64 @lineFileNext(%struct.lineFile* %0, i8** %5, i32* %4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %20, label %10
10: ; preds = %3, %14
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 35
br i1 %13, label %14, label %17
14: ; preds = %10, %17
%15 = call i64 @lineFileNext(%struct.lineFile* %0, i8** %5, i32* %4)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %10
17: ; preds = %10
%18 = call i32 @chopByChar(i8* %11, i8 signext 9, i8** %1, i32 %2)
%19 = icmp eq i32 %18, 0
br i1 %19, label %14, label %20
20: ; preds = %17, %14, %3
%21 = phi i32 [ 0, %3 ], [ 0, %14 ], [ %18, %17 ]
ret i32 %21
}