#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*/ err_message(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ make_binary(char *, char *, char *, int);
char *nextpar(char *, char *);
void make_binary_or_unrooted(char *arbre) {
  char *finarbre, *deba, *debb, *debc;
  finarbre = nextpar(arbre, arbre);
  *(finarbre + 1) = 0;
  deba = arbre + 1;
  debb = deba;
  while (*debb != ',') {
    if (*debb == 0) {
      err_message("Incorrect tree file");
      exit(1);
    }
    if (*debb == '(')
      debb = nextpar(debb, debb);
    debb++;
  }
  debb++;
  debc = debb;
  while (*debc != ',' && debc < finarbre) {
    if (*debc == '(')
      debc = nextpar(debc, debc);
    debc++;
  }
  if (*debc == ',') {
    make_binary(arbre, debb, finarbre - 1, (!0));
    make_binary(arbre, deba, debb - 2, (!0));
  } else
    make_binary(arbre, deba, finarbre - 1, (!0));
  return;
}


x86 assembly (clang, -O0):
<make_binary_or_unrooted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <nextpar@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
je     11e1 <make_binary_or_unrooted+0xa1>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11af <make_binary_or_unrooted+0x6f>
lea    0xe60(%rip),%rdi
call   1040 <err_message@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
jne    11d0 <make_binary_or_unrooted+0x90>
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <nextpar@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1179 <make_binary_or_unrooted+0x39>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2c,%ecx
mov    %al,-0x29(%rbp)
je     1218 <make_binary_or_unrooted+0xd8>
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1228 <make_binary_or_unrooted+0xe8>
jmp    125a <make_binary_or_unrooted+0x11a>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
jne    1249 <make_binary_or_unrooted+0x109>
mov    -0x28(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <nextpar@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11f5 <make_binary_or_unrooted+0xb5>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    12a3 <make_binary_or_unrooted+0x163>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0xffffffffffffffff,%rdx
mov    $0x1,%ecx
call   1030 <make_binary@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0xfffffffffffffffe,%rdx
mov    $0x1,%ecx
call   1030 <make_binary@plt>
jmp    12bd <make_binary_or_unrooted+0x17d>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0xffffffffffffffff,%rdx
mov    $0x1,%ecx
call   1030 <make_binary@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_binary_or_unrooted>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r15
mov    %rdi,%rsi
call   1050 <nextpar@plt>
mov    %rax,%r12
movb   $0x0,0x1(%rax)
lea    0x1(%r15),%r14
mov    %r14,%rbx
jmp    1182 <make_binary_or_unrooted+0x42>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1050 <nextpar@plt>
mov    %rax,%rbx
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x28,%al
je     1170 <make_binary_or_unrooted+0x30>
cmp    $0x2c,%al
je     11a7 <make_binary_or_unrooted+0x67>
test   %al,%al
jne    117e <make_binary_or_unrooted+0x3e>
lea    0xe68(%rip),%rdi
call   1040 <err_message@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0x1(%rbx),%r13
mov    0x1(%rbx),%cl
cmp    $0x2c,%cl
je     11e2 <make_binary_or_unrooted+0xa2>
cmp    %r12,%r13
jae    11e2 <make_binary_or_unrooted+0xa2>
mov    %r13,%rax
nopl   0x0(%rax,%rax,1)
cmp    $0x28,%cl
jne    11d0 <make_binary_or_unrooted+0x90>
mov    %rax,%rdi
mov    %rax,%rsi
call   1050 <nextpar@plt>
movzbl 0x1(%rax),%ecx
cmp    $0x2c,%cl
je     11e2 <make_binary_or_unrooted+0xa2>
add    $0x1,%rax
cmp    %r12,%rax
jb     11c0 <make_binary_or_unrooted+0x80>
add    $0xffffffffffffffff,%r12
cmp    $0x2c,%cl
jne    1205 <make_binary_or_unrooted+0xc5>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    $0x1,%ecx
call   1030 <make_binary@plt>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%r12
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    $0x1,%ecx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <make_binary@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Incorrect tree file\00"
define void @make_binary_or_unrooted(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i8* @nextpar(i8* %7, i8* %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 0, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %4
%14 = load i8*, i8** %4
store i8* %14, i8** %5
br label %15
15: ; preds = %37, %1
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 44
br i1 %19, label %20, label %40
20: ; preds = %15
%21 = load i8*, i8** %5
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = call i32 @err_message(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %20
%29 = load i8*, i8** %5
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 40
br i1 %32, label %33, label %37
33: ; preds = %28
%34 = load i8*, i8** %5
%35 = load i8*, i8** %5
%36 = call i8* @nextpar(i8* %34, i8* %35)
store i8* %36, i8** %5
br label %37
37: ; preds = %33, %28
%38 = load i8*, i8** %5
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %5
br label %15
40: ; preds = %15
%41 = load i8*, i8** %5
%42 = getelementptr inbounds i8, i8* %41, i32 1
store i8* %42, i8** %5
%43 = load i8*, i8** %5
store i8* %43, i8** %6
br label %44
44: ; preds = %64, %40
%45 = load i8*, i8** %6
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 44
br i1 %48, label %49, label %53
49: ; preds = %44
%50 = load i8*, i8** %6
%51 = load i8*, i8** %3
%52 = icmp ult i8* %50, %51
br label %53
53: ; preds = %49, %44
%54 = phi i1 [ false, %44 ], [ %52, %49 ]
br i1 %54, label %55, label %67
55: ; preds = %53
%56 = load i8*, i8** %6
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = icmp eq i32 %58, 40
br i1 %59, label %60, label %64
60: ; preds = %55
%61 = load i8*, i8** %6
%62 = load i8*, i8** %6
%63 = call i8* @nextpar(i8* %61, i8* %62)
store i8* %63, i8** %6
br label %64
64: ; preds = %60, %55
%65 = load i8*, i8** %6
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %6
br label %44
67: ; preds = %53
%68 = load i8*, i8** %6
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 44
br i1 %71, label %72, label %83
72: ; preds = %67
%73 = load i8*, i8** %2
%74 = load i8*, i8** %5
%75 = load i8*, i8** %3
%76 = getelementptr inbounds i8, i8* %75, i64 -1
%77 = call i32 @make_binary(i8* %73, i8* %74, i8* %76, i32 1)
%78 = load i8*, i8** %2
%79 = load i8*, i8** %4
%80 = load i8*, i8** %5
%81 = getelementptr inbounds i8, i8* %80, i64 -2
%82 = call i32 @make_binary(i8* %78, i8* %79, i8* %81, i32 1)
br label %89
83: ; preds = %67
%84 = load i8*, i8** %2
%85 = load i8*, i8** %4
%86 = load i8*, i8** %3
%87 = getelementptr inbounds i8, i8* %86, i64 -1
%88 = call i32 @make_binary(i8* %84, i8* %85, i8* %87, i32 1)
br label %89
89: ; preds = %83, %72
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Incorrect tree file\00"
define void @make_binary_or_unrooted(i8* %0) {
%2 = tail call i8* @nextpar(i8* %0, i8* %0)
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 1
br label %5
5: ; preds = %13, %1
%6 = phi i8* [ %4, %1 ], [ %15, %13 ]
%7 = load i8, i8* %6
switch i8 %7, label %13 [
i8 44, label %16
i8 0, label %8
i8 40, label %11
]
8: ; preds = %5
%9 = tail call i32 @err_message(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
%12 = tail call i8* @nextpar(i8* %6, i8* %6)
br label %13
13: ; preds = %5, %11
%14 = phi i8* [ %12, %11 ], [ %6, %5 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
br label %5
16: ; preds = %5
%17 = getelementptr inbounds i8, i8* %6, i64 1
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 44
%20 = icmp ult i8* %17, %2
%21 = select i1 %19, i1 %20, i1 false
br i1 %21, label %22, label %35
22: ; preds = %16, %28
%23 = phi i8 [ %31, %28 ], [ %18, %16 ]
%24 = phi i8* [ %30, %28 ], [ %17, %16 ]
%25 = icmp eq i8 %23, 40
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = tail call i8* @nextpar(i8* %24, i8* %24)
br label %28
28: ; preds = %26, %22
%29 = phi i8* [ %27, %26 ], [ %24, %22 ]
%30 = getelementptr inbounds i8, i8* %29, i64 1
%31 = load i8, i8* %30
%32 = icmp ne i8 %31, 44
%33 = icmp ult i8* %30, %2
%34 = select i1 %32, i1 %33, i1 false
br i1 %34, label %22, label %35
35: ; preds = %28, %16
%36 = phi i8 [ %18, %16 ], [ %31, %28 ]
%37 = icmp eq i8 %36, 44
%38 = getelementptr inbounds i8, i8* %2, i64 -1
br i1 %37, label %39, label %42
39: ; preds = %35
%40 = tail call i32 @make_binary(i8* %0, i8* %17, i8* %38, i32 1)
%41 = getelementptr inbounds i8, i8* %6, i64 -1
br label %42
42: ; preds = %35, %39
%43 = phi i8* [ %41, %39 ], [ %38, %35 ]
%44 = tail call i32 @make_binary(i8* %0, i8* %4, i8* %43, i32 1)
ret void
}