#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*/ die(char *);
int /*<<< orphan*/ is_triple_quote(char **);
void traverse_triple_quote(char **s) {
  (*s) += 3;
  while (!is_triple_quote(s)) {
    if (**s == '\0')
      die("no closing triple quote");
    (*s)++;
  }
  (*s) += 3;
}


x86 assembly (clang, -O0):
<traverse_triple_quote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x3,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <is_triple_quote@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1158 <traverse_triple_quote+0x38>
jmp    118a <traverse_triple_quote+0x6a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1177 <traverse_triple_quote+0x57>
lea    0xe8e(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    113a <traverse_triple_quote+0x1a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x3,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traverse_triple_quote>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
addq   $0x3,(%rdi)
call   1030 <is_triple_quote@plt>
test   %eax,%eax
je     1140 <traverse_triple_quote+0x20>
addq   $0x3,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xeb9(%rip),%r14
jmp    1163 <traverse_triple_quote+0x43>
nopl   0x0(%rax)
add    $0x1,%rax
mov    %rax,(%rbx)
mov    %rbx,%rdi
call   1030 <is_triple_quote@plt>
test   %eax,%eax
jne    1134 <traverse_triple_quote+0x14>
mov    (%rbx),%rax
cmpb   $0x0,(%rax)
jne    1150 <traverse_triple_quote+0x30>
mov    %r14,%rdi
call   1040 <die@plt>
mov    (%rbx),%rax
jmp    1150 <traverse_triple_quote+0x30>

LLVM IR (-O0):
@.str = [24 x i8] c"no closing triple quote\00"
define void @traverse_triple_quote(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 3
store i8* %5, i8** %3
br label %6
6: ; preds = %19, %1
%7 = load i8**, i8*** %2
%8 = call i32 @is_triple_quote(i8** %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %23
11: ; preds = %6
%12 = load i8**, i8*** %2
%13 = load i8*, i8** %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %11
%20 = load i8**, i8*** %2
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %20
br label %6
23: ; preds = %6
%24 = load i8**, i8*** %2
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8* %26, i8** %24
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"no closing triple quote\00"
define void @traverse_triple_quote(i8** %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 3
store i8* %3, i8** %0
%4 = tail call i32 @is_triple_quote(i8** %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %18
6: ; preds = %1, %13
%7 = load i8*, i8** %0
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = tail call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %0
br label %13
13: ; preds = %10, %6
%14 = phi i8* [ %12, %10 ], [ %7, %6 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %0
%16 = tail call i32 @is_triple_quote(i8** %0)
%17 = icmp eq i32 %16, 0
br i1 %17, label %6, label %18
18: ; preds = %13, %1
%19 = load i8*, i8** %0
%20 = getelementptr inbounds i8, i8* %19, i64 3
store i8* %20, i8** %0
ret void
}