#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*/ analiza(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int i;
  if (argc <= 1) {
    printf("Neispravan poziv programa.\n");
    return -1;
  }
  for (i = 1; i < argc; i++) {
    switch (fork()) {
    case -1:
      printf("Ne mogu stvoriti procese!\n");
      return -1;
    case 0:
      analiza(argv[i]);
      exit(0);
    default:
      break;
    }
  }
  printf("Cekam na procese i dretve...\n");
  while (i--)
    wait(NULL);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1188 <main+0x38>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1242 <main+0xf2>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    120d <main+0xbd>
xor    %eax,%eax
call   1070 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
sub    $0xffffffff,%eax
je     11c5 <main+0x75>
jmp    11b5 <main+0x65>
mov    -0x18(%rbp),%eax
test   %eax,%eax
je     11dd <main+0x8d>
jmp    11f5 <main+0xa5>
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1242 <main+0xf2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <analiza@plt>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    11fa <main+0xaa>
jmp    11ff <main+0xaf>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118f <main+0x3f>
lea    0xe23(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     123b <main+0xeb>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <wait@plt>
jmp    1219 <main+0xc9>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jge    1165 <main+0x15>
lea    0xed4(%rip),%rdi
jmp    11ca <main+0x7a>
mov    %rsi,%r14
mov    %edi,%ebp
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <fork@plt>
cmp    $0xffffffff,%eax
je     11c3 <main+0x73>
test   %eax,%eax
je     11df <main+0x8f>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1180 <main+0x30>
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1060 <wait@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x60>
xor    %edi,%edi
call   1040 <exit@plt>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%r14,%rbx,8),%rdi
call   1050 <analiza@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Neispravan poziv programa.\0A\00"
@.str.1 = [27 x i8] c"Ne mogu stvoriti procese!\0A\00"
@.str.2 = [30 x i8] c"Cekam na procese i dretve...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %43
11: ; preds = %2
store i32 1, i32* %6
br label %12
12: ; preds = %30, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %33
16: ; preds = %12
%17 = call i32 (...) @fork()
switch i32 %17, label %28 [
i32 -1, label %18
i32 0, label %20
]
18: ; preds = %16
%19 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %43
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 @analiza(i8* %25)
%27 = call i32 @exit(i32 0)
unreachable
28: ; preds = %16
br label %29
29: ; preds = %28
br label %30
30: ; preds = %29
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %12
33: ; preds = %12
%34 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %39, %33
%36 = load i32, i32* %6
%37 = add nsw i32 %36, -1
store i32 %37, i32* %6
%38 = icmp ne i32 %36, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 @wait(i32* null)
br label %35
41: ; preds = %35
%42 = call i32 @exit(i32 0)
unreachable
43: ; preds = %18, %9
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@str = [29 x i8] c"Cekam na procese i dretve...\00"
@str.3 = [26 x i8] c"Ne mogu stvoriti procese!\00"
@str.4 = [27 x i8] c"Neispravan poziv programa.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %25, label %4
4: ; preds = %2, %13
%5 = phi i32 [ %14, %13 ], [ 1, %2 ]
%6 = tail call i32 (...) @fork()
switch i32 %6, label %13 [
i32 -1, label %25
i32 0, label %7
]
7: ; preds = %4
%8 = zext i32 %5 to i64
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @analiza(i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %4
%14 = add nuw nsw i32 %5, 1
%15 = icmp eq i32 %14, %0
br i1 %15, label %16, label %4
16: ; preds = %13
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %18
18: ; preds = %16, %18
%19 = phi i32 [ %0, %16 ], [ %20, %18 ]
%20 = add nsw i32 %19, -1
%21 = tail call i32 @wait(i32* null)
%22 = icmp eq i32 %20, 0
br i1 %22, label %23, label %18
23: ; preds = %18
%24 = tail call i32 @exit(i32 0)
unreachable
25: ; preds = %4, %2
%26 = phi i8* [ getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0), %2 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0), %4 ]
%27 = tail call i32 @puts(i8* dereferenceable(1) %26)
ret i32 -1
}