#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ isdigit(unsigned int);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char *);
void check_two(char *tocheck, int which) {
  int i, j;
  unsigned int len;
  len = (unsigned int)strlen(tocheck);
  for (i = 0; i < len; i++)
    if (tocheck[i] == ',')
      break;
  if (i >= (len - 1)) {
    fprintf(stderr,
            "Wrong type of parameter for flag -%c. Has to be"
            " unsigned,unsigned\n",
            which);
    exit(4);
  }
  for (j = 0; j < i; j++)
    if (!isdigit((unsigned int)tocheck[j])) {
      fprintf(stderr,
              "Wrong type of parameter for flag -%c. Has to be"
              " unsigned,unsigned\n",
              which);
      exit(4);
    }
  for (j = i + 1; j < len; j++)
    if (!isdigit((unsigned int)tocheck[j])) {
      fprintf(stderr,
              "Wrong type of parameter for flag -%c. Has to be"
              " unsigned,unsigned\n",
              which);
      exit(4);
    }
}


x86 assembly (clang, -O0):
<check_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    119b <check_two+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    1188 <check_two+0x48>
jmp    119b <check_two+0x5b>
jmp    118d <check_two+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1162 <check_two+0x22>
mov    -0x10(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jb     11ce <check_two+0x8e>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe41(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x4,%edi
call   1060 <exit@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1230 <check_two+0xf0>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    121d <check_two+0xdd>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xdf2(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x4,%edi
call   1060 <exit@plt>
jmp    1222 <check_two+0xe2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d5 <check_two+0x95>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1294 <check_two+0x154>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1281 <check_two+0x141>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xd8e(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x4,%edi
call   1060 <exit@plt>
jmp    1286 <check_two+0x146>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1239 <check_two+0xf9>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_two>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     1187 <check_two+0x57>
mov    %eax,%ecx
mov    %eax,%esi
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmpb   $0x2c,(%rbx,%rdx,1)
je     1161 <check_two+0x31>
add    $0x1,%rdx
cmp    %rdx,%rsi
jne    1150 <check_two+0x20>
mov    %ecx,%edx
add    $0xffffffff,%ecx
cmp    %ecx,%edx
jae    11a5 <check_two+0x75>
test   %edx,%edx
je     1187 <check_two+0x57>
mov    %edx,%ecx
xor    %edx,%edx
movsbl (%rbx,%rdx,1),%esi
add    $0xffffffd0,%esi
cmp    $0xa,%esi
jae    11a5 <check_two+0x75>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1170 <check_two+0x40>
jmp    1189 <check_two+0x59>
xor    %ecx,%ecx
mov    %eax,%eax
add    $0x1,%rcx
nop
cmp    %rax,%rcx
jae    11c6 <check_two+0x96>
movsbl (%rbx,%rcx,1),%edx
add    $0xffffffd0,%edx
add    $0x1,%rcx
cmp    $0xa,%edx
jb     1190 <check_two+0x60>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
lea    0xe4b(%rip),%rsi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    $0x4,%edi
call   1050 <exit@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"Wrong type of parameter for flag -%c. Has to be unsigned,unsigned\0A\00"
define void @check_two(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %7
store i32 0, i32* %5
br label %11
11: ; preds = %25, %2
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp ult i32 %12, %13
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 44
br i1 %22, label %23, label %24
23: ; preds = %15
br label %28
24: ; preds = %15
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %11
28: ; preds = %23, %11
%29 = load i32, i32* %5
%30 = load i32, i32* %7
%31 = sub i32 %30, 1
%32 = icmp uge i32 %29, %31
br i1 %32, label %33, label %38
33: ; preds = %28
%34 = load i32, i32* @stderr
%35 = load i32, i32* %4
%36 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = call i32 @exit(i32 4)
unreachable
38: ; preds = %28
store i32 0, i32* %6
br label %39
39: ; preds = %58, %38
%40 = load i32, i32* %6
%41 = load i32, i32* %5
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %61
43: ; preds = %39
%44 = load i8*, i8** %3
%45 = load i32, i32* %6
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %44, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = call i32 @isdigit(i32 %49)
%51 = icmp ne i32 %50, 0
br i1 %51, label %57, label %52
52: ; preds = %43
%53 = load i32, i32* @stderr
%54 = load i32, i32* %4
%55 = call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %54)
%56 = call i32 @exit(i32 4)
unreachable
57: ; preds = %43
br label %58
58: ; preds = %57
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
store i32 %60, i32* %6
br label %39
61: ; preds = %39
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
store i32 %63, i32* %6
br label %64
64: ; preds = %83, %61
%65 = load i32, i32* %6
%66 = load i32, i32* %7
%67 = icmp ult i32 %65, %66
br i1 %67, label %68, label %86
68: ; preds = %64
%69 = load i8*, i8** %3
%70 = load i32, i32* %6
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %69, i64 %71
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = call i32 @isdigit(i32 %74)
%76 = icmp ne i32 %75, 0
br i1 %76, label %82, label %77
77: ; preds = %68
%78 = load i32, i32* @stderr
%79 = load i32, i32* %4
%80 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %79)
%81 = call i32 @exit(i32 4)
unreachable
82: ; preds = %68
br label %83
83: ; preds = %82
%84 = load i32, i32* %6
%85 = add nsw i32 %84, 1
store i32 %85, i32* %6
br label %64
86: ; preds = %64
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"Wrong type of parameter for flag -%c. Has to be unsigned,unsigned\0A\00"
define void @check_two(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %32, label %6
6: ; preds = %2
%7 = and i64 %3, 4294967295
br label %8
8: ; preds = %6, %13
%9 = phi i64 [ 0, %6 ], [ %14, %13 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 44
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %18, label %8
16: ; preds = %8
%17 = trunc i64 %9 to i32
br label %18
18: ; preds = %13, %16
%19 = phi i32 [ %17, %16 ], [ %4, %13 ]
%20 = add i32 %4, -1
%21 = icmp ult i32 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = icmp eq i32 %19, 0
br i1 %23, label %32, label %24
24: ; preds = %22
%25 = zext i32 %19 to i64
br label %35
26: ; preds = %18
%27 = load i32, i32* @stderr
%28 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %1)
%29 = tail call i32 @exit(i32 4)
unreachable
30: ; preds = %35
%31 = icmp eq i64 %42, %25
br i1 %31, label %32, label %35
32: ; preds = %30, %2, %22
%33 = phi i64 [ 0, %22 ], [ 0, %2 ], [ %25, %30 ]
%34 = and i64 %3, 4294967295
br label %47
35: ; preds = %24, %30
%36 = phi i64 [ 0, %24 ], [ %42, %30 ]
%37 = getelementptr inbounds i8, i8* %0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = add nsw i32 %39, -48
%41 = icmp ult i32 %40, 10
%42 = add nuw nsw i64 %36, 1
br i1 %41, label %30, label %43
43: ; preds = %35
%44 = load i32, i32* @stderr
%45 = tail call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %1)
%46 = tail call i32 @exit(i32 4)
unreachable
47: ; preds = %32, %51
%48 = phi i64 [ %33, %32 ], [ %49, %51 ]
%49 = add nuw nsw i64 %48, 1
%50 = icmp ult i64 %49, %34
br i1 %50, label %51, label %61
51: ; preds = %47
%52 = getelementptr inbounds i8, i8* %0, i64 %49
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = add nsw i32 %54, -48
%56 = icmp ult i32 %55, 10
br i1 %56, label %47, label %57
57: ; preds = %51
%58 = load i32, i32* @stderr
%59 = tail call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %1)
%60 = tail call i32 @exit(i32 4)
unreachable
61: ; preds = %47
ret void
}