#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*/ ft_putstr(char *);
int ft_strlen(char *);
int arg_ok(int ac, char **av) {
  if (ac != 10) {
    ft_putstr("Erreur\n");
    return (0);
  }
  while (--ac > 0) {
    if (ft_strlen(av[ac]) != 9) {
      ft_putstr("Erreur\n");
      return (0);
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<arg_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     1151 <arg_ok+0x31>
lea    0xec0(%rip),%rdi
call   1040 <ft_putstr@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <arg_ok+0x86>
jmp    1156 <arg_ok+0x36>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    119f <arg_ok+0x7f>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x9,%eax
je     119a <arg_ok+0x7a>
lea    0xe77(%rip),%rdi
call   1040 <ft_putstr@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <arg_ok+0x86>
jmp    1156 <arg_ok+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_ok>:
push   %rbx
cmp    $0xa,%edi
jne    11b2 <arg_ok+0x92>
mov    %rsi,%rbx
mov    0x48(%rsi),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x9,%eax
jne    11b2 <arg_ok+0x92>
mov    0x40(%rbx),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x9,%eax
jne    11b2 <arg_ok+0x92>
mov    0x38(%rbx),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x9,%eax
jne    11b2 <arg_ok+0x92>
mov    0x30(%rbx),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x9,%eax
jne    11b2 <arg_ok+0x92>
mov    0x28(%rbx),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x9,%eax
jne    11b2 <arg_ok+0x92>
mov    0x20(%rbx),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x9,%eax
jne    11b2 <arg_ok+0x92>
mov    0x18(%rbx),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x9,%eax
jne    11b2 <arg_ok+0x92>
mov    0x10(%rbx),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x9,%eax
jne    11b2 <arg_ok+0x92>
mov    0x8(%rbx),%rdi
call   1030 <ft_strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x9,%ecx
je     11c0 <arg_ok+0xa0>
lea    0xe47(%rip),%rdi
call   1040 <ft_putstr@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Erreur\0A\00"
define i32 @arg_ok(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @ft_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %27
10: ; preds = %2
br label %11
11: ; preds = %25, %10
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @ft_strlen(i8* %20)
%22 = icmp ne i32 %21, 9
br i1 %22, label %23, label %25
23: ; preds = %15
%24 = call i32 @ft_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %27
25: ; preds = %15
br label %11
26: ; preds = %11
store i32 1, i32* %3
br label %27
27: ; preds = %26, %23, %8
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str = [8 x i8] c"Erreur\0A\00"
define i32 @arg_ok(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 10
br i1 %3, label %4, label %49
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 9
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_strlen(i8* %6)
%8 = icmp eq i32 %7, 9
br i1 %8, label %9, label %49
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 8
%11 = load i8*, i8** %10
%12 = tail call i32 @ft_strlen(i8* %11)
%13 = icmp eq i32 %12, 9
br i1 %13, label %14, label %49
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %1, i64 7
%16 = load i8*, i8** %15
%17 = tail call i32 @ft_strlen(i8* %16)
%18 = icmp eq i32 %17, 9
br i1 %18, label %19, label %49
19: ; preds = %14
%20 = getelementptr inbounds i8*, i8** %1, i64 6
%21 = load i8*, i8** %20
%22 = tail call i32 @ft_strlen(i8* %21)
%23 = icmp eq i32 %22, 9
br i1 %23, label %24, label %49
24: ; preds = %19
%25 = getelementptr inbounds i8*, i8** %1, i64 5
%26 = load i8*, i8** %25
%27 = tail call i32 @ft_strlen(i8* %26)
%28 = icmp eq i32 %27, 9
br i1 %28, label %29, label %49
29: ; preds = %24
%30 = getelementptr inbounds i8*, i8** %1, i64 4
%31 = load i8*, i8** %30
%32 = tail call i32 @ft_strlen(i8* %31)
%33 = icmp eq i32 %32, 9
br i1 %33, label %34, label %49
34: ; preds = %29
%35 = getelementptr inbounds i8*, i8** %1, i64 3
%36 = load i8*, i8** %35
%37 = tail call i32 @ft_strlen(i8* %36)
%38 = icmp eq i32 %37, 9
br i1 %38, label %39, label %49
39: ; preds = %34
%40 = getelementptr inbounds i8*, i8** %1, i64 2
%41 = load i8*, i8** %40
%42 = tail call i32 @ft_strlen(i8* %41)
%43 = icmp eq i32 %42, 9
br i1 %43, label %44, label %49
44: ; preds = %39
%45 = getelementptr inbounds i8*, i8** %1, i64 1
%46 = load i8*, i8** %45
%47 = tail call i32 @ft_strlen(i8* %46)
%48 = icmp eq i32 %47, 9
br i1 %48, label %51, label %49
49: ; preds = %4, %9, %14, %19, %24, %29, %34, %39, %44, %2
%50 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %51
51: ; preds = %49, %44
%52 = phi i32 [ 1, %44 ], [ 0, %49 ]
ret i32 %52
}