#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*/ MINITELEnvoyerCaractere(int, int);
int /*<<< orphan*/ MINITELEnvoyerTexte(int, unsigned char const *);
int /*<<< orphan*/ printf(char *, char *, int);
int strlen(char *);
int CratyleImprime(char *strMot, int iFileDescriptor) {
  static int iCaracteresImprime = 0;
  if (!strMot || !iFileDescriptor)
    return -1;
  iCaracteresImprime = iCaracteresImprime + strlen(strMot) + 1;
  if (iCaracteresImprime > 1920) {
    iCaracteresImprime = 0;
    MINITELEnvoyerCaractere(iFileDescriptor, 0x0C);
  }
  printf("CratyleImprime %s - nb : %d\n", strMot, iCaracteresImprime);
  MINITELEnvoyerTexte(iFileDescriptor, (const unsigned char *)strMot);
  MINITELEnvoyerTexte(iFileDescriptor, (const unsigned char *)" ");
  return 0;
}


x86 assembly (clang, -O0):
<CratyleImprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <CratyleImprime+0x24>
cmpl   $0x0,-0x14(%rbp)
jne    1170 <CratyleImprime+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    11f1 <CratyleImprime+0xb1>
mov    0x2ece(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x2eb2(%rip)
cmpl   $0x780,0x2ea8(%rip)
jle    11b9 <CratyleImprime+0x79>
movl   $0x0,0x2e98(%rip)
mov    -0x14(%rbp),%edi
mov    $0xc,%esi
call   1060 <MINITELEnvoyerCaractere@plt>
mov    -0x10(%rbp),%rsi
mov    0x2e81(%rip),%edx
lea    0xe36(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <MINITELEnvoyerTexte@plt>
mov    -0x14(%rbp),%edi
lea    0xe38(%rip),%rsi
call   1030 <MINITELEnvoyerTexte@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CratyleImprime>:
push   %rbp
push   %r14
push   %rbx
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     11c2 <CratyleImprime+0x82>
mov    %esi,%r14d
test   %esi,%esi
je     11c2 <CratyleImprime+0x82>
mov    %rdi,%rbx
mov    0x2ee6(%rip),%ebp
call   1040 <strlen@plt>
lea    (%rax,%rbp,1),%ecx
lea    (%rax,%rbp,1),%edx
add    $0x1,%edx
mov    %edx,0x2ed2(%rip)
cmp    $0x780,%ecx
jl     1197 <CratyleImprime+0x57>
movl   $0x0,0x2ec0(%rip)
mov    %r14d,%edi
mov    $0xc,%esi
call   1060 <MINITELEnvoyerCaractere@plt>
mov    0x2ead(%rip),%edx
lea    0xe62(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1030 <MINITELEnvoyerTexte@plt>
lea    0xe65(%rip),%rsi
mov    %r14d,%edi
call   1030 <MINITELEnvoyerTexte@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@CratyleImprime.iCaracteresImprime = internal global i32 0
@.str = [29 x i8] c"CratyleImprime %s - nb : %d\0A\00"
@.str.1 = [2 x i8] c" \00"
define i32 @CratyleImprime(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %32
12: ; preds = %8
%13 = load i32, i32* @CratyleImprime.iCaracteresImprime
%14 = load i8*, i8** %4
%15 = call i32 @strlen(i8* %14)
%16 = add nsw i32 %13, %15
%17 = add nsw i32 %16, 1
store i32 %17, i32* @CratyleImprime.iCaracteresImprime
%18 = load i32, i32* @CratyleImprime.iCaracteresImprime
%19 = icmp sgt i32 %18, 1920
br i1 %19, label %20, label %23
20: ; preds = %12
store i32 0, i32* @CratyleImprime.iCaracteresImprime
%21 = load i32, i32* %5
%22 = call i32 @MINITELEnvoyerCaractere(i32 %21, i32 12)
br label %23
23: ; preds = %20, %12
%24 = load i8*, i8** %4
%25 = load i32, i32* @CratyleImprime.iCaracteresImprime
%26 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %24, i32 %25)
%27 = load i32, i32* %5
%28 = load i8*, i8** %4
%29 = call i32 @MINITELEnvoyerTexte(i32 %27, i8* %28)
%30 = load i32, i32* %5
%31 = call i32 @MINITELEnvoyerTexte(i32 %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %32
32: ; preds = %23, %11
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@CratyleImprime.iCaracteresImprime = internal unnamed_addr global i32 0
@.str = [29 x i8] c"CratyleImprime %s - nb : %d\0A\00"
@.str.1 = [2 x i8] c" \00"
define i32 @CratyleImprime(i8* %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %20
6: ; preds = %2
%7 = load i32, i32* @CratyleImprime.iCaracteresImprime
%8 = tail call i32 @strlen(i8* %0)
%9 = add nsw i32 %8, %7
%10 = add nsw i32 %9, 1
store i32 %10, i32* @CratyleImprime.iCaracteresImprime
%11 = icmp sgt i32 %9, 1919
br i1 %11, label %12, label %15
12: ; preds = %6
store i32 0, i32* @CratyleImprime.iCaracteresImprime
%13 = tail call i32 @MINITELEnvoyerCaractere(i32 %1, i32 12)
%14 = load i32, i32* @CratyleImprime.iCaracteresImprime
br label %15
15: ; preds = %12, %6
%16 = phi i32 [ %14, %12 ], [ %10, %6 ]
%17 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %16)
%18 = tail call i32 @MINITELEnvoyerTexte(i32 %1, i8* %0)
%19 = tail call i32 @MINITELEnvoyerTexte(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %2, %15
%21 = phi i32 [ 0, %15 ], [ -1, %2 ]
ret i32 %21
}