#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 nbElementsCommande(char **);
scalar_t__ strcmp(char *, char *);
void nbCommandesCaractereSpeciaux(char *commande[], int tabNbCommande[]) {
  int i = 0, j = 0;
  int nbCommande = 0;
  for (i = 0; i < nbElementsCommande(commande); i++) {
    if (strcmp(commande[i], "|") != 0 || strcmp(commande[i], ";") != 0) {
      tabNbCommande[j] = ++nbCommande;
    } else {
      j++;
      nbCommande = 0;
    }
  }
}


x86 assembly (clang, -O0):
<nbCommandesCaractereSpeciaux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <nbElementsCommande@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jge    11e8 <nbCommandesCaractereSpeciaux+0xc8>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe85(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ac <nbCommandesCaractereSpeciaux+0x8c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe65(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11c5 <nbCommandesCaractereSpeciaux+0xa5>
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    11d5 <nbCommandesCaractereSpeciaux+0xb5>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
jmp    11da <nbCommandesCaractereSpeciaux+0xba>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <nbCommandesCaractereSpeciaux+0x2c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbCommandesCaractereSpeciaux>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r13
call   1030 <nbElementsCommande@plt>
test   %eax,%eax
jle    119e <nbCommandesCaractereSpeciaux+0x7e>
xor    %ebx,%ebx
lea    0xebd(%rip),%r15
xor    %r12d,%r12d
xor    %ebp,%ebp
jmp    116e <nbCommandesCaractereSpeciaux+0x4e>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12d
movslq %ebp,%rax
mov    %r12d,(%r14,%rax,4)
add    $0x1,%rbx
mov    %r13,%rdi
call   1030 <nbElementsCommande@plt>
cltq
cmp    %rax,%rbx
jge    119e <nbCommandesCaractereSpeciaux+0x7e>
mov    0x0(%r13,%rbx,8),%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1150 <nbCommandesCaractereSpeciaux+0x30>
mov    0x0(%r13,%rbx,8),%rdi
lea    0xe76(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1150 <nbCommandesCaractereSpeciaux+0x30>
add    $0x1,%ebp
xor    %r12d,%r12d
jmp    115b <nbCommandesCaractereSpeciaux+0x3b>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"|\00"
@.str.1 = [2 x i8] c";\00"
define void @nbCommandesCaractereSpeciaux(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
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %5
br label %8
8: ; preds = %40, %2
%9 = load i32, i32* %5
%10 = load i8**, i8*** %3
%11 = call i32 @nbElementsCommande(i8** %10)
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %43
13: ; preds = %8
%14 = load i8**, i8*** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br i1 %20, label %29, label %21
21: ; preds = %13
%22 = load i8**, i8*** %3
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %36
29: ; preds = %21, %13
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
%32 = load i32*, i32** %4
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
store i32 %31, i32* %35
br label %39
36: ; preds = %21
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
store i32 0, i32* %7
br label %39
39: ; preds = %36, %29
br label %40
40: ; preds = %39
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %8
43: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
@.str.1 = [2 x i8] c";\00"
define void @nbCommandesCaractereSpeciaux(i8** %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @nbElementsCommande(i8** %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %30
5: ; preds = %2, %23
%6 = phi i64 [ %26, %23 ], [ 0, %2 ]
%7 = phi i32 [ %25, %23 ], [ 0, %2 ]
%8 = phi i32 [ %24, %23 ], [ 0, %2 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %6
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %5
%14 = load i8*, i8** %9
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %13, %5
%18 = add nsw i32 %7, 1
%19 = sext i32 %8 to i64
%20 = getelementptr inbounds i32, i32* %1, i64 %19
store i32 %18, i32* %20
br label %23
21: ; preds = %13
%22 = add nsw i32 %8, 1
br label %23
23: ; preds = %17, %21
%24 = phi i32 [ %8, %17 ], [ %22, %21 ]
%25 = phi i32 [ %18, %17 ], [ 0, %21 ]
%26 = add nuw nsw i64 %6, 1
%27 = tail call i32 @nbElementsCommande(i8** %0)
%28 = sext i32 %27 to i64
%29 = icmp slt i64 %26, %28
br i1 %29, label %5, label %30
30: ; preds = %23, %2
ret void
}