#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 *strstr(char const *, char *);
void get_start_fields(const char *start_line, int sllen,
                      const char **first_field, int *flen,
                      const char **second_field, int *slen,
                      const char **third_field, int *tlen) {
  *first_field = start_line;
  *second_field = strstr(*first_field, " ");
  *second_field += 1;
  *flen = *second_field - *first_field - 1;
  *third_field = strstr(*second_field, " ");
  *third_field += 1;
  *slen = *third_field - *second_field - 1;
  *tlen = sllen - *flen - *slen - 2;
}


x86 assembly (clang, -O0):
<get_start_fields>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
lea    0xe68(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
sub    (%rax),%ecx
mov    -0x30(%rbp),%rax
sub    (%rax),%ecx
sub    $0x2,%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_start_fields>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r15
mov    %r8,%r12
mov    %rcx,%r14
mov    %rdx,%r13
mov    %esi,%ebx
mov    0x40(%rsp),%rbp
mov    %rdi,(%rdx)
mov    $0x20,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rdi
mov    %rdi,(%r12)
mov    0x0(%r13),%eax
not    %eax
add    %edi,%eax
mov    %eax,(%r14)
mov    $0x20,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
mov    %rax,0x0(%rbp)
mov    (%r12),%ecx
not    %ecx
add    %ecx,%eax
mov    %eax,(%r15)
add    (%r14),%eax
sub    %eax,%ebx
add    $0xfffffffe,%ebx
mov    0x48(%rsp),%rax
mov    %ebx,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @get_start_fields(i8* %0, i32 %1, i8** %2, i32* %3, i8** %4, i32* %5, i8** %6, i32* %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i32*
%13 = alloca i8**
%14 = alloca i32*
%15 = alloca i8**
%16 = alloca i32*
store i8* %0, i8** %9
store i32 %1, i32* %10
store i8** %2, i8*** %11
store i32* %3, i32** %12
store i8** %4, i8*** %13
store i32* %5, i32** %14
store i8** %6, i8*** %15
store i32* %7, i32** %16
%17 = load i8*, i8** %9
%18 = load i8**, i8*** %11
store i8* %17, i8** %18
%19 = load i8**, i8*** %11
%20 = load i8*, i8** %19
%21 = call i8* @strstr(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = load i8**, i8*** %13
store i8* %21, i8** %22
%23 = load i8**, i8*** %13
%24 = load i8*, i8** %23
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8* %25, i8** %23
%26 = load i8**, i8*** %13
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %11
%29 = load i8*, i8** %28
%30 = ptrtoint i8* %27 to i64
%31 = ptrtoint i8* %29 to i64
%32 = sub i64 %30, %31
%33 = sub nsw i64 %32, 1
%34 = trunc i64 %33 to i32
%35 = load i32*, i32** %12
store i32 %34, i32* %35
%36 = load i8**, i8*** %13
%37 = load i8*, i8** %36
%38 = call i8* @strstr(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%39 = load i8**, i8*** %15
store i8* %38, i8** %39
%40 = load i8**, i8*** %15
%41 = load i8*, i8** %40
%42 = getelementptr inbounds i8, i8* %41, i64 1
store i8* %42, i8** %40
%43 = load i8**, i8*** %15
%44 = load i8*, i8** %43
%45 = load i8**, i8*** %13
%46 = load i8*, i8** %45
%47 = ptrtoint i8* %44 to i64
%48 = ptrtoint i8* %46 to i64
%49 = sub i64 %47, %48
%50 = sub nsw i64 %49, 1
%51 = trunc i64 %50 to i32
%52 = load i32*, i32** %14
store i32 %51, i32* %52
%53 = load i32, i32* %10
%54 = load i32*, i32** %12
%55 = load i32, i32* %54
%56 = sub nsw i32 %53, %55
%57 = load i32*, i32** %14
%58 = load i32, i32* %57
%59 = sub nsw i32 %56, %58
%60 = sub nsw i32 %59, 2
%61 = load i32*, i32** %16
store i32 %60, i32* %61
ret void
}

LLVM IR (-O2):
define void @get_start_fields(i8* %0, i32 %1, i8** nocapture %2, i32* nocapture %3, i8** nocapture %4, i32* nocapture writeonly %5, i8** nocapture writeonly %6, i32* nocapture writeonly %7) {
store i8* %0, i8** %2
%9 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 32)
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %4
%11 = load i8*, i8** %2
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = xor i64 %13, -1
%15 = add i64 %14, %12
%16 = trunc i64 %15 to i32
store i32 %16, i32* %3
%17 = tail call i8* @strchr(i8* dereferenceable(1) %10, i32 32)
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8* %18, i8** %6
%19 = load i8*, i8** %4
%20 = ptrtoint i8* %18 to i64
%21 = ptrtoint i8* %19 to i64
%22 = xor i64 %21, -1
%23 = add i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %5
%25 = load i32, i32* %3
%26 = add i32 %1, -2
%27 = add i32 %25, %24
%28 = sub i32 %26, %27
store i32 %28, i32* %7
ret void
}