#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_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
void normal_line(char *buf) {
  int i;
  i = 0;
  ft_putchar(' ');
  while (buf && buf[i]) {
    if (buf[i] == '\n' || buf[i] == '\t' || buf[i] == '\0')
      buf[i] = '.';
    i++;
  }
  ft_putchar('|');
  ft_putstr(buf);
  ft_putstr("|\n");
}


x86 assembly (clang, -O0):
<normal_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1162 <normal_line+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1172 <normal_line+0x52>
jmp    11cb <normal_line+0xab>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     11b1 <normal_line+0x91>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
je     11b1 <normal_line+0x91>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    11bd <normal_line+0x9d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x2e,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <normal_line+0x1d>
mov    $0x7c,%edi
call   1030 <ft_putchar@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
lea    0xe1b(%rip),%rdi
call   1040 <ft_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal_line>:
push   %rbx
mov    %rdi,%rbx
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
test   %rbx,%rbx
je     1156 <normal_line+0x36>
mov    %rbx,%rax
jmp    1147 <normal_line+0x27>
nopl   0x0(%rax,%rax,1)
movb   $0x2e,(%rax)
add    $0x1,%rax
movzbl (%rax),%ecx
lea    -0x9(%rcx),%edx
cmp    $0x2,%dl
jb     1140 <normal_line+0x20>
test   %cl,%cl
jne    1143 <normal_line+0x23>
mov    $0x7c,%edi
call   1030 <ft_putchar@plt>
mov    %rbx,%rdi
call   1040 <ft_putstr@plt>
lea    0xe91(%rip),%rdi
pop    %rbx
jmp    1040 <ft_putstr@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"|\0A\00"
define void @normal_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = call i32 @ft_putchar(i8 signext 32)
br label %5
5: ; preds = %47, %1
%6 = load i8*, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %8, %5
%17 = phi i1 [ false, %5 ], [ %15, %8 ]
br i1 %17, label %18, label %50
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 10
br i1 %25, label %42, label %26
26: ; preds = %18
%27 = load i8*, i8** %2
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 9
br i1 %33, label %42, label %34
34: ; preds = %26
%35 = load i8*, i8** %2
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %47
42: ; preds = %34, %26, %18
%43 = load i8*, i8** %2
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %43, i64 %45
store i8 46, i8* %46
br label %47
47: ; preds = %42, %34
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %5
50: ; preds = %16
%51 = call i32 @ft_putchar(i8 signext 124)
%52 = load i8*, i8** %2
%53 = call i32 @ft_putstr(i8* %52)
%54 = call i32 @ft_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"|\0A\00"
define void @normal_line(i8* %0) {
%2 = tail call i32 @ft_putchar(i8 signext 32)
%3 = icmp eq i8* %0, null
br i1 %3, label %11, label %4
4: ; preds = %1, %9
%5 = phi i64 [ %10, %9 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %9 [
i8 0, label %11
i8 10, label %8
i8 9, label %8
]
8: ; preds = %4, %4
store i8 46, i8* %6
br label %9
9: ; preds = %4, %8
%10 = add nuw i64 %5, 1
br label %4
11: ; preds = %4, %1
%12 = tail call i32 @ft_putchar(i8 signext 124)
%13 = tail call i32 @ft_putstr(i8* %0)
%14 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}