#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*/ graphMain(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ isNum(char *);
int /*<<< orphan*/ sysPrintString(char *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ toFloat(char *);
int graph(char input[4][124], int words) {
  if (words != (3 + 1)) {
    sysPrintString("Wrong amount of parameters for plot command\n	"
                   "	Use command help for guidelines\n",
                   0, 255, 255);
    return 2;
  }
  for (int i = 1; i <= 3; i++) {
    if (!isNum(input[i])) {
      sysPrintString("Wrong parameters passed to plot command\n		"
                     "	Use command help for guidelines\n",
                     0, 255, 255);
      return 2;
    }
  }
  graphMain(toFloat(input[1]), toFloat(input[2]), toFloat(input[3]));
  return 0;
}


x86 assembly (clang, -O0):
<graph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
je     117a <graph+0x3a>
lea    0xea0(%rip),%rdi
xor    %esi,%esi
mov    $0xff,%ecx
mov    %ecx,%edx
call   1030 <sysPrintString@plt>
movl   $0x2,-0x4(%rbp)
jmp    1223 <graph+0xe3>
movl   $0x1,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jg     11dc <graph+0x9c>
mov    -0x10(%rbp),%rdi
movslq -0x18(%rbp),%rax
imul   $0x7c,%rax,%rax
add    %rax,%rdi
call   1040 <isNum@plt>
cmp    $0x0,%eax
jne    11c9 <graph+0x89>
lea    0xea0(%rip),%rdi
xor    %esi,%esi
mov    $0xff,%ecx
mov    %ecx,%edx
call   1030 <sysPrintString@plt>
movl   $0x2,-0x4(%rbp)
jmp    1223 <graph+0xe3>
jmp    11ce <graph+0x8e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1181 <graph+0x41>
mov    -0x10(%rbp),%rdi
add    $0x7c,%rdi
call   1050 <toFloat@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xf8,%rdi
call   1050 <toFloat@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x174,%rdi
call   1050 <toFloat@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
call   1060 <graphMain@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x4,%esi
jne    11b2 <graph+0x72>
mov    %rdi,%rbx
lea    0x7c(%rdi),%r14
mov    %r14,%rdi
call   1040 <isNum@plt>
test   %eax,%eax
je     11bb <graph+0x7b>
lea    0xf8(%rbx),%r15
mov    %r15,%rdi
call   1040 <isNum@plt>
test   %eax,%eax
je     11bb <graph+0x7b>
add    $0x174,%rbx
mov    %rbx,%rdi
call   1040 <isNum@plt>
test   %eax,%eax
je     11bb <graph+0x7b>
mov    %r14,%rdi
call   1050 <toFloat@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1050 <toFloat@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <toFloat@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1060 <graphMain@plt>
xor    %eax,%eax
jmp    11d8 <graph+0x98>
lea    0xe47(%rip),%rdi
jmp    11c2 <graph+0x82>
lea    0xe8d(%rip),%rdi
xor    %esi,%esi
mov    $0xff,%edx
mov    $0xff,%ecx
call   1030 <sysPrintString@plt>
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [79 x i8] c"Wrong amount of parameters for plot command\0A\09\09Use command help for guidelines\0A\00"
@.str.1 = [76 x i8] c"Wrong parameters passed to plot command\0A\09\09\09Use command help for guidelines\0A\00"
define i32 @graph([124 x i8]* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [124 x i8]*
%5 = alloca i32
%6 = alloca i32
store [124 x i8]* %0, [124 x i8]** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 4
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @sysPrintString(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 0, i32 255, i32 255)
store i32 2, i32* %3
br label %43
11: ; preds = %2
store i32 1, i32* %6
br label %12
12: ; preds = %26, %11
%13 = load i32, i32* %6
%14 = icmp sle i32 %13, 3
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load [124 x i8]*, [124 x i8]** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [124 x i8], [124 x i8]* %16, i64 %18
%20 = getelementptr inbounds [124 x i8], [124 x i8]* %19, i64 0, i64 0
%21 = call i32 @isNum(i8* %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %15
%24 = call i32 @sysPrintString(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 255, i32 255)
store i32 2, i32* %3
br label %43
25: ; preds = %15
br label %26
26: ; preds = %25
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %12
29: ; preds = %12
%30 = load [124 x i8]*, [124 x i8]** %4
%31 = getelementptr inbounds [124 x i8], [124 x i8]* %30, i64 1
%32 = getelementptr inbounds [124 x i8], [124 x i8]* %31, i64 0, i64 0
%33 = call i32 @toFloat(i8* %32)
%34 = load [124 x i8]*, [124 x i8]** %4
%35 = getelementptr inbounds [124 x i8], [124 x i8]* %34, i64 2
%36 = getelementptr inbounds [124 x i8], [124 x i8]* %35, i64 0, i64 0
%37 = call i32 @toFloat(i8* %36)
%38 = load [124 x i8]*, [124 x i8]** %4
%39 = getelementptr inbounds [124 x i8], [124 x i8]* %38, i64 3
%40 = getelementptr inbounds [124 x i8], [124 x i8]* %39, i64 0, i64 0
%41 = call i32 @toFloat(i8* %40)
%42 = call i32 @graphMain(i32 %33, i32 %37, i32 %41)
store i32 0, i32* %3
br label %43
43: ; preds = %29, %23, %9
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str = [79 x i8] c"Wrong amount of parameters for plot command\0A\09\09Use command help for guidelines\0A\00"
@.str.1 = [76 x i8] c"Wrong parameters passed to plot command\0A\09\09\09Use command help for guidelines\0A\00"
define i32 @graph([124 x i8]* %0, i32 %1) {
%3 = icmp eq i32 %1, 4
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds [124 x i8], [124 x i8]* %0, i64 1, i64 0
%6 = tail call i32 @isNum(i8* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %23, label %10
8: ; preds = %2
%9 = tail call i32 @sysPrintString(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 0, i32 255, i32 255)
br label %25
10: ; preds = %4
%11 = getelementptr inbounds [124 x i8], [124 x i8]* %0, i64 2, i64 0
%12 = tail call i32 @isNum(i8* %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %23, label %14
14: ; preds = %10
%15 = getelementptr inbounds [124 x i8], [124 x i8]* %0, i64 3, i64 0
%16 = tail call i32 @isNum(i8* %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %14
%19 = tail call i32 @toFloat(i8* %5)
%20 = tail call i32 @toFloat(i8* %11)
%21 = tail call i32 @toFloat(i8* %15)
%22 = tail call i32 @graphMain(i32 %19, i32 %20, i32 %21)
br label %25
23: ; preds = %14, %10, %4
%24 = tail call i32 @sysPrintString(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 255, i32 255)
br label %25
25: ; preds = %23, %18, %8
%26 = phi i32 [ 2, %8 ], [ 2, %23 ], [ 0, %18 ]
ret i32 %26
}