#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 */
typedef int /*<<< orphan*/ args;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, ...);
char *realloc(char *, int);
scalar_t__ runRun(char **);
int /*<<< orphan*/ sprintf(char *, char *, int);
scalar_t__ sscanf(char *, char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int runFor(char **args) {
  if (args[0] == NULL) {
    printf("you need an initializer for your for loop\n");
    return 0;
  }
  if (args[1] == NULL) {
    printf("you need a limit for your for loop\n");
    return 0;
  }
  if (args[2] == NULL) {
    printf("you need an increment for your for loop\n");
    return 0;
  }
  int init = 0;
  int limit = 0;
  int inc = 0;
  char counter = 'n';
  if (sscanf(args[0], "%d", &init) == EOF) {
    printf("%s is not a valid initializer\n", args[0]);
    return 0;
  }
  if (sscanf(args[1], "%d", &limit) == EOF) {
    printf("%s is not a valid limit\n", args[1]);
    return 0;
  }
  if (sscanf(args[2], "%d", &inc) == EOF) {
    printf("%s is not a valid increment\n", args[2]);
    return 0;
  }
  if (sscanf(args[3], "%c", &counter) == EOF) {
    printf("%s is not a valid counter flag\n", args[3]);
    return 0;
  }
  if ((counter != 'y') && (counter != 'n')) {
    printf("%c is not a valid counter flag\n", counter);
    return 0;
  }
  int i = 0;
  if (inc == 0) {
    printf("infinite loop detected, aborting...\n");
    return 0;
  } else {
    if (counter == 'y') {
      args[3] = realloc(args[3], sizeof(args[4]));
      strcpy(args[3], args[4]);
      if (init < limit) {
        for (i = init; i < limit; i += inc) {
          sprintf(args[4], "%d", i);
          if (runRun(&args[3]) == 0) {
            printf("error, process %s not started\n", args[3]);
            return 0;
          }
        }
      } else if (init > limit) {
        for (i = init; i > limit; i += inc) {
          sprintf(args[4], "%d", i);
          if (runRun(&args[3]) == 0) {
            printf("error, process %s not started\n", args[3]);
            return 0;
          }
        }
      }
    } else {
      if (init < limit) {
        for (i = init; i < limit; i += inc) {
          if (runRun(&args[4]) == 0) {
            printf("error, process %s not started\n", args[4]);
            return 0;
          }
        }
      } else if (init > limit) {
        for (i = init; i > limit; i += inc) {
          if (runRun(&args[4]) == 0) {
            printf("error, process %s not started\n", args[4]);
            return 0;
          }
        }
      }
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<runFor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1194 <runFor+0x34>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    11bd <runFor+0x5d>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    11e6 <runFor+0x86>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movb   $0x6e,-0x1d(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe6b(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    0x2dc9(%rip),%rcx
cmp    (%rcx),%rax
jne    1249 <runFor+0xe9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe20(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    0x2d7e(%rip),%rcx
cmp    (%rcx),%rax
jne    1295 <runFor+0x135>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdd4(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    0x2d32(%rip),%rcx
cmp    (%rcx),%rax
jne    12e1 <runFor+0x181>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xde0(%rip),%rsi
lea    -0x1d(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    0x2ce6(%rip),%rcx
cmp    (%rcx),%rax
jne    132d <runFor+0x1cd>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
movsbl -0x1d(%rbp),%eax
cmp    $0x79,%eax
je     1365 <runFor+0x205>
movsbl -0x1d(%rbp),%eax
cmp    $0x6e,%eax
je     1365 <runFor+0x205>
movsbl -0x1d(%rbp),%esi
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
movl   $0x0,-0x24(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1390 <runFor+0x230>
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
movsbl -0x1d(%rbp),%eax
cmp    $0x79,%eax
jne    14e5 <runFor+0x385>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    $0x8,%esi
call   1070 <realloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1455 <runFor+0x2f5>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1450 <runFor+0x2f0>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
mov    -0x24(%rbp),%edx
lea    0xc79(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
call   1050 <runRun@plt>
cmp    $0x0,%rax
jne    143d <runFor+0x2dd>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xd0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
jmp    1442 <runFor+0x2e2>
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    13e1 <runFor+0x281>
jmp    14e0 <runFor+0x380>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    14db <runFor+0x37b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    14d6 <runFor+0x376>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
mov    -0x24(%rbp),%edx
lea    0xbf3(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
call   1050 <runRun@plt>
cmp    $0x0,%rax
jne    14c3 <runFor+0x363>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xc88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
jmp    14c8 <runFor+0x368>
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1467 <runFor+0x307>
jmp    14db <runFor+0x37b>
jmp    14e0 <runFor+0x380>
jmp    15cd <runFor+0x46d>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1554 <runFor+0x3f4>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    154f <runFor+0x3ef>
mov    -0x10(%rbp),%rdi
add    $0x20,%rdi
call   1050 <runRun@plt>
cmp    $0x0,%rax
jne    153c <runFor+0x3dc>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
lea    0xc0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
jmp    1541 <runFor+0x3e1>
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    14f7 <runFor+0x397>
jmp    15c8 <runFor+0x468>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    15c3 <runFor+0x463>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    15be <runFor+0x45e>
mov    -0x10(%rbp),%rdi
add    $0x20,%rdi
call   1050 <runRun@plt>
cmp    $0x0,%rax
jne    15ab <runFor+0x44b>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
lea    0xba0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <runFor+0x479>
jmp    15b0 <runFor+0x450>
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1566 <runFor+0x406>
jmp    15c3 <runFor+0x463>
jmp    15c8 <runFor+0x468>
jmp    15cd <runFor+0x46d>
jmp    15d2 <runFor+0x472>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runFor>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     11e2 <runFor+0x72>
cmpq   $0x0,0x8(%rbx)
je     11eb <runFor+0x7b>
cmpq   $0x0,0x10(%rbx)
je     11f4 <runFor+0x84>
movl   $0x0,0xc(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
movb   $0x6e,0x3(%rsp)
lea    0xe47(%rip),%rsi
xor    %ebp,%ebp
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
mov    0x2e1a(%rip),%r15
cmp    (%r15),%rax
jne    1207 <runFor+0x97>
mov    (%rbx),%rsi
lea    0xe26(%rip),%rdi
jmp    1289 <runFor+0x119>
lea    0xf40(%rip),%rdi
jmp    11fb <runFor+0x8b>
lea    0xf14(%rip),%rdi
jmp    11fb <runFor+0x8b>
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
xor    %ebp,%ebp
jmp    1290 <runFor+0x120>
mov    0x8(%rbx),%rdi
lea    0xdee(%rip),%rsi
xor    %ebp,%ebp
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    (%r15),%rax
jne    1232 <runFor+0xc2>
mov    0x8(%rbx),%rsi
lea    0xdf2(%rip),%rdi
jmp    1289 <runFor+0x119>
mov    0x10(%rbx),%rdi
lea    0xdc3(%rip),%rsi
xor    %ebp,%ebp
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    (%r15),%rax
jne    125d <runFor+0xed>
mov    0x10(%rbx),%rsi
lea    0xde0(%rip),%rdi
jmp    1289 <runFor+0x119>
lea    0x18(%rbx),%r14
mov    0x18(%rbx),%rdi
lea    0xdec(%rip),%rsi
xor    %ebp,%ebp
lea    0x3(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    (%r15),%rax
jne    129f <runFor+0x12f>
mov    (%r14),%rsi
lea    0xdd2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
movsbl 0x3(%rsp),%esi
cmp    $0x6e,%esi
je     12b3 <runFor+0x143>
cmp    $0x79,%sil
jne    1333 <runFor+0x1c3>
cmpl   $0x0,0x8(%rsp)
je     1348 <runFor+0x1d8>
cmp    $0x79,%sil
jne    1354 <runFor+0x1e4>
mov    0x18(%rbx),%rdi
mov    $0x8,%esi
call   1080 <realloc@plt>
mov    %rax,0x18(%rbx)
mov    0x20(%rbx),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    0xc(%rsp),%r15d
cmp    0x4(%rsp),%r15d
jge    138b <runFor+0x21b>
lea    0xd03(%rip),%r12
mov    $0x1,%ebp
mov    0x20(%rbx),%rdi
mov    %r12,%rsi
mov    %r15d,%edx
call   1090 <sprintf@plt>
mov    %r14,%rdi
call   1060 <runRun@plt>
test   %rax,%rax
je     13f7 <runFor+0x287>
add    0x8(%rsp),%r15d
cmp    0x4(%rsp),%r15d
jl     1302 <runFor+0x192>
jmp    1290 <runFor+0x120>
lea    0xd41(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1290 <runFor+0x120>
lea    0xd6b(%rip),%rdi
jmp    11fb <runFor+0x8b>
mov    0xc(%rsp),%r14d
cmp    0x4(%rsp),%r14d
jge    13ca <runFor+0x25a>
add    $0x20,%rbx
mov    $0x1,%ebp
mov    %rbx,%rdi
call   1060 <runRun@plt>
test   %rax,%rax
je     13fc <runFor+0x28c>
add    0x8(%rsp),%r14d
cmp    0x4(%rsp),%r14d
jl     1369 <runFor+0x1f9>
jmp    1290 <runFor+0x120>
mov    $0x1,%ebp
jle    1290 <runFor+0x120>
lea    0xc63(%rip),%r12
mov    0x20(%rbx),%rdi
mov    %r12,%rsi
mov    %r15d,%edx
call   1090 <sprintf@plt>
mov    %r14,%rdi
call   1060 <runRun@plt>
test   %rax,%rax
je     13f7 <runFor+0x287>
add    0x8(%rsp),%r15d
cmp    0x4(%rsp),%r15d
jg     139d <runFor+0x22d>
jmp    1290 <runFor+0x120>
mov    $0x1,%ebp
jle    1290 <runFor+0x120>
add    $0x20,%rbx
mov    %rbx,%rdi
call   1060 <runRun@plt>
test   %rax,%rax
je     13fc <runFor+0x28c>
add    0x8(%rsp),%r14d
cmp    0x4(%rsp),%r14d
jg     13d9 <runFor+0x269>
jmp    1290 <runFor+0x120>
mov    (%r14),%rsi
jmp    13ff <runFor+0x28f>
mov    (%rbx),%rsi
lea    0xc95(%rip),%rdi
xor    %ebp,%ebp
jmp    1289 <runFor+0x119>

LLVM IR (-O0):
@.str = [43 x i8] c"you need an initializer for your for loop\0A\00"
@.str.1 = [36 x i8] c"you need a limit for your for loop\0A\00"
@.str.2 = [41 x i8] c"you need an increment for your for loop\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.4 = [31 x i8] c"%s is not a valid initializer\0A\00"
@.str.5 = [25 x i8] c"%s is not a valid limit\0A\00"
@.str.6 = [29 x i8] c"%s is not a valid increment\0A\00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [32 x i8] c"%s is not a valid counter flag\0A\00"
@.str.9 = [32 x i8] c"%c is not a valid counter flag\0A\00"
@.str.10 = [37 x i8] c"infinite loop detected, aborting...\0A\00"
@.str.11 = [31 x i8] c"error, process %s not started\0A\00"
define i32 @runFor(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
store i8** %0, i8*** %3
%9 = load i8**, i8*** %3
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %231
15: ; preds = %1
%16 = load i8**, i8*** %3
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %231
22: ; preds = %15
%23 = load i8**, i8*** %3
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %231
29: ; preds = %22
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i8 110, i8* %7
%30 = load i8**, i8*** %3
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i64 (i8*, i8*, ...) @sscanf(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%34 = load i64, i64* @EOF
%35 = icmp eq i64 %33, %34
br i1 %35, label %36, label %41
36: ; preds = %29
%37 = load i8**, i8*** %3
%38 = getelementptr inbounds i8*, i8** %37, i64 0
%39 = load i8*, i8** %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %39)
store i32 0, i32* %2
br label %231
41: ; preds = %29
%42 = load i8**, i8*** %3
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i64 (i8*, i8*, ...) @sscanf(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%46 = load i64, i64* @EOF
%47 = icmp eq i64 %45, %46
br i1 %47, label %48, label %53
48: ; preds = %41
%49 = load i8**, i8*** %3
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %51)
store i32 0, i32* %2
br label %231
53: ; preds = %41
%54 = load i8**, i8*** %3
%55 = getelementptr inbounds i8*, i8** %54, i64 2
%56 = load i8*, i8** %55
%57 = call i64 (i8*, i8*, ...) @sscanf(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%58 = load i64, i64* @EOF
%59 = icmp eq i64 %57, %58
br i1 %59, label %60, label %65
60: ; preds = %53
%61 = load i8**, i8*** %3
%62 = getelementptr inbounds i8*, i8** %61, i64 2
%63 = load i8*, i8** %62
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %63)
store i32 0, i32* %2
br label %231
65: ; preds = %53
%66 = load i8**, i8*** %3
%67 = getelementptr inbounds i8*, i8** %66, i64 3
%68 = load i8*, i8** %67
%69 = call i64 (i8*, i8*, ...) @sscanf(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %7)
%70 = load i64, i64* @EOF
%71 = icmp eq i64 %69, %70
br i1 %71, label %72, label %77
72: ; preds = %65
%73 = load i8**, i8*** %3
%74 = getelementptr inbounds i8*, i8** %73, i64 3
%75 = load i8*, i8** %74
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %75)
store i32 0, i32* %2
br label %231
77: ; preds = %65
%78 = load i8, i8* %7
%79 = sext i8 %78 to i32
%80 = icmp ne i32 %79, 121
br i1 %80, label %81, label %89
81: ; preds = %77
%82 = load i8, i8* %7
%83 = sext i8 %82 to i32
%84 = icmp ne i32 %83, 110
br i1 %84, label %85, label %89
85: ; preds = %81
%86 = load i8, i8* %7
%87 = sext i8 %86 to i32
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %87)
store i32 0, i32* %2
br label %231
89: ; preds = %81, %77
store i32 0, i32* %8
%90 = load i32, i32* %6
%91 = icmp eq i32 %90, 0
br i1 %91, label %92, label %94
92: ; preds = %89
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %2
br label %231
94: ; preds = %89
%95 = load i8, i8* %7
%96 = sext i8 %95 to i32
%97 = icmp eq i32 %96, 121
br i1 %97, label %98, label %175
98: ; preds = %94
%99 = load i8**, i8*** %3
%100 = getelementptr inbounds i8*, i8** %99, i64 3
%101 = load i8*, i8** %100
%102 = call i8* @realloc(i8* %101, i32 8)
%103 = load i8**, i8*** %3
%104 = getelementptr inbounds i8*, i8** %103, i64 3
store i8* %102, i8** %104
%105 = load i8**, i8*** %3
%106 = getelementptr inbounds i8*, i8** %105, i64 3
%107 = load i8*, i8** %106
%108 = load i8**, i8*** %3
%109 = getelementptr inbounds i8*, i8** %108, i64 4
%110 = load i8*, i8** %109
%111 = call i32 @strcpy(i8* %107, i8* %110)
%112 = load i32, i32* %4
%113 = load i32, i32* %5
%114 = icmp slt i32 %112, %113
br i1 %114, label %115, label %142
115: ; preds = %98
%116 = load i32, i32* %4
store i32 %116, i32* %8
br label %117
117: ; preds = %137, %115
%118 = load i32, i32* %8
%119 = load i32, i32* %5
%120 = icmp slt i32 %118, %119
br i1 %120, label %121, label %141
121: ; preds = %117
%122 = load i8**, i8*** %3
%123 = getelementptr inbounds i8*, i8** %122, i64 4
%124 = load i8*, i8** %123
%125 = load i32, i32* %8
%126 = call i32 @sprintf(i8* %124, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %125)
%127 = load i8**, i8*** %3
%128 = getelementptr inbounds i8*, i8** %127, i64 3
%129 = call i64 @runRun(i8** %128)
%130 = icmp eq i64 %129, 0
br i1 %130, label %131, label %136
131: ; preds = %121
%132 = load i8**, i8*** %3
%133 = getelementptr inbounds i8*, i8** %132, i64 3
%134 = load i8*, i8** %133
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %134)
store i32 0, i32* %2
br label %231
136: ; preds = %121
br label %137
137: ; preds = %136
%138 = load i32, i32* %6
%139 = load i32, i32* %8
%140 = add nsw i32 %139, %138
store i32 %140, i32* %8
br label %117
141: ; preds = %117
br label %174
142: ; preds = %98
%143 = load i32, i32* %4
%144 = load i32, i32* %5
%145 = icmp sgt i32 %143, %144
br i1 %145, label %146, label %173
146: ; preds = %142
%147 = load i32, i32* %4
store i32 %147, i32* %8
br label %148
148: ; preds = %168, %146
%149 = load i32, i32* %8
%150 = load i32, i32* %5
%151 = icmp sgt i32 %149, %150
br i1 %151, label %152, label %172
152: ; preds = %148
%153 = load i8**, i8*** %3
%154 = getelementptr inbounds i8*, i8** %153, i64 4
%155 = load i8*, i8** %154
%156 = load i32, i32* %8
%157 = call i32 @sprintf(i8* %155, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %156)
%158 = load i8**, i8*** %3
%159 = getelementptr inbounds i8*, i8** %158, i64 3
%160 = call i64 @runRun(i8** %159)
%161 = icmp eq i64 %160, 0
br i1 %161, label %162, label %167
162: ; preds = %152
%163 = load i8**, i8*** %3
%164 = getelementptr inbounds i8*, i8** %163, i64 3
%165 = load i8*, i8** %164
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %165)
store i32 0, i32* %2
br label %231
167: ; preds = %152
br label %168
168: ; preds = %167
%169 = load i32, i32* %6
%170 = load i32, i32* %8
%171 = add nsw i32 %170, %169
store i32 %171, i32* %8
br label %148
172: ; preds = %148
br label %173
173: ; preds = %172, %142
br label %174
174: ; preds = %173, %141
br label %229
175: ; preds = %94
%176 = load i32, i32* %4
%177 = load i32, i32* %5
%178 = icmp slt i32 %176, %177
br i1 %178, label %179, label %201
179: ; preds = %175
%180 = load i32, i32* %4
store i32 %180, i32* %8
br label %181
181: ; preds = %196, %179
%182 = load i32, i32* %8
%183 = load i32, i32* %5
%184 = icmp slt i32 %182, %183
br i1 %184, label %185, label %200
185: ; preds = %181
%186 = load i8**, i8*** %3
%187 = getelementptr inbounds i8*, i8** %186, i64 4
%188 = call i64 @runRun(i8** %187)
%189 = icmp eq i64 %188, 0
br i1 %189, label %190, label %195
190: ; preds = %185
%191 = load i8**, i8*** %3
%192 = getelementptr inbounds i8*, i8** %191, i64 4
%193 = load i8*, i8** %192
%194 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %193)
store i32 0, i32* %2
br label %231
195: ; preds = %185
br label %196
196: ; preds = %195
%197 = load i32, i32* %6
%198 = load i32, i32* %8
%199 = add nsw i32 %198, %197
store i32 %199, i32* %8
br label %181
200: ; preds = %181
br label %228
201: ; preds = %175
%202 = load i32, i32* %4
%203 = load i32, i32* %5
%204 = icmp sgt i32 %202, %203
br i1 %204, label %205, label %227
205: ; preds = %201
%206 = load i32, i32* %4
store i32 %206, i32* %8
br label %207
207: ; preds = %222, %205
%208 = load i32, i32* %8
%209 = load i32, i32* %5
%210 = icmp sgt i32 %208, %209
br i1 %210, label %211, label %226
211: ; preds = %207
%212 = load i8**, i8*** %3
%213 = getelementptr inbounds i8*, i8** %212, i64 4
%214 = call i64 @runRun(i8** %213)
%215 = icmp eq i64 %214, 0
br i1 %215, label %216, label %221
216: ; preds = %211
%217 = load i8**, i8*** %3
%218 = getelementptr inbounds i8*, i8** %217, i64 4
%219 = load i8*, i8** %218
%220 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %219)
store i32 0, i32* %2
br label %231
221: ; preds = %211
br label %222
222: ; preds = %221
%223 = load i32, i32* %6
%224 = load i32, i32* %8
%225 = add nsw i32 %224, %223
store i32 %225, i32* %8
br label %207
226: ; preds = %207
br label %227
227: ; preds = %226, %201
br label %228
228: ; preds = %227, %200
br label %229
229: ; preds = %228, %174
br label %230
230: ; preds = %229
store i32 1, i32* %2
br label %231
231: ; preds = %230, %216, %190, %162, %131, %92, %85, %72, %60, %48, %36, %27, %20, %13
%232 = load i32, i32* %2
ret i32 %232
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.4 = [31 x i8] c"%s is not a valid initializer\0A\00"
@.str.5 = [25 x i8] c"%s is not a valid limit\0A\00"
@.str.6 = [29 x i8] c"%s is not a valid increment\0A\00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [32 x i8] c"%s is not a valid counter flag\0A\00"
@.str.9 = [32 x i8] c"%c is not a valid counter flag\0A\00"
@.str.11 = [31 x i8] c"error, process %s not started\0A\00"
@str = [36 x i8] c"infinite loop detected, aborting...\00"
@str.12 = [40 x i8] c"you need an increment for your for loop\00"
@str.13 = [35 x i8] c"you need a limit for your for loop\00"
@str.14 = [42 x i8] c"you need an initializer for your for loop\00"
define i32 @runFor(i8** %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = load i8*, i8** %0
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.14, i64 0, i64 0))
br label %144
10: ; preds = %1
%11 = getelementptr inbounds i8*, i8** %0, i64 1
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.13, i64 0, i64 0))
br label %144
16: ; preds = %10
%17 = getelementptr inbounds i8*, i8** %0, i64 2
%18 = load i8*, i8** %17
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.12, i64 0, i64 0))
br label %144
22: ; preds = %16
%23 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%24 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%25 = bitcast i32* %4 to i8*
store i32 0, i32* %4
store i8 110, i8* %5
%26 = call i64 (i8*, i8*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%27 = load i64, i64* @EOF
%28 = icmp eq i64 %26, %27
br i1 %28, label %29, label %32
29: ; preds = %22
%30 = load i8*, i8** %0
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %30)
br label %142
32: ; preds = %22
%33 = load i8*, i8** %11
%34 = call i64 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%35 = load i64, i64* @EOF
%36 = icmp eq i64 %34, %35
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load i8*, i8** %11
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %38)
br label %142
40: ; preds = %32
%41 = load i8*, i8** %17
%42 = call i64 (i8*, i8*, ...) @sscanf(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%43 = load i64, i64* @EOF
%44 = icmp eq i64 %42, %43
br i1 %44, label %45, label %48
45: ; preds = %40
%46 = load i8*, i8** %17
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %46)
br label %142
48: ; preds = %40
%49 = getelementptr inbounds i8*, i8** %0, i64 3
%50 = load i8*, i8** %49
%51 = call i64 (i8*, i8*, ...) @sscanf(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %5)
%52 = load i64, i64* @EOF
%53 = icmp eq i64 %51, %52
br i1 %53, label %54, label %57
54: ; preds = %48
%55 = load i8*, i8** %49
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %55)
br label %142
57: ; preds = %48
%58 = load i8, i8* %5
switch i8 %58, label %59 [
i8 121, label %62
i8 110, label %62
]
59: ; preds = %57
%60 = sext i8 %58 to i32
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %60)
br label %142
62: ; preds = %57, %57
%63 = load i32, i32* %4
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %142
67: ; preds = %62
%68 = icmp eq i8 %58, 121
br i1 %68, label %69, label %108
69: ; preds = %67
%70 = load i8*, i8** %49
%71 = call i8* @realloc(i8* %70, i32 8)
store i8* %71, i8** %49
%72 = getelementptr inbounds i8*, i8** %0, i64 4
%73 = load i8*, i8** %72
%74 = call i32 @strcpy(i8* %71, i8* %73)
%75 = load i32, i32* %2
%76 = load i32, i32* %3
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %92
78: ; preds = %69, %87
%79 = phi i32 [ %89, %87 ], [ %75, %69 ]
%80 = load i8*, i8** %72
%81 = call i32 @sprintf(i8* dereferenceable(1) %80, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %79)
%82 = call i64 @runRun(i8** %49)
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %78
%85 = load i8*, i8** %49
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %85)
br label %142
87: ; preds = %78
%88 = load i32, i32* %4
%89 = add nsw i32 %88, %79
%90 = load i32, i32* %3
%91 = icmp slt i32 %89, %90
br i1 %91, label %78, label %142
92: ; preds = %69
%93 = icmp sgt i32 %75, %76
br i1 %93, label %94, label %142
94: ; preds = %92, %103
%95 = phi i32 [ %105, %103 ], [ %75, %92 ]
%96 = load i8*, i8** %72
%97 = call i32 @sprintf(i8* dereferenceable(1) %96, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %95)
%98 = call i64 @runRun(i8** %49)
%99 = icmp eq i64 %98, 0
br i1 %99, label %100, label %103
100: ; preds = %94
%101 = load i8*, i8** %49
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %101)
br label %142
103: ; preds = %94
%104 = load i32, i32* %4
%105 = add nsw i32 %104, %95
%106 = load i32, i32* %3
%107 = icmp sgt i32 %105, %106
br i1 %107, label %94, label %142
108: ; preds = %67
%109 = load i32, i32* %2
%110 = load i32, i32* %3
%111 = icmp slt i32 %109, %110
br i1 %111, label %112, label %126
112: ; preds = %108
%113 = getelementptr inbounds i8*, i8** %0, i64 4
br label %114
114: ; preds = %112, %121
%115 = phi i32 [ %109, %112 ], [ %123, %121 ]
%116 = call i64 @runRun(i8** %113)
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %114
%119 = load i8*, i8** %113
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %119)
br label %142
121: ; preds = %114
%122 = load i32, i32* %4
%123 = add nsw i32 %122, %115
%124 = load i32, i32* %3
%125 = icmp slt i32 %123, %124
br i1 %125, label %114, label %142
126: ; preds = %108
%127 = icmp sgt i32 %109, %110
br i1 %127, label %128, label %142
128: ; preds = %126
%129 = getelementptr inbounds i8*, i8** %0, i64 4
br label %130
130: ; preds = %128, %137
%131 = phi i32 [ %109, %128 ], [ %139, %137 ]
%132 = call i64 @runRun(i8** %129)
%133 = icmp eq i64 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %130
%135 = load i8*, i8** %129
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %135)
br label %142
137: ; preds = %130
%138 = load i32, i32* %4
%139 = add nsw i32 %138, %131
%140 = load i32, i32* %3
%141 = icmp sgt i32 %139, %140
br i1 %141, label %130, label %142
142: ; preds = %137, %121, %103, %87, %65, %84, %100, %118, %134, %92, %126, %59, %54, %45, %37, %29
%143 = phi i32 [ 0, %29 ], [ 0, %37 ], [ 0, %45 ], [ 0, %54 ], [ 0, %59 ], [ 0, %65 ], [ 0, %84 ], [ 0, %100 ], [ 0, %118 ], [ 0, %134 ], [ 1, %92 ], [ 1, %126 ], [ 1, %87 ], [ 1, %103 ], [ 1, %121 ], [ 1, %137 ]
br label %144
144: ; preds = %142, %20, %14, %8
%145 = phi i32 [ 0, %8 ], [ 0, %14 ], [ 0, %20 ], [ %143, %142 ]
ret i32 %145
}