#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 */
scalar_t__ isprint(char);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_pos(char *st_line, char *st_cptr) {
  char *s;
  if (st_line == 0)
    return;
  for (s = st_line; *s != '\n'; ++s) {
    if (isprint(*s) || *s == '\t')
      putc(*s, stderr);
    else
      putc('?', stderr);
  }
  putc('\n', stderr);
  for (s = st_line; s < st_cptr; ++s) {
    if (*s == '\t')
      putc('\t', stderr);
    else
      putc(' ', stderr);
  }
  putc('^', stderr);
  putc('\n', stderr);
}


x86 assembly (clang, -O0):
<print_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <print_pos+0x20>
jmp    1263 <print_pos+0x143>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11c3 <print_pos+0xa3>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isprint@plt>
cmp    $0x0,%rax
jne    117e <print_pos+0x5e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    119a <print_pos+0x7a>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    0x2e55(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <putc@plt>
jmp    11ad <print_pos+0x8d>
mov    0x2e3f(%rip),%rax
mov    (%rax),%esi
mov    $0x3f,%edi
call   1030 <putc@plt>
jmp    11b2 <print_pos+0x92>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <print_pos+0x28>
mov    0x2e16(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    123d <print_pos+0x11d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1214 <print_pos+0xf4>
mov    0x2ddd(%rip),%rax
mov    (%rax),%esi
mov    $0x9,%edi
call   1030 <putc@plt>
jmp    1227 <print_pos+0x107>
mov    0x2dc5(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1030 <putc@plt>
jmp    122c <print_pos+0x10c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11de <print_pos+0xbe>
mov    0x2d9c(%rip),%rax
mov    (%rax),%esi
mov    $0x5e,%edi
call   1030 <putc@plt>
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pos>:
test   %rdi,%rdi
je     11f0 <print_pos+0xd0>
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r12
mov    (%rdi),%al
cmp    $0xa,%al
je     1184 <print_pos+0x64>
lea    0x1(%r12),%rbx
mov    $0x9,%r15d
mov    0x2e91(%rip),%rbp
nop
movsbl %al,%edi
call   1040 <isprint@plt>
movzbl -0x1(%rbx),%ecx
cmp    $0x9,%cl
mov    $0x3f,%edx
cmove  %r15d,%edx
test   %rax,%rax
cmovne %ecx,%edx
mov    0x0(%rbp),%esi
movsbl %dl,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0xa,%al
jne    1150 <print_pos+0x30>
mov    0x2e55(%rip),%r15
mov    (%r15),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
cmp    %r14,%r12
jae    11ce <print_pos+0xae>
sub    %r12,%r14
xor    %ebx,%ebx
mov    $0x9,%ebp
nopw   0x0(%rax,%rax,1)
cmpb   $0x9,(%r12,%rbx,1)
mov    (%r15),%esi
mov    $0x20,%edi
cmove  %ebp,%edi
call   1030 <putc@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11b0 <print_pos+0x90>
mov    (%r15),%esi
mov    $0x5e,%edi
call   1030 <putc@plt>
mov    (%r15),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putc@plt>
ret

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

LLVM IR (-O2):
@stderr = global i32 0
define void @print_pos(i8* %0, i8* readnone %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = icmp eq i8* %0, null
br i1 %5, label %44, label %6
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 10
br i1 %8, label %23, label %9
9: ; preds = %6, %9
%10 = phi i8 [ %21, %9 ], [ %7, %6 ]
%11 = phi i8* [ %20, %9 ], [ %0, %6 ]
%12 = tail call i64 @isprint(i8 signext %10)
%13 = icmp eq i64 %12, 0
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 9
%16 = select i1 %15, i8 9, i8 63
%17 = select i1 %13, i8 %16, i8 %14
%18 = load i32, i32* @stderr
%19 = tail call i32 @putc(i8 signext %17, i32 %18)
%20 = getelementptr inbounds i8, i8* %11, i64 1
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 10
br i1 %22, label %23, label %9
23: ; preds = %9, %6
%24 = load i32, i32* @stderr
%25 = tail call i32 @putc(i8 signext 10, i32 %24)
%26 = icmp ult i8* %0, %1
br i1 %26, label %27, label %39
27: ; preds = %23
%28 = sub i64 %4, %3
%29 = getelementptr i8, i8* %0, i64 %28
br label %30
30: ; preds = %27, %30
%31 = phi i8* [ %37, %30 ], [ %0, %27 ]
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 9
%34 = load i32, i32* @stderr
%35 = select i1 %33, i8 9, i8 32
%36 = tail call i32 @putc(i8 signext %35, i32 %34)
%37 = getelementptr inbounds i8, i8* %31, i64 1
%38 = icmp eq i8* %37, %29
br i1 %38, label %39, label %30
39: ; preds = %30, %23
%40 = load i32, i32* @stderr
%41 = tail call i32 @putc(i8 signext 94, i32 %40)
%42 = load i32, i32* @stderr
%43 = tail call i32 @putc(i8 signext 10, i32 %42)
br label %44
44: ; preds = %2, %39
ret void
}