#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 eclate(char *, char *, char *);
int interclate(char *, char *, char *, int);
int /*<<< orphan*/ perror(char *);
void tri_externe(char nom[]) {
  int nb, n = 0, L = 1;
  nb = eclate(nom, "f3", "f4");
  perror("eclate");
  while (nb > 1) {
    n = !n;
    if (n)
      nb = interclate(nom, "f3", "f4", L);
    else
      nb = interclate(nom, "f3", "f4", L);
    L = L * 2;
  }
}


x86 assembly (clang, -O0):
<tri_externe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
lea    0xea7(%rip),%rdx
call   1030 <eclate@plt>
mov    %eax,-0xc(%rbp)
lea    0xe9b(%rip),%rdi
call   1050 <perror@plt>
cmpl   $0x1,-0xc(%rbp)
jle    11e2 <tri_externe+0xb2>
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     11b7 <tri_externe+0x87>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
lea    0xe5d(%rip),%rsi
lea    0xe59(%rip),%rdx
call   1040 <interclate@plt>
mov    %eax,-0xc(%rbp)
jmp    11d4 <tri_externe+0xa4>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
lea    0xe3b(%rip),%rsi
lea    0xe37(%rip),%rdx
call   1040 <interclate@plt>
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <tri_externe+0x40>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tri_externe>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
lea    0xebb(%rip),%rdx
call   1030 <eclate@plt>
mov    %eax,%ebp
lea    0xeb0(%rip),%rdi
call   1050 <perror@plt>
cmp    $0x2,%ebp
jl     1197 <tri_externe+0x67>
mov    $0x1,%ebp
lea    0xe94(%rip),%r14
lea    0xe90(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %ebp,%ecx
call   1040 <interclate@plt>
add    %ebp,%ebp
cmp    $0x1,%eax
jg     1180 <tri_externe+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"f3\00"
@.str.1 = [3 x i8] c"f4\00"
@.str.2 = [7 x i8] c"eclate\00"
define void @tri_externe(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 1, i32* %5
%6 = load i8*, i8** %2
%7 = call i32 @eclate(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %3
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %27, %1
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %30
12: ; preds = %9
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %12
%20 = load i8*, i8** %2
%21 = load i32, i32* %5
%22 = call i32 @interclate(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %21)
store i32 %22, i32* %3
br label %27
23: ; preds = %12
%24 = load i8*, i8** %2
%25 = load i32, i32* %5
%26 = call i32 @interclate(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %25)
store i32 %26, i32* %3
br label %27
27: ; preds = %23, %19
%28 = load i32, i32* %5
%29 = mul nsw i32 %28, 2
store i32 %29, i32* %5
br label %9
30: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"f3\00"
@.str.1 = [3 x i8] c"f4\00"
@.str.2 = [7 x i8] c"eclate\00"
define void @tri_externe(i8* %0) {
%2 = tail call i32 @eclate(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp sgt i32 %2, 1
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 1, %1 ]
%7 = tail call i32 @interclate(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = shl nsw i32 %6, 1
%9 = icmp sgt i32 %7, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret void
}