int verify_scene(char *body) {
  int j;
  int cmdc, tokc, count;
  char **cmdv, **tokv;
  char *sp;
  sp = strdup(body);
  tokenize(sp, ";", &cmdc, &cmdv);
  count = 0;
  for (j = 0; j < cmdc; j++) {
    strtrim(cmdv[j]);
    if (*cmdv[j] == '\0')
      continue;
    count++;
    tokenize(cmdv[j], " \t", &tokc, &tokv);
    if (direct_command(tokc, tokv, 0) != 0) {
      free(tokv);
      free(cmdv);
      free(sp);
      return 1;
    }
    free(tokv);
  }
  free(cmdv);
  free(sp);
  if (!count) {
    store_error_message("Warning: Contains no commands.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<verify_scene>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <strdup@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xe7c(%rip),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1050 <tokenize@plt>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    125f <verify_scene+0xff>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1060 <strtrim@plt>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11dd <verify_scene+0x7d>
jmp    1251 <verify_scene+0xf1>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe09(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x0,%al
call   1050 <tokenize@plt>
mov    -0x1c(%rbp),%edi
mov    -0x30(%rbp),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1070 <direct_command@plt>
cmp    $0x0,%eax
je     1248 <verify_scene+0xe8>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    1290 <verify_scene+0x130>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a1 <verify_scene+0x41>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x20(%rbp)
jne    1289 <verify_scene+0x129>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1040 <store_error_message@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_scene>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
call   1080 <strdup@plt>
mov    %rax,%r15
lea    0xe83(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rax,%rdi
xor    %eax,%eax
call   1050 <tokenize@plt>
cmpl   $0x0,0xc(%rsp)
mov    $0x0,%ebx
jle    1221 <verify_scene+0xc1>
lea    0xe5a(%rip),%r12
lea    0x24(%rsp),%r13
lea    0x18(%rsp),%rbp
xor    %r14d,%r14d
xor    %ebx,%ebx
jmp    11ce <verify_scene+0x6e>
nopl   0x0(%rax)
add    $0x1,%r14
movslq 0xc(%rsp),%rax
cmp    %rax,%r14
jge    1221 <verify_scene+0xc1>
mov    0x10(%rsp),%rax
mov    (%rax,%r14,8),%rdi
xor    %eax,%eax
call   1060 <strtrim@plt>
mov    0x10(%rsp),%rax
mov    (%rax,%r14,8),%rdi
cmpb   $0x0,(%rdi)
je     11c0 <verify_scene+0x60>
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1050 <tokenize@plt>
mov    0x24(%rsp),%edi
mov    0x18(%rsp),%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1070 <direct_command@plt>
test   %eax,%eax
jne    124e <verify_scene+0xee>
add    $0x1,%ebx
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
jmp    11c0 <verify_scene+0x60>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
test   %ebx,%ebx
mov    $0x0,%ebx
jne    126f <verify_scene+0x10f>
lea    0xdc2(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <store_error_message@plt>
jmp    126f <verify_scene+0x10f>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c";\00"
@.str.1 = [3 x i8] c" \09\00"
@.str.2 = [31 x i8] c"Warning: Contains no commands.\00"
define i32 @verify_scene(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i8*
store i8* %0, i8** %3
%11 = load i8*, i8** %3
%12 = call i8* @strdup(i8* %11)
store i8* %12, i8** %10
%13 = load i8*, i8** %10
%14 = call i32 (i8*, i8*, i32*, i8***, ...) bitcast (i32 (...)* @tokenize to i32 (i8*, i8*, i32*, i8***, ...)*)(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, i8*** %8)
store i32 0, i32* %7
store i32 0, i32* %4
br label %15
15: ; preds = %57, %1
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %60
19: ; preds = %15
%20 = load i8**, i8*** %8
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @strtrim to i32 (i8*, ...)*)(i8* %24)
%26 = load i8**, i8*** %8
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %19
br label %57
35: ; preds = %19
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
%38 = load i8**, i8*** %8
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = call i32 (i8*, i8*, i32*, i8***, ...) bitcast (i32 (...)* @tokenize to i32 (i8*, i8*, i32*, i8***, ...)*)(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6, i8*** %9)
%44 = load i32, i32* %6
%45 = load i8**, i8*** %9
%46 = call i32 (i32, i8**, i32, ...) bitcast (i32 (...)* @direct_command to i32 (i32, i8**, i32, ...)*)(i32 %44, i8** %45, i32 0)
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %54
48: ; preds = %35
%49 = load i8**, i8*** %9
%50 = bitcast i8** %49 to i8*
%51 = load i8**, i8*** %8
%52 = bitcast i8** %51 to i8*
%53 = load i8*, i8** %10
store i32 1, i32* %2
br label %69
54: ; preds = %35
%55 = load i8**, i8*** %9
%56 = bitcast i8** %55 to i8*
br label %57
57: ; preds = %54, %34
%58 = load i32, i32* %4
%59 = add nsw i32 %58, 1
store i32 %59, i32* %4
br label %15
60: ; preds = %15
%61 = load i8**, i8*** %8
%62 = bitcast i8** %61 to i8*
%63 = load i8*, i8** %10
%64 = load i32, i32* %7
%65 = icmp ne i32 %64, 0
br i1 %65, label %68, label %66
66: ; preds = %60
%67 = call i32 (i8*, ...) bitcast (i32 (...)* @store_error_message to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %68
68: ; preds = %66, %60
store i32 0, i32* %2
br label %69
69: ; preds = %68, %48
%70 = load i32, i32* %2
ret i32 %70
}

LLVM IR (-O2):
@.str = [2 x i8] c";\00"
@.str.1 = [3 x i8] c" \09\00"
@.str.2 = [31 x i8] c"Warning: Contains no commands.\00"
define i32 @verify_scene(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8**
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i8*** %4 to i8*
%9 = bitcast i8*** %5 to i8*
%10 = tail call i8* @strdup(i8* %0)
%11 = call i32 (i8*, i8*, i32*, i8***, ...) bitcast (i32 (...)* @tokenize to i32 (i8*, i8*, i32*, i8***, ...)*)(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %2, i8*** %4)
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %47
14: ; preds = %1
%15 = bitcast i8*** %5 to i8**
br label %16
16: ; preds = %14, %41
%17 = phi i64 [ 0, %14 ], [ %43, %41 ]
%18 = phi i32 [ 0, %14 ], [ %42, %41 ]
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 %17
%21 = load i8*, i8** %20
%22 = call i32 (i8*, ...) bitcast (i32 (...)* @strtrim to i32 (i8*, ...)*)(i8* %21)
%23 = load i8**, i8*** %4
%24 = getelementptr inbounds i8*, i8** %23, i64 %17
%25 = load i8*, i8** %24
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 0
br i1 %27, label %41, label %28
28: ; preds = %16
%29 = call i32 (i8*, i8*, i32*, i8***, ...) bitcast (i32 (...)* @tokenize to i32 (i8*, i8*, i32*, i8***, ...)*)(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3, i8*** %5)
%30 = load i32, i32* %3
%31 = load i8**, i8*** %5
%32 = call i32 (i32, i8**, i32, ...) bitcast (i32 (...)* @direct_command to i32 (i32, i8**, i32, ...)*)(i32 %30, i8** %31, i32 0)
%33 = icmp eq i32 %32, 0
br i1 %33, label %38, label %34
34: ; preds = %28
%35 = load i8*, i8** %15
%36 = bitcast i8*** %4 to i8**
%37 = load i8*, i8** %36
br label %54
38: ; preds = %28
%39 = add nsw i32 %18, 1
%40 = load i8*, i8** %15
br label %41
41: ; preds = %16, %38
%42 = phi i32 [ %18, %16 ], [ %39, %38 ]
%43 = add nuw nsw i64 %17, 1
%44 = load i32, i32* %2
%45 = sext i32 %44 to i64
%46 = icmp slt i64 %43, %45
br i1 %46, label %16, label %47
47: ; preds = %41, %1
%48 = phi i32 [ 0, %1 ], [ %42, %41 ]
%49 = bitcast i8*** %4 to i8**
%50 = load i8*, i8** %49
%51 = icmp eq i32 %48, 0
br i1 %51, label %52, label %54
52: ; preds = %47
%53 = call i32 (i8*, ...) bitcast (i32 (...)* @store_error_message to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %54
54: ; preds = %47, %52, %34
%55 = phi i32 [ 1, %34 ], [ 0, %52 ], [ 0, %47 ]
ret i32 %55
}