#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*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int splits(char *, char **, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int parseEland(char *line, char *name, char *seq) {
  char *dest[128];
  int fldcount;
  fldcount = splits(line, dest, 128);
  if (fldcount < 2) {
    fprintf(stderr, "Bad field count on string '%s': n=%d\n", line, fldcount);
    return (1);
  }
  strcpy(name, dest[0] + 1);
  strcpy(seq, dest[1]);
  return (0);
}


x86 assembly (clang, -O0):
<parseEland>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    $0x80,%edx
call   1050 <splits@plt>
mov    %eax,-0x424(%rbp)
cmpl   $0x2,-0x424(%rbp)
jge    119a <parseEland+0x6a>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x424(%rbp),%ecx
lea    0xe77(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c5 <parseEland+0x95>
mov    -0x18(%rbp),%rdi
mov    -0x420(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x418(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseEland>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0x80,%edx
call   1050 <splits@plt>
cmp    $0x1,%eax
jg     1178 <parseEland+0x48>
mov    0x2e82(%rip),%rcx
mov    (%rcx),%edi
lea    0xe99(%rip),%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1040 <fprintf@plt>
mov    $0x1,%eax
jmp    1197 <parseEland+0x67>
mov    (%rsp),%rsi
add    $0x1,%rsi
mov    %r15,%rdi
call   1030 <strcpy@plt>
mov    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Bad field count on string '%s': n=%d\0A\00"
define i32 @parseEland(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [128 x i8*]
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%10 = load i8*, i8** %5
%11 = getelementptr inbounds [128 x i8*], [128 x i8*]* %8, i64 0, i64 0
%12 = call i32 @splits(i8* %10, i8** %11, i32 128)
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %5
%18 = load i32, i32* %9
%19 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18)
store i32 1, i32* %4
br label %30
20: ; preds = %3
%21 = load i8*, i8** %6
%22 = getelementptr inbounds [128 x i8*], [128 x i8*]* %8, i64 0, i64 0
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = call i32 @strcpy(i8* %21, i8* %24)
%26 = load i8*, i8** %7
%27 = getelementptr inbounds [128 x i8*], [128 x i8*]* %8, i64 0, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @strcpy(i8* %26, i8* %28)
store i32 0, i32* %4
br label %30
30: ; preds = %20, %15
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Bad field count on string '%s': n=%d\0A\00"
define i32 @parseEland(i8* %0, i8* %1, i8* %2) {
%4 = alloca [128 x i8*]
%5 = bitcast [128 x i8*]* %4 to i8*
%6 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 0
%7 = call i32 @splits(i8* %0, i8** %6, i32 128)
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %7)
br label %19
12: ; preds = %3
%13 = load i8*, i8** %6
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = call i32 @strcpy(i8* %1, i8* %14)
%16 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strcpy(i8* %2, i8* %17)
br label %19
19: ; preds = %12, %9
%20 = phi i32 [ 1, %9 ], [ 0, %12 ]
ret i32 %20
}