#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 */
struct Person {
  int dummy;
};

/* Variables and functions */
struct Person *Create_Person(char *, int, int, int);
int /*<<< orphan*/ Destroy_Person(struct Person *);
int /*<<< orphan*/ Print_Person(struct Person *);
int /*<<< orphan*/ isalpha(char);
int /*<<< orphan*/ isdigit(char);
int /*<<< orphan*/ printf(char *, char *);
int string_2_int(char *);
int main(int argc, char *argv[]) {
  char *name = 0;
  char *age = 0;
  char *height = 0;
  char *weight = 0;
  bool inputCheck = true;
  if (argc != 5) {
    printf(
        "\x1b[33m"
        "%s"
        "\x1b[0m"
        "\r\n",
        "Error: Insufficient Arguments. Dropping user input. Must be 4.\r\n");
    ;
    inputCheck = false;
  } else if (argc == 5) {
    printf("argv1=%s", argv[1]);
    if (!isalpha(*(argv[1]))) {
      printf("\x1b[33m"
             "%s"
             "\x1b[0m"
             "\r\n",
             "Error: 1st argument must be a string. NAME=string\r\n");
      ;
      inputCheck = false;
    }
    if (!isdigit(*(argv[2]))) {
      printf("\x1b[33m"
             "%s"
             "\x1b[0m"
             "\r\n",
             "Error: 2nd argument must be a number. AGE=number\r\n");
      ;
      inputCheck = false;
    }
    if (!isdigit(*(argv[3]))) {
      printf("\x1b[33m"
             "%s"
             "\x1b[0m"
             "\r\n",
             "Error: 3rd argument must be a number. HEIGHT=number\r\n");
      ;
      inputCheck = false;
    }
    if (!isdigit(*(argv[4]))) {
      printf("\x1b[33m"
             "%s"
             "\x1b[0m"
             "\r\n",
             "Error: 4th argument must be a string. WEIGHT=number\r\n");
      ;
      inputCheck = false;
    }
  }
  name = argv[1];
  age = argv[2];
  height = argv[3];
  weight = argv[4];
  struct Person *Hasnain = Create_Person("Hasnain", 27, 180, 100);
  struct Person *Arooj = Create_Person("Arooj", 31, 160, 70);
  Print_Person(Hasnain);
  Print_Person(Arooj);
  Destroy_Person(Hasnain);
  Destroy_Person(Arooj);
  if (inputCheck) {
    struct Person *RandomPerson = Create_Person(
        name, string_2_int(age), string_2_int(height), string_2_int(weight));
    Print_Person(RandomPerson);
    Destroy_Person(RandomPerson);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     11d6 <main+0x66>
lea    0xe42(%rip),%rdi
lea    0xe49(%rip),%rsi
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
jmp    12ca <main+0x15a>
cmpl   $0x5,-0x8(%rbp)
jne    12c5 <main+0x155>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe60(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%edi
call   1080 <isalpha@plt>
cmp    $0x0,%eax
jne    1227 <main+0xb7>
lea    0xdec(%rip),%rdi
lea    0xe3d(%rip),%rsi
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%eax
jne    125a <main+0xea>
lea    0xdb9(%rip),%rdi
lea    0xe3e(%rip),%rsi
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%eax
jne    128d <main+0x11d>
lea    0xd86(%rip),%rdi
lea    0xe3e(%rip),%rsi
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%eax
jne    12c0 <main+0x150>
lea    0xd53(%rip),%rdi
lea    0xe41(%rip),%rsi
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
jmp    12c5 <main+0x155>
jmp    12ca <main+0x15a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x30(%rbp)
lea    0xe2a(%rip),%rdi
mov    $0x1b,%esi
mov    $0xb4,%edx
mov    $0x64,%ecx
call   1050 <Create_Person@plt>
mov    %rax,-0x40(%rbp)
lea    0xe13(%rip),%rdi
mov    $0x1f,%esi
mov    $0xa0,%edx
mov    $0x46,%ecx
call   1050 <Create_Person@plt>
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rdi
call   1030 <Print_Person@plt>
mov    -0x48(%rbp),%rdi
call   1030 <Print_Person@plt>
mov    -0x40(%rbp),%rdi
call   1060 <Destroy_Person@plt>
mov    -0x48(%rbp),%rdi
call   1060 <Destroy_Person@plt>
cmpl   $0x0,-0x34(%rbp)
je     13b6 <main+0x246>
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rdi
call   1090 <string_2_int@plt>
mov    %eax,-0x58(%rbp)
mov    -0x28(%rbp),%rdi
call   1090 <string_2_int@plt>
mov    %eax,-0x54(%rbp)
mov    -0x30(%rbp),%rdi
call   1090 <string_2_int@plt>
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
mov    %eax,%ecx
call   1050 <Create_Person@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
call   1030 <Print_Person@plt>
mov    -0x50(%rbp),%rdi
call   1060 <Destroy_Person@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x5,%edi
jne    1228 <main+0xb8>
mov    0x8(%rbx),%rsi
lea    0xebd(%rip),%rdi
call   1070 <printf@plt>
mov    0x8(%rbx),%rax
movsbl (%rax),%edi
call   1080 <isalpha@plt>
mov    $0x1,%r14d
test   %eax,%eax
jne    11c3 <main+0x53>
lea    0xe4c(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1070 <printf@plt>
xor    %r14d,%r14d
mov    0x10(%rbx),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
jne    11e9 <main+0x79>
lea    0xe26(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1070 <printf@plt>
xor    %r14d,%r14d
mov    0x18(%rbx),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
jne    120f <main+0x9f>
lea    0xe00(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1070 <printf@plt>
xor    %r14d,%r14d
mov    0x20(%rbx),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
jne    123e <main+0xce>
lea    0xecf(%rip),%rsi
jmp    122f <main+0xbf>
lea    0xddf(%rip),%rsi
lea    0xdca(%rip),%rdi
call   1070 <printf@plt>
xor    %r14d,%r14d
mov    0x8(%rbx),%rax
mov    %rax,(%rsp)
mov    0x10(%rbx),%r12
mov    0x18(%rbx),%r15
mov    0x20(%rbx),%r13
lea    0xed2(%rip),%rdi
mov    $0x1b,%esi
mov    $0xb4,%edx
mov    $0x64,%ecx
call   1050 <Create_Person@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rdi
mov    $0x1f,%esi
mov    $0xa0,%edx
mov    $0x46,%ecx
call   1050 <Create_Person@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <Print_Person@plt>
mov    %rbp,%rdi
call   1030 <Print_Person@plt>
mov    %rbx,%rdi
call   1060 <Destroy_Person@plt>
mov    %rbp,%rdi
call   1060 <Destroy_Person@plt>
test   %r14d,%r14d
je     12f1 <main+0x181>
mov    %r12,%rdi
call   1090 <string_2_int@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1090 <string_2_int@plt>
mov    %eax,%ebp
mov    %r13,%rdi
call   1090 <string_2_int@plt>
mov    (%rsp),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1050 <Create_Person@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <Print_Person@plt>
mov    %rbx,%rdi
call   1060 <Destroy_Person@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.Person = type { i32 }
@.str = [14 x i8] c"\1B[33m%s\1B[0m\0D\0A\00"
@.str.1 = [65 x i8] c"Error: Insufficient Arguments. Dropping user input. Must be 4.\0D\0A\00"
@.str.2 = [9 x i8] c"argv1=%s\00"
@.str.3 = [52 x i8] c"Error: 1st argument must be a string. NAME=string\0D\0A\00"
@.str.4 = [51 x i8] c"Error: 2nd argument must be a number. AGE=number\0D\0A\00"
@.str.5 = [54 x i8] c"Error: 3rd argument must be a number. HEIGHT=number\0D\0A\00"
@.str.6 = [54 x i8] c"Error: 4th argument must be a string. WEIGHT=number\0D\0A\00"
@.str.7 = [8 x i8] c"Hasnain\00"
@.str.8 = [6 x i8] c"Arooj\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca %struct.Person*
%12 = alloca %struct.Person*
%13 = alloca %struct.Person*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i8* null, i8** %8
store i8* null, i8** %9
store i32 1, i32* %10
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 5
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %10
br label %63
18: ; preds = %2
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 5
br i1 %20, label %21, label %62
21: ; preds = %18
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %24)
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = load i8, i8* %28
%30 = call i32 @isalpha(i8 signext %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %21
%33 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %10
br label %34
34: ; preds = %32, %21
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = load i8, i8* %37
%39 = call i32 @isdigit(i8 signext %38)
%40 = icmp ne i32 %39, 0
br i1 %40, label %43, label %41
41: ; preds = %34
%42 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %10
br label %43
43: ; preds = %41, %34
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 3
%46 = load i8*, i8** %45
%47 = load i8, i8* %46
%48 = call i32 @isdigit(i8 signext %47)
%49 = icmp ne i32 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %43
%51 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %10
br label %52
52: ; preds = %50, %43
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 4
%55 = load i8*, i8** %54
%56 = load i8, i8* %55
%57 = call i32 @isdigit(i8 signext %56)
%58 = icmp ne i32 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %52
%60 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %10
br label %61
61: ; preds = %59, %52
br label %62
62: ; preds = %61, %18
br label %63
63: ; preds = %62, %16
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 1
%66 = load i8*, i8** %65
store i8* %66, i8** %6
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 2
%69 = load i8*, i8** %68
store i8* %69, i8** %7
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 3
%72 = load i8*, i8** %71
store i8* %72, i8** %8
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 4
%75 = load i8*, i8** %74
store i8* %75, i8** %9
%76 = call %struct.Person* @Create_Person(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 27, i32 180, i32 100)
store %struct.Person* %76, %struct.Person** %11
%77 = call %struct.Person* @Create_Person(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 31, i32 160, i32 70)
store %struct.Person* %77, %struct.Person** %12
%78 = load %struct.Person*, %struct.Person** %11
%79 = call i32 @Print_Person(%struct.Person* %78)
%80 = load %struct.Person*, %struct.Person** %12
%81 = call i32 @Print_Person(%struct.Person* %80)
%82 = load %struct.Person*, %struct.Person** %11
%83 = call i32 @Destroy_Person(%struct.Person* %82)
%84 = load %struct.Person*, %struct.Person** %12
%85 = call i32 @Destroy_Person(%struct.Person* %84)
%86 = load i32, i32* %10
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %101
88: ; preds = %63
%89 = load i8*, i8** %6
%90 = load i8*, i8** %7
%91 = call i32 @string_2_int(i8* %90)
%92 = load i8*, i8** %8
%93 = call i32 @string_2_int(i8* %92)
%94 = load i8*, i8** %9
%95 = call i32 @string_2_int(i8* %94)
%96 = call %struct.Person* @Create_Person(i8* %89, i32 %91, i32 %93, i32 %95)
store %struct.Person* %96, %struct.Person** %13
%97 = load %struct.Person*, %struct.Person** %13
%98 = call i32 @Print_Person(%struct.Person* %97)
%99 = load %struct.Person*, %struct.Person** %13
%100 = call i32 @Destroy_Person(%struct.Person* %99)
br label %101
101: ; preds = %88, %63
ret i32 0
}

LLVM IR (-O2):
%struct.Person = type { i32 }
@.str = [14 x i8] c"\1B[33m%s\1B[0m\0D\0A\00"
@.str.1 = [65 x i8] c"Error: Insufficient Arguments. Dropping user input. Must be 4.\0D\0A\00"
@.str.2 = [9 x i8] c"argv1=%s\00"
@.str.3 = [52 x i8] c"Error: 1st argument must be a string. NAME=string\0D\0A\00"
@.str.4 = [51 x i8] c"Error: 2nd argument must be a number. AGE=number\0D\0A\00"
@.str.5 = [54 x i8] c"Error: 3rd argument must be a number. HEIGHT=number\0D\0A\00"
@.str.6 = [54 x i8] c"Error: 4th argument must be a string. WEIGHT=number\0D\0A\00"
@.str.7 = [8 x i8] c"Hasnain\00"
@.str.8 = [6 x i8] c"Arooj\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 5
br i1 %3, label %4, label %39
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = tail call i32 @isalpha(i8 signext %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %4
%15 = phi i32 [ 1, %4 ], [ 0, %12 ]
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = tail call i32 @isdigit(i8 signext %18)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
br label %23
23: ; preds = %21, %14
%24 = phi i32 [ %15, %14 ], [ 0, %21 ]
%25 = getelementptr inbounds i8*, i8** %1, i64 3
%26 = load i8*, i8** %25
%27 = load i8, i8* %26
%28 = tail call i32 @isdigit(i8 signext %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %23
%31 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
br label %32
32: ; preds = %30, %23
%33 = phi i32 [ %24, %23 ], [ 0, %30 ]
%34 = getelementptr inbounds i8*, i8** %1, i64 4
%35 = load i8*, i8** %34
%36 = load i8, i8* %35
%37 = tail call i32 @isdigit(i8 signext %36)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %32, %2
%40 = phi i8* [ getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), %32 ]
%41 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %40)
br label %42
42: ; preds = %39, %32
%43 = phi i32 [ %33, %32 ], [ 0, %39 ]
%44 = getelementptr inbounds i8*, i8** %1, i64 1
%45 = load i8*, i8** %44
%46 = getelementptr inbounds i8*, i8** %1, i64 2
%47 = load i8*, i8** %46
%48 = getelementptr inbounds i8*, i8** %1, i64 3
%49 = load i8*, i8** %48
%50 = getelementptr inbounds i8*, i8** %1, i64 4
%51 = load i8*, i8** %50
%52 = tail call %struct.Person* @Create_Person(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 27, i32 180, i32 100)
%53 = tail call %struct.Person* @Create_Person(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 31, i32 160, i32 70)
%54 = tail call i32 @Print_Person(%struct.Person* %52)
%55 = tail call i32 @Print_Person(%struct.Person* %53)
%56 = tail call i32 @Destroy_Person(%struct.Person* %52)
%57 = tail call i32 @Destroy_Person(%struct.Person* %53)
%58 = icmp eq i32 %43, 0
br i1 %58, label %66, label %59
59: ; preds = %42
%60 = tail call i32 @string_2_int(i8* %47)
%61 = tail call i32 @string_2_int(i8* %49)
%62 = tail call i32 @string_2_int(i8* %51)
%63 = tail call %struct.Person* @Create_Person(i8* %45, i32 %60, i32 %61, i32 %62)
%64 = tail call i32 @Print_Person(%struct.Person* %63)
%65 = tail call i32 @Destroy_Person(%struct.Person* %63)
br label %66
66: ; preds = %59, %42
ret i32 0
}