#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_ech_expr(char const *);
scalar_t__ ft_ech_isoption(char const);
char *ft_ech_option_array();
int /*<<< orphan*/ ft_isdigit(char const);
int /*<<< orphan*/ ft_putchar(char const);
void ft_ech_put(const char *str) {
  const char *backslash = ft_ech_option_array();
  while (*str) {
    if (*str != '\\') {
      (void)ft_putchar(*str);
    } else if (*++str != 'x' && !ft_isdigit(*str)) {
      if (*str == 'c')
        break;
      if (ft_ech_isoption(*str))
        (void)ft_putchar(*(*str + backslash));
    } else {
      (void)ft_ech_expr(str);
      str += 2;
    }
    str += 1;
  }
  return;
}


x86 assembly (clang, -O0):
<ft_ech_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <ft_ech_option_array@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1238 <ft_ech_put+0xe8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1195 <ft_ech_put+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1060 <ft_putchar@plt>
jmp    1227 <ft_ech_put+0xd7>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
je     120d <ft_ech_put+0xbd>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ft_isdigit@plt>
cmp    $0x0,%eax
jne    120d <ft_ech_put+0xbd>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    11db <ft_ech_put+0x8b>
jmp    1238 <ft_ech_put+0xe8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1070 <ft_ech_isoption@plt>
cmp    $0x0,%rax
je     1208 <ft_ech_put+0xb8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1060 <ft_putchar@plt>
jmp    1222 <ft_ech_put+0xd2>
mov    -0x8(%rbp),%rdi
call   1050 <ft_ech_expr@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1227 <ft_ech_put+0xd7>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <ft_ech_put+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ech_put>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <ft_ech_option_array@plt>
mov    %rax,%r14
jmp    1180 <ft_ech_put+0x30>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
call   1050 <ft_ech_expr@plt>
add    $0x3,%rbx
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x5c,%al
je     11a0 <ft_ech_put+0x50>
test   %al,%al
je     11ed <ft_ech_put+0x9d>
movsbl %al,%edi
call   1060 <ft_putchar@plt>
add    $0x1,%rbx
jmp    1180 <ft_ech_put+0x30>
nopl   0x0(%rax)
lea    0x1(%rbx),%r15
movzbl 0x1(%rbx),%eax
cmp    $0x78,%al
je     1170 <ft_ech_put+0x20>
movsbl %al,%edi
call   1030 <ft_isdigit@plt>
test   %eax,%eax
jne    1170 <ft_ech_put+0x20>
movzbl (%r15),%eax
cmp    $0x63,%al
je     11ed <ft_ech_put+0x9d>
movsbl %al,%edi
call   1070 <ft_ech_isoption@plt>
test   %rax,%rax
je     11e4 <ft_ech_put+0x94>
movsbq (%r15),%rax
movsbl (%r14,%rax,1),%edi
call   1060 <ft_putchar@plt>
mov    %r15,%rbx
add    $0x1,%rbx
jmp    1180 <ft_ech_put+0x30>
mov    %r15,%rbx
add    $0x1,%rbx
jmp    1180 <ft_ech_put+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ft_ech_put(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* (...) @ft_ech_option_array()
store i8* %4, i8** %3
br label %5
5: ; preds = %56, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %59
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 92
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = call i32 @ft_putchar(i8 signext %16)
br label %56
18: ; preds = %9
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 120
br i1 %23, label %24, label %50
24: ; preds = %18
%25 = load i8*, i8** %2
%26 = load i8, i8* %25
%27 = call i32 @ft_isdigit(i8 signext %26)
%28 = icmp ne i32 %27, 0
br i1 %28, label %50, label %29
29: ; preds = %24
%30 = load i8*, i8** %2
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 99
br i1 %33, label %34, label %35
34: ; preds = %29
br label %59
35: ; preds = %29
%36 = load i8*, i8** %2
%37 = load i8, i8* %36
%38 = call i64 @ft_ech_isoption(i8 signext %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %49
40: ; preds = %35
%41 = load i8*, i8** %2
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = load i8*, i8** %3
%45 = sext i32 %43 to i64
%46 = getelementptr inbounds i8, i8* %44, i64 %45
%47 = load i8, i8* %46
%48 = call i32 @ft_putchar(i8 signext %47)
br label %49
49: ; preds = %40, %35
br label %55
50: ; preds = %24, %18
%51 = load i8*, i8** %2
%52 = call i32 @ft_ech_expr(i8* %51)
%53 = load i8*, i8** %2
%54 = getelementptr inbounds i8, i8* %53, i64 2
store i8* %54, i8** %2
br label %55
55: ; preds = %50, %49
br label %56
56: ; preds = %55, %14
%57 = load i8*, i8** %2
%58 = getelementptr inbounds i8, i8* %57, i64 1
store i8* %58, i8** %2
br label %5
59: ; preds = %34, %5
ret void
}

LLVM IR (-O2):
define void @ft_ech_put(i8* %0) {
%2 = tail call i8* (...) @ft_ech_option_array()
br label %3
3: ; preds = %30, %1
%4 = phi i8* [ %0, %1 ], [ %32, %30 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %33
i8 92, label %8
]
6: ; preds = %3
%7 = tail call i32 @ft_putchar(i8 signext %5)
br label %30
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 120
br i1 %11, label %27, label %12
12: ; preds = %8
%13 = tail call i32 @ft_isdigit(i8 signext %10)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i8, i8* %9
%17 = icmp eq i8 %16, 99
br i1 %17, label %33, label %18
18: ; preds = %15
%19 = tail call i64 @ft_ech_isoption(i8 signext %16)
%20 = icmp eq i64 %19, 0
br i1 %20, label %30, label %21
21: ; preds = %18
%22 = load i8, i8* %9
%23 = sext i8 %22 to i64
%24 = getelementptr inbounds i8, i8* %2, i64 %23
%25 = load i8, i8* %24
%26 = tail call i32 @ft_putchar(i8 signext %25)
br label %30
27: ; preds = %12, %8
%28 = tail call i32 @ft_ech_expr(i8* %9)
%29 = getelementptr inbounds i8, i8* %4, i64 3
br label %30
30: ; preds = %27, %21, %18, %6
%31 = phi i8* [ %4, %6 ], [ %29, %27 ], [ %9, %21 ], [ %9, %18 ]
%32 = getelementptr inbounds i8, i8* %31, i64 1
br label %3
33: ; preds = %3, %15
ret void
}