#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*/ memmove(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void sRemoveFirstString(char *sLine, char *sHead) {
  char *sTemp;
  int mylength;
  sTemp = sLine;
  while ((*sTemp != ' ') && (*sTemp != '\0'))
    sTemp++;
  if (*sTemp == '\0') {
    strcpy(sHead, sLine);
    *sLine = '\0';
    return;
  }
  *sTemp = '\0';
  strcpy(sHead, sLine);
  sTemp++;
  mylength = strlen(sTemp);
  memmove(sLine, sTemp, mylength);
  sLine[mylength] = '\0';
}


x86 assembly (clang, -O0):
<sRemoveFirstString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x1d(%rbp)
je     116d <sRemoveFirstString+0x3d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    117d <sRemoveFirstString+0x4d>
jmp    118e <sRemoveFirstString+0x5e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <sRemoveFirstString+0x18>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11b7 <sRemoveFirstString+0x87>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    11ff <sRemoveFirstString+0xcf>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <memmove@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sRemoveFirstString>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x1(%rdi),%rbx
nopl   0x0(%rax,%rax,1)
movzbl -0x1(%rbx),%eax
test   %al,%al
je     1152 <sRemoveFirstString+0x22>
cmp    $0x20,%al
je     115f <sRemoveFirstString+0x2f>
add    $0x1,%rbx
jmp    1140 <sRemoveFirstString+0x10>
mov    %rsi,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    118b <sRemoveFirstString+0x5b>
movb   $0x0,-0x1(%rbx)
mov    %rsi,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <memmove@plt>
movslq %ebp,%rax
add    %rax,%r14
movb   $0x0,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @sRemoveFirstString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
br label %8
8: ; preds = %20, %2
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 32
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ false, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
br label %8
23: ; preds = %18
%24 = load i8*, i8** %5
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %23
%29 = load i8*, i8** %4
%30 = load i8*, i8** %3
%31 = call i32 @strcpy(i8* %29, i8* %30)
%32 = load i8*, i8** %3
store i8 0, i8* %32
br label %50
33: ; preds = %23
%34 = load i8*, i8** %5
store i8 0, i8* %34
%35 = load i8*, i8** %4
%36 = load i8*, i8** %3
%37 = call i32 @strcpy(i8* %35, i8* %36)
%38 = load i8*, i8** %5
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %5
%40 = load i8*, i8** %5
%41 = call i32 @strlen(i8* %40)
store i32 %41, i32* %6
%42 = load i8*, i8** %3
%43 = load i8*, i8** %5
%44 = load i32, i32* %6
%45 = call i32 @memmove(i8* %42, i8* %43, i32 %44)
%46 = load i8*, i8** %3
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %46, i64 %48
store i8 0, i8* %49
br label %50
50: ; preds = %33, %28
ret void
}

LLVM IR (-O2):
define void @sRemoveFirstString(i8* %0, i8* %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i8* [ %0, %2 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 32, label %10
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %1, i8* %0)
br label %17
10: ; preds = %3
store i8 0, i8* %4
%11 = tail call i32 @strcpy(i8* %1, i8* %0)
%12 = getelementptr inbounds i8, i8* %4, i64 1
%13 = tail call i32 @strlen(i8* %12)
%14 = tail call i32 @memmove(i8* %0, i8* %12, i32 %13)
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
br label %17
17: ; preds = %10, %8
%18 = phi i8* [ %16, %10 ], [ %0, %8 ]
store i8 0, i8* %18
ret void
}