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


x86 assembly (clang, -O0):
<parseSam>:
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   $0xa,-0x424(%rbp)
jge    119a <parseSam+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    11c1 <parseSam+0x91>
mov    -0x18(%rbp),%rdi
mov    -0x420(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x3d8(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseSam>:
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    $0x9,%eax
jg     1178 <parseSam+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    1193 <parseSam+0x63>
mov    (%rsp),%rsi
mov    %r15,%rdi
call   1030 <strcpy@plt>
mov    0x48(%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 @parseSam(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, 10
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 %29
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 = call i32 @strcpy(i8* %21, i8* %23)
%25 = load i8*, i8** %7
%26 = getelementptr inbounds [128 x i8*], [128 x i8*]* %8, i64 0, i64 9
%27 = load i8*, i8** %26
%28 = call i32 @strcpy(i8* %25, i8* %27)
store i32 0, i32* %4
br label %29
29: ; preds = %20, %15
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Bad field count on string '%s': n=%d\0A\00"
define i32 @parseSam(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, 10
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 %18
12: ; preds = %3
%13 = load i8*, i8** %6
%14 = call i32 @strcpy(i8* %1, i8* %13)
%15 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 9
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %2, i8* %16)
br label %18
18: ; preds = %12, %9
%19 = phi i32 [ 1, %9 ], [ 0, %12 ]
ret i32 %19
}