#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 *eatwhite(char *);
char *eatword(char *);
int strlen(char *);
int parse_command(char *com_string, char **comm, char **parameters) {
  *comm = com_string;
  com_string = eatword(com_string);
  if (*com_string) {
    *com_string++ = '\0';
    com_string = eatwhite(com_string);
  }
  *parameters = com_string;
  if (strlen(*comm) >= 50) {
    return 5;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <eatword@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1188 <parse_command+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1050 <eatwhite@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
cmp    $0x32,%eax
jl     11b4 <parse_command+0x84>
movl   $0x5,-0x4(%rbp)
jmp    11bb <parse_command+0x8b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_command>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,(%rsi)
call   1040 <eatword@plt>
cmpb   $0x0,(%rax)
je     1156 <parse_command+0x26>
mov    %rax,%rdi
add    $0x1,%rdi
movb   $0x0,(%rax)
call   1050 <eatwhite@plt>
mov    %rax,(%r14)
mov    (%rbx),%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x32,%eax
setge  %cl
lea    (%rcx,%rcx,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @parse_command(i8* %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8**
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8*, i8** %5
%9 = load i8**, i8*** %6
store i8* %8, i8** %9
%10 = load i8*, i8** %5
%11 = call i8* @eatword(i8* %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %5
store i8 0, i8* %16
%18 = load i8*, i8** %5
%19 = call i8* @eatwhite(i8* %18)
store i8* %19, i8** %5
br label %20
20: ; preds = %15, %3
%21 = load i8*, i8** %5
%22 = load i8**, i8*** %7
store i8* %21, i8** %22
%23 = load i8**, i8*** %6
%24 = load i8*, i8** %23
%25 = call i32 @strlen(i8* %24)
%26 = icmp sge i32 %25, 50
br i1 %26, label %27, label %28
27: ; preds = %20
store i32 5, i32* %4
br label %29
28: ; preds = %20
store i32 0, i32* %4
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @parse_command(i8* %0, i8** nocapture %1, i8** nocapture writeonly %2) {
store i8* %0, i8** %1
%4 = tail call i8* @eatword(i8* %0)
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %4
%9 = tail call i8* @eatwhite(i8* %8)
br label %10
10: ; preds = %7, %3
%11 = phi i8* [ %9, %7 ], [ %4, %3 ]
store i8* %11, i8** %2
%12 = load i8*, i8** %1
%13 = tail call i32 @strlen(i8* %12)
%14 = icmp sgt i32 %13, 49
%15 = select i1 %14, i32 5, i32 0
ret i32 %15
}