#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 createEndInstruction(char **, int);
int createGotoInstruction(char **, int);
int createIfInstruction(char **, int);
int createInputInstruction(char **, int);
int createLetInstruction(char **, int);
int createPrintInstruction(char **, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp2(char *, char *);
int createFirstSML(char tokenArray[][20], int numberOfTokens) {
  if (numberOfTokens == 0) {
    printf("Syntax Error!\n");
    return 0;
  }
  if (strcmp2(tokenArray[1], "rem") == 0)
    return 1;
  else if (strcmp2(tokenArray[1], "input") == 0)
    return createInputInstruction(tokenArray, numberOfTokens);
  else if (strcmp2(tokenArray[1], "print") == 0)
    return createPrintInstruction(tokenArray, numberOfTokens);
  else if (strcmp2(tokenArray[1], "goto") == 0)
    return createGotoInstruction(tokenArray, numberOfTokens);
  else if (strcmp2(tokenArray[1], "end") == 0)
    return createEndInstruction(tokenArray, numberOfTokens);
  else if (strcmp2(tokenArray[1], "if") == 0)
    return createIfInstruction(tokenArray, numberOfTokens);
  else if (strcmp2(tokenArray[1], "let") == 0)
    return createLetInstruction(tokenArray, numberOfTokens);
  else {
    printf("Syntax Error!\n");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<createFirstSML>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11b1 <createFirstSML+0x31>
lea    0xe60(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    131a <createFirstSML+0x19a>
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
lea    0xe4f(%rip),%rsi
call   1090 <strcmp2@plt>
cmp    $0x0,%rax
jne    11db <createFirstSML+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    131a <createFirstSML+0x19a>
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
lea    0xe29(%rip),%rsi
call   1090 <strcmp2@plt>
cmp    $0x0,%rax
jne    120d <createFirstSML+0x8d>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <createInputInstruction@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <createFirstSML+0x19a>
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
lea    0xdfd(%rip),%rsi
call   1090 <strcmp2@plt>
cmp    $0x0,%rax
jne    123f <createFirstSML+0xbf>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <createPrintInstruction@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <createFirstSML+0x19a>
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
lea    0xdd1(%rip),%rsi
call   1090 <strcmp2@plt>
cmp    $0x0,%rax
jne    1271 <createFirstSML+0xf1>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <createGotoInstruction@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <createFirstSML+0x19a>
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
lea    0xda4(%rip),%rsi
call   1090 <strcmp2@plt>
cmp    $0x0,%rax
jne    12a3 <createFirstSML+0x123>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <createEndInstruction@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <createFirstSML+0x19a>
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
lea    0xd76(%rip),%rsi
call   1090 <strcmp2@plt>
cmp    $0x0,%rax
jne    12d5 <createFirstSML+0x155>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   10a0 <createIfInstruction@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <createFirstSML+0x19a>
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
lea    0xd47(%rip),%rsi
call   1090 <strcmp2@plt>
cmp    $0x0,%rax
jne    1307 <createFirstSML+0x187>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1070 <createLetInstruction@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <createFirstSML+0x19a>
lea    0xcf2(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createFirstSML>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1225 <createFirstSML+0xa5>
mov    %esi,%ebp
mov    %rdi,%r14
lea    0x14(%rdi),%rbx
lea    0xe64(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp2@plt>
test   %rax,%rax
je     1235 <createFirstSML+0xb5>
lea    0xe50(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp2@plt>
test   %rax,%rax
je     123f <createFirstSML+0xbf>
lea    0xe42(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp2@plt>
test   %rax,%rax
je     124d <createFirstSML+0xcd>
lea    0xe34(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp2@plt>
test   %rax,%rax
je     125b <createFirstSML+0xdb>
lea    0xe25(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp2@plt>
test   %rax,%rax
je     1269 <createFirstSML+0xe9>
lea    0xe15(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp2@plt>
test   %rax,%rax
je     1277 <createFirstSML+0xf7>
lea    0xe04(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp2@plt>
test   %rax,%rax
je     1285 <createFirstSML+0x105>
lea    0xdf4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
jmp    123a <createFirstSML+0xba>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <createInputInstruction@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1080 <createPrintInstruction@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <createGotoInstruction@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <createEndInstruction@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10a0 <createIfInstruction@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1070 <createLetInstruction@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Syntax Error!\0A\00"
@.str.1 = [4 x i8] c"rem\00"
@.str.2 = [6 x i8] c"input\00"
@.str.3 = [6 x i8] c"print\00"
@.str.4 = [5 x i8] c"goto\00"
@.str.5 = [4 x i8] c"end\00"
@.str.6 = [3 x i8] c"if\00"
@.str.7 = [4 x i8] c"let\00"
define i32 @createFirstSML([20 x i8]* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [20 x i8]*
%5 = alloca i32
store [20 x i8]* %0, [20 x i8]** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %85
10: ; preds = %2
%11 = load [20 x i8]*, [20 x i8]** %4
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %11, i64 1
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%14 = call i64 @strcmp2(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %3
br label %85
17: ; preds = %10
%18 = load [20 x i8]*, [20 x i8]** %4
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %18, i64 1
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %19, i64 0, i64 0
%21 = call i64 @strcmp2(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %17
%24 = load [20 x i8]*, [20 x i8]** %4
%25 = bitcast [20 x i8]* %24 to i8**
%26 = load i32, i32* %5
%27 = call i32 @createInputInstruction(i8** %25, i32 %26)
store i32 %27, i32* %3
br label %85
28: ; preds = %17
%29 = load [20 x i8]*, [20 x i8]** %4
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %29, i64 1
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %30, i64 0, i64 0
%32 = call i64 @strcmp2(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %28
%35 = load [20 x i8]*, [20 x i8]** %4
%36 = bitcast [20 x i8]* %35 to i8**
%37 = load i32, i32* %5
%38 = call i32 @createPrintInstruction(i8** %36, i32 %37)
store i32 %38, i32* %3
br label %85
39: ; preds = %28
%40 = load [20 x i8]*, [20 x i8]** %4
%41 = getelementptr inbounds [20 x i8], [20 x i8]* %40, i64 1
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %41, i64 0, i64 0
%43 = call i64 @strcmp2(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %39
%46 = load [20 x i8]*, [20 x i8]** %4
%47 = bitcast [20 x i8]* %46 to i8**
%48 = load i32, i32* %5
%49 = call i32 @createGotoInstruction(i8** %47, i32 %48)
store i32 %49, i32* %3
br label %85
50: ; preds = %39
%51 = load [20 x i8]*, [20 x i8]** %4
%52 = getelementptr inbounds [20 x i8], [20 x i8]* %51, i64 1
%53 = getelementptr inbounds [20 x i8], [20 x i8]* %52, i64 0, i64 0
%54 = call i64 @strcmp2(i8* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %61
56: ; preds = %50
%57 = load [20 x i8]*, [20 x i8]** %4
%58 = bitcast [20 x i8]* %57 to i8**
%59 = load i32, i32* %5
%60 = call i32 @createEndInstruction(i8** %58, i32 %59)
store i32 %60, i32* %3
br label %85
61: ; preds = %50
%62 = load [20 x i8]*, [20 x i8]** %4
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %62, i64 1
%64 = getelementptr inbounds [20 x i8], [20 x i8]* %63, i64 0, i64 0
%65 = call i64 @strcmp2(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %72
67: ; preds = %61
%68 = load [20 x i8]*, [20 x i8]** %4
%69 = bitcast [20 x i8]* %68 to i8**
%70 = load i32, i32* %5
%71 = call i32 @createIfInstruction(i8** %69, i32 %70)
store i32 %71, i32* %3
br label %85
72: ; preds = %61
%73 = load [20 x i8]*, [20 x i8]** %4
%74 = getelementptr inbounds [20 x i8], [20 x i8]* %73, i64 1
%75 = getelementptr inbounds [20 x i8], [20 x i8]* %74, i64 0, i64 0
%76 = call i64 @strcmp2(i8* %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %83
78: ; preds = %72
%79 = load [20 x i8]*, [20 x i8]** %4
%80 = bitcast [20 x i8]* %79 to i8**
%81 = load i32, i32* %5
%82 = call i32 @createLetInstruction(i8** %80, i32 %81)
store i32 %82, i32* %3
br label %85
83: ; preds = %72
%84 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %85
85: ; preds = %83, %78, %67, %56, %45, %34, %23, %16, %8
%86 = load i32, i32* %3
ret i32 %86
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"rem\00"
@.str.2 = [6 x i8] c"input\00"
@.str.3 = [6 x i8] c"print\00"
@.str.4 = [5 x i8] c"goto\00"
@.str.5 = [4 x i8] c"end\00"
@.str.6 = [3 x i8] c"if\00"
@.str.7 = [4 x i8] c"let\00"
@str.8 = [14 x i8] c"Syntax Error!\00"
define i32 @createFirstSML([20 x i8]* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
br label %48
6: ; preds = %2
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 1, i64 0
%8 = tail call i64 @strcmp2(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %48, label %10
10: ; preds = %6
%11 = tail call i64 @strcmp2(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = bitcast [20 x i8]* %0 to i8**
%15 = tail call i32 @createInputInstruction(i8** %14, i32 %1)
br label %48
16: ; preds = %10
%17 = tail call i64 @strcmp2(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = bitcast [20 x i8]* %0 to i8**
%21 = tail call i32 @createPrintInstruction(i8** %20, i32 %1)
br label %48
22: ; preds = %16
%23 = tail call i64 @strcmp2(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = bitcast [20 x i8]* %0 to i8**
%27 = tail call i32 @createGotoInstruction(i8** %26, i32 %1)
br label %48
28: ; preds = %22
%29 = tail call i64 @strcmp2(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = bitcast [20 x i8]* %0 to i8**
%33 = tail call i32 @createEndInstruction(i8** %32, i32 %1)
br label %48
34: ; preds = %28
%35 = tail call i64 @strcmp2(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = bitcast [20 x i8]* %0 to i8**
%39 = tail call i32 @createIfInstruction(i8** %38, i32 %1)
br label %48
40: ; preds = %34
%41 = tail call i64 @strcmp2(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = bitcast [20 x i8]* %0 to i8**
%45 = tail call i32 @createLetInstruction(i8** %44, i32 %1)
br label %48
46: ; preds = %40
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
br label %48
48: ; preds = %6, %46, %43, %37, %31, %25, %19, %13, %4
%49 = phi i32 [ 0, %4 ], [ %15, %13 ], [ %21, %19 ], [ %27, %25 ], [ %33, %31 ], [ %39, %37 ], [ %45, %43 ], [ 0, %46 ], [ 1, %6 ]
ret i32 %49
}