#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char *,
                           unsigned char const *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strchr(char *, int);
void print_verb_latex(const unsigned char *string) {
  unsigned char *verb_delims = (unsigned char *)"!#+|";
  for (; *verb_delims; verb_delims++)
    if (!(strchr((char *)(string), (int)(*verb_delims))))
      break;
  if (*verb_delims) {
    printf("\\verb%c", *verb_delims);
    for (; *string; string++)
      switch (*string) {
      case '\n':
        printf("\\n");
        break;
      default:
        printf("%c", *string);
      }
    printf("%c", *verb_delims);
  } else {
    fprintf(stderr, "I need another \\verb delimiter than (%s) to print %s\n",
            verb_delims, string);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<print_verb_latex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1198 <print_verb_latex+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
jne    1182 <print_verb_latex+0x42>
jmp    1198 <print_verb_latex+0x58>
jmp    1187 <print_verb_latex+0x47>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1157 <print_verb_latex+0x17>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1232 <print_verb_latex+0xf2>
mov    -0x10(%rbp),%rax
movzbl (%rax),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1218 <print_verb_latex+0xd8>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
sub    $0xa,%al
jne    11ed <print_verb_latex+0xad>
jmp    11da <print_verb_latex+0x9a>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1202 <print_verb_latex+0xc2>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1207 <print_verb_latex+0xc7>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11ba <print_verb_latex+0x7a>
mov    -0x10(%rbp),%rax
movzbl (%rax),%esi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1259 <print_verb_latex+0x119>
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xdc6(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_verb_latex>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x21,%esi
call   1040 <strchr@plt>
test   %eax,%eax
je     11a2 <print_verb_latex+0x52>
mov    %rbx,%rdi
mov    $0x23,%esi
call   1040 <strchr@plt>
test   %eax,%eax
je     11ab <print_verb_latex+0x5b>
mov    %rbx,%rdi
mov    $0x2b,%esi
call   1040 <strchr@plt>
test   %eax,%eax
je     11b4 <print_verb_latex+0x64>
mov    %rbx,%rdi
mov    $0x7c,%esi
call   1040 <strchr@plt>
test   %eax,%eax
jne    1214 <print_verb_latex+0xc4>
lea    0xe63(%rip),%r14
jmp    11bb <print_verb_latex+0x6b>
lea    0xe57(%rip),%r14
jmp    11bb <print_verb_latex+0x6b>
lea    0xe4f(%rip),%r14
jmp    11bb <print_verb_latex+0x6b>
lea    0xe47(%rip),%r14
movzbl (%r14),%esi
test   %esi,%esi
je     121b <print_verb_latex+0xcb>
lea    0xe3b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe35(%rip),%r15
jmp    11ee <print_verb_latex+0x9e>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movzbl (%rbx),%edi
cmp    $0xa,%edi
je     11e0 <print_verb_latex+0x90>
test   %dil,%dil
je     1206 <print_verb_latex+0xb6>
call   1030 <putchar@plt>
add    $0x1,%rbx
jmp    11ee <print_verb_latex+0x9e>
movzbl (%r14),%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>
lea    0xde9(%rip),%r14
mov    0x2dbe(%rip),%rax
mov    (%rax),%edi
lea    0xde5(%rip),%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"!#+|\00"
@.str.1 = [8 x i8] c"\\verb%c\00"
@.str.2 = [3 x i8] c"\\n\00"
@.str.3 = [3 x i8] c"%c\00"
@stderr = global i32 0
@.str.4 = [54 x i8] c"I need another \\verb delimiter than (%s) to print %s\0A\00"
define void @print_verb_latex(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = call i32 @strchr(i8* %9, i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %8
br label %20
16: ; preds = %8
br label %17
17: ; preds = %16
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %4
20: ; preds = %15, %4
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 0
br i1 %23, label %24, label %53
24: ; preds = %20
%25 = load i8*, i8** %3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %45, %24
%30 = load i8*, i8** %2
%31 = load i8, i8* %30
%32 = icmp ne i8 %31, 0
br i1 %32, label %33, label %48
33: ; preds = %29
%34 = load i8*, i8** %2
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
switch i32 %36, label %39 [
i32 10, label %37
]
37: ; preds = %33
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %44
39: ; preds = %33
%40 = load i8*, i8** %2
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %39, %37
br label %45
45: ; preds = %44
%46 = load i8*, i8** %2
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %2
br label %29
48: ; preds = %29
%49 = load i8*, i8** %3
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %51)
br label %59
53: ; preds = %20
%54 = load i32, i32* @stderr
%55 = load i8*, i8** %3
%56 = load i8*, i8** %2
%57 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i8* %55, i8* %56)
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %48
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"!#+|\00"
@.str.1 = [8 x i8] c"\\verb%c\00"
@.str.2 = [3 x i8] c"\\n\00"
@stderr = global i32 0
@.str.4 = [54 x i8] c"I need another \\verb delimiter than (%s) to print %s\0A\00"
define void @print_verb_latex(i8* %0) {
%2 = tail call i32 @strchr(i8* %0, i32 33)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = tail call i32 @strchr(i8* %0, i32 35)
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = tail call i32 @strchr(i8* %0, i32 43)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = tail call i32 @strchr(i8* %0, i32 124)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %34
13: ; preds = %10, %7, %4, %1
%14 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 1), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 2), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 3), %10 ]
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %34, label %17
17: ; preds = %13
%18 = zext i8 %15 to i32
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %28, %17
%21 = phi i8* [ %0, %17 ], [ %29, %28 ]
%22 = load i8, i8* %21
switch i8 %22, label %25 [
i8 0, label %30
i8 10, label %23
]
23: ; preds = %20
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %28
25: ; preds = %20
%26 = zext i8 %22 to i32
%27 = tail call i32 @putchar(i32 %26)
br label %28
28: ; preds = %23, %25
%29 = getelementptr inbounds i8, i8* %21, i64 1
br label %20
30: ; preds = %20
%31 = load i8, i8* %14
%32 = zext i8 %31 to i32
%33 = tail call i32 @putchar(i32 %32)
ret void
34: ; preds = %10, %13
%35 = phi i8* [ %14, %13 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 4), %10 ]
%36 = load i32, i32* @stderr
%37 = tail call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i8* %35, i8* %0)
%38 = tail call i32 @exit(i32 1)
unreachable
}