#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*/ safe_copy_chr(char, char *, char **, int);
int /*<<< orphan*/ safe_copy_str(char *, char *, char **, int);
int /*<<< orphan*/ safe_known_str(char *, int, char *, char **);
void pretty_format(char *dest, char **cp, char *p) {
  int indent_lev, i;
  indent_lev = 0;
  safe_known_str("\r\n", 2, (dest), (cp));
  while (*p) {
    switch (*p) {
    case '\\':
      safe_copy_chr((*p), (dest), (cp), (8192 - 1));
      p++;
      safe_copy_chr((*p), (dest), (cp), (8192 - 1));
      if (!*p) {
        return;
      }
      break;
    case '{':
      safe_known_str("\r\n", 2, (dest), (cp));
      for (i = 0; i < indent_lev; i++) {
        safe_copy_str(((char *)"  "), (dest), (cp), (8192 - 1));
      }
      safe_copy_chr((*p), (dest), (cp), (8192 - 1));
      safe_known_str("\r\n", 2, (dest), (cp));
      indent_lev++;
      for (i = 0; i < indent_lev; i++) {
        safe_copy_str(((char *)"  "), (dest), (cp), (8192 - 1));
      }
      while (p[1] == ' ') {
        p++;
      }
      break;
    case '}':
      if (indent_lev > 0) {
        indent_lev--;
      }
      safe_known_str("\r\n", 2, (dest), (cp));
      for (i = 0; i < indent_lev; i++) {
        safe_copy_str(((char *)"  "), (dest), (cp), (8192 - 1));
      }
      safe_copy_chr((*p), (dest), (cp), (8192 - 1));
      safe_known_str("\r\n", 2, (dest), (cp));
      for (i = 0; i < indent_lev; i++) {
        safe_copy_str(((char *)"  "), (dest), (cp), (8192 - 1));
      }
      while (p[1] == ' ') {
        p++;
      }
      break;
    case ';':
      safe_copy_chr((*p), (dest), (cp), (8192 - 1));
      safe_known_str("\r\n", 2, (dest), (cp));
      for (i = 0; i < indent_lev; i++) {
        safe_copy_str(((char *)"  "), (dest), (cp), (8192 - 1));
      }
      while (p[1] == ' ') {
        p++;
      }
      break;
    default:
      safe_copy_chr((*p), (dest), (cp), (8192 - 1));
      break;
    }
    p++;
  }
  if (*(*cp - 1) != '\n') {
    safe_known_str("\r\n", 2, (dest), (cp));
  }
}


x86 assembly (clang, -O0):
<pretty_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea6(%rip),%rdi
mov    $0x2,%esi
call   1030 <safe_known_str@plt>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     14d1 <pretty_format+0x3a1>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x24(%rbp)
sub    $0x3b,%eax
je     140b <pretty_format+0x2db>
jmp    1189 <pretty_format+0x59>
mov    -0x24(%rbp),%eax
sub    $0x5c,%eax
je     11bc <pretty_format+0x8c>
jmp    119a <pretty_format+0x6a>
mov    -0x24(%rbp),%eax
sub    $0x7b,%eax
je     1215 <pretty_format+0xe5>
jmp    11ab <pretty_format+0x7b>
mov    -0x24(%rbp),%eax
sub    $0x7d,%eax
je     130b <pretty_format+0x1db>
jmp    14a5 <pretty_format+0x375>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl %al,%edi
call   1040 <safe_copy_chr@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl %al,%edi
call   1040 <safe_copy_chr@plt>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1210 <pretty_format+0xe0>
jmp    14fe <pretty_format+0x3ce>
jmp    14c0 <pretty_format+0x390>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xddc(%rip),%rdi
mov    $0x2,%esi
call   1030 <safe_known_str@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1268 <pretty_format+0x138>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xdb3(%rip),%rdi
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1235 <pretty_format+0x105>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl %al,%edi
call   1040 <safe_copy_chr@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xd6e(%rip),%rdi
mov    $0x2,%esi
call   1030 <safe_known_str@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12df <pretty_format+0x1af>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xd3c(%rip),%rdi
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12ac <pretty_format+0x17c>
jmp    12e4 <pretty_format+0x1b4>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
jne    1306 <pretty_format+0x1d6>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    12e4 <pretty_format+0x1b4>
jmp    14c0 <pretty_format+0x390>
cmpl   $0x0,-0x1c(%rbp)
jle    131e <pretty_format+0x1ee>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xcd3(%rip),%rdi
mov    $0x2,%esi
call   1030 <safe_known_str@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1371 <pretty_format+0x241>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xcaa(%rip),%rdi
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    133e <pretty_format+0x20e>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl %al,%edi
call   1040 <safe_copy_chr@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xc65(%rip),%rdi
mov    $0x2,%esi
call   1030 <safe_known_str@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13df <pretty_format+0x2af>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xc3c(%rip),%rdi
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13ac <pretty_format+0x27c>
jmp    13e4 <pretty_format+0x2b4>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
jne    1406 <pretty_format+0x2d6>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    13e4 <pretty_format+0x2b4>
jmp    14c0 <pretty_format+0x390>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl %al,%edi
call   1040 <safe_copy_chr@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xbcb(%rip),%rdi
mov    $0x2,%esi
call   1030 <safe_known_str@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1479 <pretty_format+0x349>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xba2(%rip),%rdi
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1446 <pretty_format+0x316>
jmp    147e <pretty_format+0x34e>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
jne    14a0 <pretty_format+0x370>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    147e <pretty_format+0x34e>
jmp    14c0 <pretty_format+0x390>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1fff,%ecx
movsbl %al,%edi
call   1040 <safe_copy_chr@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1164 <pretty_format+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl -0x1(%rax),%eax
cmp    $0xa,%eax
je     14fe <pretty_format+0x3ce>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xb0c(%rip),%rdi
mov    $0x2,%esi
call   1030 <safe_known_str@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pretty_format>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xeb5(%rip),%rdi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <safe_known_str@plt>
mov    (%rbx),%al
test   %al,%al
je     13ea <pretty_format+0x2ba>
xor    %r12d,%r12d
lea    0xe91(%rip),%rbp
lea    0xe8d(%rip),%r13
jmp    119f <pretty_format+0x6f>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1040 <safe_copy_chr@plt>
mov    0x1(%rbx),%al
add    $0x1,%rbx
test   %al,%al
je     13ea <pretty_format+0x2ba>
movsbl %al,%edi
cmp    $0x7a,%edi
jg     11f0 <pretty_format+0xc0>
cmp    $0x3b,%edi
je     12a0 <pretty_format+0x170>
cmp    $0x5c,%edi
jne    1180 <pretty_format+0x50>
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1040 <safe_copy_chr@plt>
movsbl 0x1(%rbx),%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1040 <safe_copy_chr@plt>
cmpb   $0x0,0x1(%rbx)
je     13f3 <pretty_format+0x2c3>
add    $0x1,%rbx
jmp    1190 <pretty_format+0x60>
nopl   0x0(%rax)
cmp    $0x7b,%edi
je     1300 <pretty_format+0x1d0>
cmp    $0x7d,%edi
jne    1180 <pretty_format+0x50>
xor    %eax,%eax
test   %r12d,%r12d
setg   %al
sub    %eax,%r12d
mov    %rbp,%rdi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <safe_known_str@plt>
test   %r12d,%r12d
mov    %r12,(%rsp)
jle    13a6 <pretty_format+0x276>
mov    %r12d,%ebp
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
add    $0xffffffff,%ebp
jne    1230 <pretty_format+0x100>
movsbl (%rbx),%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1040 <safe_copy_chr@plt>
lea    0xd9e(%rip),%rdi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <safe_known_str@plt>
mov    %r12,%rax
test   %eax,%eax
jle    13cc <pretty_format+0x29c>
nopl   (%rax)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
add    $0xffffffff,%r12d
jne    1280 <pretty_format+0x150>
jmp    13cc <pretty_format+0x29c>
xchg   %ax,%ax
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1040 <safe_copy_chr@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <safe_known_str@plt>
test   %r12d,%r12d
jle    12e8 <pretty_format+0x1b8>
mov    %r12d,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
add    $0xffffffff,%ebp
jne    12d0 <pretty_format+0x1a0>
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax)
cmpb   $0x20,0x2(%rbx)
lea    0x1(%rbx),%rbx
je     12f0 <pretty_format+0x1c0>
jmp    139a <pretty_format+0x26a>
nop
mov    %rbp,%rdi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <safe_known_str@plt>
test   %r12d,%r12d
jle    1338 <pretty_format+0x208>
mov    %r12d,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
add    $0xffffffff,%ebp
jne    1320 <pretty_format+0x1f0>
movsbl (%rbx),%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1040 <safe_copy_chr@plt>
lea    0xcae(%rip),%rdi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <safe_known_str@plt>
test   %r12d,%r12d
js     1388 <pretty_format+0x258>
lea    0x1(%r12),%ebp
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1050 <safe_copy_str@plt>
add    $0xffffffff,%ebp
jne    1370 <pretty_format+0x240>
add    $0x1,%r12d
add    $0xffffffffffffffff,%rbx
cmpb   $0x20,0x2(%rbx)
lea    0x1(%rbx),%rbx
je     1390 <pretty_format+0x260>
lea    0xc5f(%rip),%rbp
jmp    1190 <pretty_format+0x60>
movsbl (%rbx),%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1fff,%ecx
call   1040 <safe_copy_chr@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <safe_known_str@plt>
add    $0xffffffffffffffff,%rbx
cmpb   $0x20,0x2(%rbx)
lea    0x1(%rbx),%rbx
je     13d0 <pretty_format+0x2a0>
mov    (%rsp),%r12
lea    0xc1b(%rip),%rbp
jmp    1190 <pretty_format+0x60>
mov    (%r14),%rax
cmpb   $0xa,-0x1(%rax)
jne    1402 <pretty_format+0x2d2>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbf7(%rip),%rdi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <safe_known_str@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
@.str.1 = [3 x i8] c" \00"
define void @pretty_format(i8* %0, i8** %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%9 = load i8*, i8** %4
%10 = load i8**, i8*** %5
%11 = call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %9, i8** %10)
br label %12
12: ; preds = %175, %3
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %178
16: ; preds = %12
%17 = load i8*, i8** %6
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
switch i32 %19, label %169 [
i32 92, label %20
i32 123, label %38
i32 125, label %86
i32 59, label %138
]
20: ; preds = %16
%21 = load i8*, i8** %6
%22 = load i8, i8* %21
%23 = load i8*, i8** %4
%24 = load i8**, i8*** %5
%25 = call i32 @safe_copy_chr(i8 signext %22, i8* %23, i8** %24, i32 8191)
%26 = load i8*, i8** %6
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %6
%28 = load i8*, i8** %6
%29 = load i8, i8* %28
%30 = load i8*, i8** %4
%31 = load i8**, i8*** %5
%32 = call i32 @safe_copy_chr(i8 signext %29, i8* %30, i8** %31, i32 8191)
%33 = load i8*, i8** %6
%34 = load i8, i8* %33
%35 = icmp ne i8 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %20
br label %189
37: ; preds = %20
br label %175
38: ; preds = %16
%39 = load i8*, i8** %4
%40 = load i8**, i8*** %5
%41 = call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %39, i8** %40)
store i32 0, i32* %8
br label %42
42: ; preds = %50, %38
%43 = load i32, i32* %8
%44 = load i32, i32* %7
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %53
46: ; preds = %42
%47 = load i8*, i8** %4
%48 = load i8**, i8*** %5
%49 = call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %47, i8** %48, i32 8191)
br label %50
50: ; preds = %46
%51 = load i32, i32* %8
%52 = add nsw i32 %51, 1
store i32 %52, i32* %8
br label %42
53: ; preds = %42
%54 = load i8*, i8** %6
%55 = load i8, i8* %54
%56 = load i8*, i8** %4
%57 = load i8**, i8*** %5
%58 = call i32 @safe_copy_chr(i8 signext %55, i8* %56, i8** %57, i32 8191)
%59 = load i8*, i8** %4
%60 = load i8**, i8*** %5
%61 = call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %59, i8** %60)
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
store i32 0, i32* %8
br label %64
64: ; preds = %72, %53
%65 = load i32, i32* %8
%66 = load i32, i32* %7
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %75
68: ; preds = %64
%69 = load i8*, i8** %4
%70 = load i8**, i8*** %5
%71 = call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %69, i8** %70, i32 8191)
br label %72
72: ; preds = %68
%73 = load i32, i32* %8
%74 = add nsw i32 %73, 1
store i32 %74, i32* %8
br label %64
75: ; preds = %64
br label %76
76: ; preds = %82, %75
%77 = load i8*, i8** %6
%78 = getelementptr inbounds i8, i8* %77, i64 1
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = icmp eq i32 %80, 32
br i1 %81, label %82, label %85
82: ; preds = %76
%83 = load i8*, i8** %6
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %6
br label %76
85: ; preds = %76
br label %175
86: ; preds = %16
%87 = load i32, i32* %7
%88 = icmp sgt i32 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %86
%90 = load i32, i32* %7
%91 = add nsw i32 %90, -1
store i32 %91, i32* %7
br label %92
92: ; preds = %89, %86
%93 = load i8*, i8** %4
%94 = load i8**, i8*** %5
%95 = call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %93, i8** %94)
store i32 0, i32* %8
br label %96
96: ; preds = %104, %92
%97 = load i32, i32* %8
%98 = load i32, i32* %7
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %107
100: ; preds = %96
%101 = load i8*, i8** %4
%102 = load i8**, i8*** %5
%103 = call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %101, i8** %102, i32 8191)
br label %104
104: ; preds = %100
%105 = load i32, i32* %8
%106 = add nsw i32 %105, 1
store i32 %106, i32* %8
br label %96
107: ; preds = %96
%108 = load i8*, i8** %6
%109 = load i8, i8* %108
%110 = load i8*, i8** %4
%111 = load i8**, i8*** %5
%112 = call i32 @safe_copy_chr(i8 signext %109, i8* %110, i8** %111, i32 8191)
%113 = load i8*, i8** %4
%114 = load i8**, i8*** %5
%115 = call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %113, i8** %114)
store i32 0, i32* %8
br label %116
116: ; preds = %124, %107
%117 = load i32, i32* %8
%118 = load i32, i32* %7
%119 = icmp slt i32 %117, %118
br i1 %119, label %120, label %127
120: ; preds = %116
%121 = load i8*, i8** %4
%122 = load i8**, i8*** %5
%123 = call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %121, i8** %122, i32 8191)
br label %124
124: ; preds = %120
%125 = load i32, i32* %8
%126 = add nsw i32 %125, 1
store i32 %126, i32* %8
br label %116
127: ; preds = %116
br label %128
128: ; preds = %134, %127
%129 = load i8*, i8** %6
%130 = getelementptr inbounds i8, i8* %129, i64 1
%131 = load i8, i8* %130
%132 = sext i8 %131 to i32
%133 = icmp eq i32 %132, 32
br i1 %133, label %134, label %137
134: ; preds = %128
%135 = load i8*, i8** %6
%136 = getelementptr inbounds i8, i8* %135, i32 1
store i8* %136, i8** %6
br label %128
137: ; preds = %128
br label %175
138: ; preds = %16
%139 = load i8*, i8** %6
%140 = load i8, i8* %139
%141 = load i8*, i8** %4
%142 = load i8**, i8*** %5
%143 = call i32 @safe_copy_chr(i8 signext %140, i8* %141, i8** %142, i32 8191)
%144 = load i8*, i8** %4
%145 = load i8**, i8*** %5
%146 = call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %144, i8** %145)
store i32 0, i32* %8
br label %147
147: ; preds = %155, %138
%148 = load i32, i32* %8
%149 = load i32, i32* %7
%150 = icmp slt i32 %148, %149
br i1 %150, label %151, label %158
151: ; preds = %147
%152 = load i8*, i8** %4
%153 = load i8**, i8*** %5
%154 = call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %152, i8** %153, i32 8191)
br label %155
155: ; preds = %151
%156 = load i32, i32* %8
%157 = add nsw i32 %156, 1
store i32 %157, i32* %8
br label %147
158: ; preds = %147
br label %159
159: ; preds = %165, %158
%160 = load i8*, i8** %6
%161 = getelementptr inbounds i8, i8* %160, i64 1
%162 = load i8, i8* %161
%163 = sext i8 %162 to i32
%164 = icmp eq i32 %163, 32
br i1 %164, label %165, label %168
165: ; preds = %159
%166 = load i8*, i8** %6
%167 = getelementptr inbounds i8, i8* %166, i32 1
store i8* %167, i8** %6
br label %159
168: ; preds = %159
br label %175
169: ; preds = %16
%170 = load i8*, i8** %6
%171 = load i8, i8* %170
%172 = load i8*, i8** %4
%173 = load i8**, i8*** %5
%174 = call i32 @safe_copy_chr(i8 signext %171, i8* %172, i8** %173, i32 8191)
br label %175
175: ; preds = %169, %168, %137, %85, %37
%176 = load i8*, i8** %6
%177 = getelementptr inbounds i8, i8* %176, i32 1
store i8* %177, i8** %6
br label %12
178: ; preds = %12
%179 = load i8**, i8*** %5
%180 = load i8*, i8** %179
%181 = getelementptr inbounds i8, i8* %180, i64 -1
%182 = load i8, i8* %181
%183 = sext i8 %182 to i32
%184 = icmp ne i32 %183, 10
br i1 %184, label %185, label %189
185: ; preds = %178
%186 = load i8*, i8** %4
%187 = load i8**, i8*** %5
%188 = call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %186, i8** %187)
br label %189
189: ; preds = %36, %185, %178
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
@.str.1 = [3 x i8] c" \00"
define void @pretty_format(i8* %0, i8** %1, i8* nocapture %2) {
%4 = tail call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %0, i8** %1)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %97, label %7
7: ; preds = %3, %91
%8 = phi i8 [ %95, %91 ], [ %5, %3 ]
%9 = phi i32 [ %93, %91 ], [ 0, %3 ]
%10 = phi i8* [ %94, %91 ], [ %2, %3 ]
%11 = sext i8 %8 to i32
switch i32 %11, label %89 [
i32 92, label %12
i32 123, label %19
i32 125, label %44
i32 59, label %74
]
12: ; preds = %7
%13 = tail call i32 @safe_copy_chr(i8 signext %8, i8* %0, i8** %1, i32 8191)
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = tail call i32 @safe_copy_chr(i8 signext %15, i8* %0, i8** %1, i32 8191)
%17 = load i8, i8* %14
%18 = icmp eq i8 %17, 0
br i1 %18, label %104, label %91
19: ; preds = %7
%20 = tail call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %0, i8** %1)
%21 = icmp sgt i32 %9, 0
br i1 %21, label %22, label %27
22: ; preds = %19, %22
%23 = phi i32 [ %25, %22 ], [ 0, %19 ]
%24 = tail call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8** %1, i32 8191)
%25 = add nuw nsw i32 %23, 1
%26 = icmp eq i32 %25, %9
br i1 %26, label %27, label %22
27: ; preds = %22, %19
%28 = load i8, i8* %10
%29 = tail call i32 @safe_copy_chr(i8 signext %28, i8* %0, i8** %1, i32 8191)
%30 = tail call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %0, i8** %1)
%31 = add i32 %9, 1
%32 = icmp slt i32 %9, 0
br i1 %32, label %38, label %33
33: ; preds = %27, %33
%34 = phi i32 [ %36, %33 ], [ 0, %27 ]
%35 = tail call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8** %1, i32 8191)
%36 = add nuw i32 %34, 1
%37 = icmp eq i32 %34, %9
br i1 %37, label %38, label %33
38: ; preds = %33, %27
br label %39
39: ; preds = %38, %39
%40 = phi i8* [ %41, %39 ], [ %10, %38 ]
%41 = getelementptr inbounds i8, i8* %40, i64 1
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 32
br i1 %43, label %39, label %91
44: ; preds = %7
%45 = icmp sgt i32 %9, 0
%46 = sext i1 %45 to i32
%47 = add i32 %9, %46
%48 = tail call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %0, i8** %1)
%49 = icmp sgt i32 %47, 0
br i1 %49, label %50, label %59
50: ; preds = %44, %50
%51 = phi i32 [ %53, %50 ], [ 0, %44 ]
%52 = tail call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8** %1, i32 8191)
%53 = add nuw nsw i32 %51, 1
%54 = icmp eq i32 %53, %47
br i1 %54, label %55, label %50
55: ; preds = %50
%56 = load i8, i8* %10
%57 = tail call i32 @safe_copy_chr(i8 signext %56, i8* %0, i8** %1, i32 8191)
%58 = tail call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %0, i8** %1)
br i1 %49, label %63, label %68
59: ; preds = %44
%60 = load i8, i8* %10
%61 = tail call i32 @safe_copy_chr(i8 signext %60, i8* %0, i8** %1, i32 8191)
%62 = tail call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %0, i8** %1)
br label %68
63: ; preds = %55, %63
%64 = phi i32 [ %66, %63 ], [ 0, %55 ]
%65 = tail call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8** %1, i32 8191)
%66 = add nuw nsw i32 %64, 1
%67 = icmp eq i32 %66, %47
br i1 %67, label %68, label %63
68: ; preds = %63, %59, %55
br label %69
69: ; preds = %68, %69
%70 = phi i8* [ %71, %69 ], [ %10, %68 ]
%71 = getelementptr inbounds i8, i8* %70, i64 1
%72 = load i8, i8* %71
%73 = icmp eq i8 %72, 32
br i1 %73, label %69, label %91
74: ; preds = %7
%75 = tail call i32 @safe_copy_chr(i8 signext %8, i8* %0, i8** %1, i32 8191)
%76 = tail call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %0, i8** %1)
%77 = icmp sgt i32 %9, 0
br i1 %77, label %78, label %83
78: ; preds = %74, %78
%79 = phi i32 [ %81, %78 ], [ 0, %74 ]
%80 = tail call i32 @safe_copy_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8** %1, i32 8191)
%81 = add nuw nsw i32 %79, 1
%82 = icmp eq i32 %81, %9
br i1 %82, label %83, label %78
83: ; preds = %78, %74
br label %84
84: ; preds = %83, %84
%85 = phi i8* [ %86, %84 ], [ %10, %83 ]
%86 = getelementptr inbounds i8, i8* %85, i64 1
%87 = load i8, i8* %86
%88 = icmp eq i8 %87, 32
br i1 %88, label %84, label %91
89: ; preds = %7
%90 = tail call i32 @safe_copy_chr(i8 signext %8, i8* %0, i8** %1, i32 8191)
br label %91
91: ; preds = %84, %69, %39, %12, %89
%92 = phi i8* [ %10, %89 ], [ %14, %12 ], [ %40, %39 ], [ %70, %69 ], [ %85, %84 ]
%93 = phi i32 [ %9, %89 ], [ %9, %12 ], [ %31, %39 ], [ %47, %69 ], [ %9, %84 ]
%94 = getelementptr inbounds i8, i8* %92, i64 1
%95 = load i8, i8* %94
%96 = icmp eq i8 %95, 0
br i1 %96, label %97, label %7
97: ; preds = %91, %3
%98 = load i8*, i8** %1
%99 = getelementptr inbounds i8, i8* %98, i64 -1
%100 = load i8, i8* %99
%101 = icmp eq i8 %100, 10
br i1 %101, label %104, label %102
102: ; preds = %97
%103 = tail call i32 @safe_known_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %0, i8** %1)
br label %104
104: ; preds = %12, %97, %102
ret void
}