#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*/ putchar(char const);
void print(const char *current, int j) {
  const char *p = current + j;
  int i;
  for (i = 0; i < p - current; i++)
    putchar(' ');
  while (*p != '\0') {
    if (*p == '\\') {
      putchar('\n');
      p++;
      for (i = 0; i < p - current; i++)
        putchar(' ');
    } else {
      putchar(*p);
      p++;
    }
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
cmp    %rcx,%rax
jge    1165 <print+0x55>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1135 <print+0x25>
jmp    116a <print+0x5a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11f9 <print+0xe9>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    11dc <print+0xcc>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
cmp    %rcx,%rax
jge    11d7 <print+0xc7>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a7 <print+0x97>
jmp    11f4 <print+0xe4>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116a <print+0x5a>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
movslq %esi,%rbx
lea    (%rdi,%rbx,1),%r15
test   %ebx,%ebx
jle    1190 <print+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <print+0x20>
jmp    1190 <print+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
jmp    1190 <print+0x80>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
mov    %r15,%rbx
sub    %r14,%rbx
test   %rbx,%rbx
jle    1190 <print+0x80>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1180 <print+0x70>
mov    (%r15),%al
cmp    $0x5c,%al
je     1160 <print+0x50>
test   %al,%al
jne    1150 <print+0x40>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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