#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 MakeArgs(char *, char **, int, int);
int strcspn(char *, char *);
int command_Interpret(char *buff, int nb, char *argv[40]) {
  char *cp;
  if (nb > 0) {
    cp = buff + strcspn(buff, "\r\n");
    if (cp)
      *cp = '\0';
    return MakeArgs(buff, argv, 40, 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<command_Interpret>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1196 <command_Interpret+0x76>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strcspn@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1177 <command_Interpret+0x57>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x28,%edx
mov    $0x1,%ecx
call   1040 <MakeArgs@plt>
mov    %eax,-0x4(%rbp)
jmp    119d <command_Interpret+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_Interpret>:
test   %esi,%esi
jle    1164 <command_Interpret+0x44>
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
je     1148 <command_Interpret+0x28>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcspn@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x28,%edx
mov    $0x1,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <MakeArgs@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @command_Interpret(i8* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i8*, i8** %5
%14 = call i32 @strcspn(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8* %16, i8** %8
%17 = load i8*, i8** %8
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = load i8*, i8** %8
store i8 0, i8* %20
br label %21
21: ; preds = %19, %11
%22 = load i8*, i8** %5
%23 = load i8**, i8*** %7
%24 = call i32 @MakeArgs(i8* %22, i8** %23, i32 40, i32 1)
store i32 %24, i32* %4
br label %26
25: ; preds = %3
store i32 0, i32* %4
br label %26
26: ; preds = %25, %21
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @command_Interpret(i8* %0, i32 %1, i8** %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = icmp eq i8* %0, null
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = tail call i32 @strcspn(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %7, %5
%12 = tail call i32 @MakeArgs(i8* %0, i8** %2, i32 40, i32 1)
br label %13
13: ; preds = %3, %11
%14 = phi i32 [ %12, %11 ], [ 0, %3 ]
ret i32 %14
}