#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*/ isspace(char);
char *malloc(int);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *spc_slt(char *argstr) {
  char *rstpnt = argstr;
  while (!isspace(*argstr) && (*argstr) != '\0')
    argstr++;
  int token_s = strlen(rstpnt) - strlen(argstr);
  char *tempstr = malloc(token_s + 1);
  argstr = rstpnt;
  strncpy(tempstr, argstr, token_s);
  return tempstr;
}


x86 assembly (clang, -O0):
<spc_slt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
jne    1180 <spc_slt+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1190 <spc_slt+0x50>
jmp    11a1 <spc_slt+0x61>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <spc_slt+0x14>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spc_slt>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1050 <isspace@plt>
mov    %r14,%rbx
test   %eax,%eax
jne    1176 <spc_slt+0x36>
mov    %r14,%rbx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rbx)
je     1176 <spc_slt+0x36>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1050 <isspace@plt>
test   %eax,%eax
je     1160 <spc_slt+0x20>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1040 <strlen@plt>
sub    %eax,%r15d
lea    0x1(%r15),%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @spc_slt(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %3
br label %7
7: ; preds = %19, %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call i32 @isspace(i8 signext %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ false, %7 ], [ %16, %12 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %7
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = call i32 @strlen(i8* %23)
%25 = load i8*, i8** %2
%26 = call i32 @strlen(i8* %25)
%27 = sub nsw i32 %24, %26
store i32 %27, i32* %4
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
%30 = call i8* @malloc(i32 %29)
store i8* %30, i8** %5
%31 = load i8*, i8** %3
store i8* %31, i8** %2
%32 = load i8*, i8** %5
%33 = load i8*, i8** %2
%34 = load i32, i32* %4
%35 = call i32 @strncpy(i8* %32, i8* %33, i32 %34)
%36 = load i8*, i8** %5
ret i8* %36
}

LLVM IR (-O2):
define i8* @spc_slt(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isspace(i8 signext %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1, %9
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = tail call i32 @isspace(i8 signext %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %5, label %14
14: ; preds = %5, %9, %1
%15 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %5 ]
%16 = tail call i32 @strlen(i8* %0)
%17 = tail call i32 @strlen(i8* %15)
%18 = sub nsw i32 %16, %17
%19 = add nsw i32 %18, 1
%20 = tail call i8* @malloc(i32 %19)
%21 = tail call i32 @strncpy(i8* %20, i8* %0, i32 %18)
ret i8* %20
}