#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 */
char *strsep(char **, char *);
int strbreak(char *str, char **fields, int fields_size) {
  char *c = str;
  int i, num;
  (void)0;
  num = 0;
  for (i = 0;
       ((*fields = strsep(i < fields_size ? &c : NULL, "\n\t ")) != NULL); ++i)
    if ((*(*fields)) != '\0') {
      ++fields;
      ++num;
    }
  (void)0;
  return (num);
}


x86 assembly (clang, -O0):
<strbreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1152 <strbreak+0x42>
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    115d <strbreak+0x4d>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    115d <strbreak+0x4d>
mov    -0x30(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strsep@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     11b9 <strbreak+0xa9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11a6 <strbreak+0x96>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11ab <strbreak+0x9b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1139 <strbreak+0x29>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbreak>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r13
mov    %rdi,(%rsp)
xor    %ebx,%ebx
test   %edx,%edx
mov    %rsp,%rax
mov    $0x0,%edi
cmovg  %rax,%rdi
lea    0xec4(%rip),%rsi
call   1030 <strsep@plt>
mov    %rax,0x0(%r13)
test   %rax,%rax
je     11a3 <strbreak+0x93>
xor    %ebx,%ebx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %r12d,%r12d
cmpb   $0x0,(%rax)
setne  %r12b
lea    0x0(,%r12,8),%r15
add    %r13,%r15
add    %r12d,%ebx
cmp    %r14d,%ebp
mov    $0x0,%edi
mov    %rsp,%rax
cmovl  %rax,%rdi
lea    0xe72(%rip),%rsi
call   1030 <strsep@plt>
mov    %rax,0x0(%r13,%r12,8)
add    $0x1,%ebp
mov    %r15,%r13
test   %rax,%rax
jne    1160 <strbreak+0x50>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A\09 \00"
define i32 @strbreak(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
store i8* %10, i8** %7
store i32 0, i32* %9
store i32 0, i32* %8
br label %11
11: ; preds = %34, %3
%12 = load i32, i32* %8
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
br label %17
16: ; preds = %11
br label %17
17: ; preds = %16, %15
%18 = phi i8** [ %7, %15 ], [ null, %16 ]
%19 = call i8* @strsep(i8** %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%20 = load i8**, i8*** %5
store i8* %19, i8** %20
%21 = icmp ne i8* %19, null
br i1 %21, label %22, label %37
22: ; preds = %17
%23 = load i8**, i8*** %5
%24 = load i8*, i8** %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %22
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i32 1
store i8** %30, i8*** %5
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %33
33: ; preds = %28, %22
br label %34
34: ; preds = %33
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %11
37: ; preds = %17
%38 = load i32, i32* %9
ret i32 %38
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A\09 \00"
define i32 @strbreak(i8* %0, i8** nocapture writeonly %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
store i8* %0, i8** %4
%6 = icmp sgt i32 %2, 0
%7 = select i1 %6, i8** %4, i8** null
%8 = call i8* @strsep(i8** %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %1
%9 = icmp eq i8* %8, null
br i1 %9, label %26, label %10
10: ; preds = %3, %10
%11 = phi i8* [ %24, %10 ], [ %8, %3 ]
%12 = phi i32 [ %20, %10 ], [ 0, %3 ]
%13 = phi i32 [ %21, %10 ], [ 0, %3 ]
%14 = phi i8** [ %18, %10 ], [ %1, %3 ]
%15 = load i8, i8* %11
%16 = icmp ne i8 %15, 0
%17 = zext i1 %16 to i64
%18 = getelementptr i8*, i8** %14, i64 %17
%19 = zext i1 %16 to i32
%20 = add nuw nsw i32 %12, %19
%21 = add nuw nsw i32 %13, 1
%22 = icmp slt i32 %21, %2
%23 = select i1 %22, i8** %4, i8** null
%24 = call i8* @strsep(i8** %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %24, i8** %18
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %10
26: ; preds = %10, %3
%27 = phi i32 [ 0, %3 ], [ %20, %10 ]
ret i32 %27
}