#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*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_it(char *line, char *p) {
  *p++ = '\n';
  *p = 0;
  fputs(line, stdout);
  for (p = line; *p; p++)
    if (*p == '+' || *p == '|')
      *p = '|';
    else
      *p = ' ';
}


x86 assembly (clang, -O0):
<print_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0xa,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11a9 <print_it+0x99>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     1180 <print_it+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7c,%eax
jne    118c <print_it+0x7c>
mov    -0x10(%rbp),%rax
movb   $0x7c,(%rax)
jmp    1193 <print_it+0x83>
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
jmp    1198 <print_it+0x88>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1153 <print_it+0x43>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_it>:
push   %rbx
mov    %rdi,%rbx
movw   $0xa,(%rsi)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1136 <print_it+0x26>
nopl   0x0(%rax)
mov    %al,(%rbx)
add    $0x1,%rbx
movzbl (%rbx),%ecx
mov    $0x7c,%al
cmp    $0x2b,%cl
je     1130 <print_it+0x20>
cmp    $0x7c,%cl
je     1130 <print_it+0x20>
test   %cl,%cl
je     114d <print_it+0x3d>
mov    $0x20,%al
jmp    1130 <print_it+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @print_it(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %4
store i8 10, i8* %5
%7 = load i8*, i8** %4
store i8 0, i8* %7
%8 = load i8*, i8** %3
%9 = load i32, i32* @stdout
%10 = call i32 @fputs(i8* %8, i32 %9)
%11 = load i8*, i8** %3
store i8* %11, i8** %4
br label %12
12: ; preds = %31, %2
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %34
16: ; preds = %12
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 43
br i1 %20, label %26, label %21
21: ; preds = %16
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 124
br i1 %25, label %26, label %28
26: ; preds = %21, %16
%27 = load i8*, i8** %4
store i8 124, i8* %27
br label %30
28: ; preds = %21
%29 = load i8*, i8** %4
store i8 32, i8* %29
br label %30
30: ; preds = %28, %26
br label %31
31: ; preds = %30
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %4
br label %12
34: ; preds = %12
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_it(i8* %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 10, i8* %1
store i8 0, i8* %3
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* %0, i32 %4)
br label %6
6: ; preds = %10, %2
%7 = phi i8* [ %0, %2 ], [ %12, %10 ]
%8 = load i8, i8* %7
switch i8 %8, label %9 [
i8 0, label %13
i8 43, label %10
i8 124, label %10
]
9: ; preds = %6
br label %10
10: ; preds = %6, %6, %9
%11 = phi i8 [ 32, %9 ], [ 124, %6 ], [ 124, %6 ]
store i8 %11, i8* %7
%12 = getelementptr inbounds i8, i8* %7, i64 1
br label %6
13: ; preds = %6
ret void
}