#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*/ StringCpy(char *, char *, int);
scalar_t__ StringHeadEqualAdvance(char *, char *, char **);
char *StringSkipWhitespaceNonNewline(char *);
void EmailStripRe(char *s) {
  char *in;
  in = s;
  while (StringHeadEqualAdvance("Re:", in, &in)) {
    in = StringSkipWhitespaceNonNewline(in);
  }
  StringCpy(s, in, 128);
}


x86 assembly (clang, -O0):
<EmailStripRe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
lea    -0x10(%rbp),%rdx
call   1040 <StringHeadEqualAdvance@plt>
cmp    $0x0,%rax
je     1174 <EmailStripRe+0x44>
mov    -0x10(%rbp),%rdi
call   1030 <StringSkipWhitespaceNonNewline@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <EmailStripRe+0x14>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x80,%edx
call   1050 <StringCpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EmailStripRe>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
mov    %rdi,0x8(%rsp)
lea    0xeb8(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    %r14,%rsi
call   1040 <StringHeadEqualAdvance@plt>
test   %rax,%rax
je     1192 <EmailStripRe+0x62>
lea    0xe9f(%rip),%r15
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%rsp),%rdi
call   1030 <StringSkipWhitespaceNonNewline@plt>
mov    %rax,0x8(%rsp)
mov    %r15,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1040 <StringHeadEqualAdvance@plt>
test   %rax,%rax
jne    1170 <EmailStripRe+0x40>
mov    0x8(%rsp),%rsi
mov    %r14,%rdi
mov    $0x80,%edx
call   1050 <StringCpy@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Re:\00"
define void @EmailStripRe(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = call i64 @StringHeadEqualAdvance(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6, i8** %3)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = call i8* @StringSkipWhitespaceNonNewline(i8* %10)
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = call i32 @StringCpy(i8* %13, i8* %14, i32 128)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"Re:\00"
define void @EmailStripRe(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%4 = call i64 @StringHeadEqualAdvance(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0, i8** %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %2
%8 = call i8* @StringSkipWhitespaceNonNewline(i8* %7)
store i8* %8, i8** %2
%9 = call i64 @StringHeadEqualAdvance(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8, i8** %2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %1
%12 = load i8*, i8** %2
%13 = call i32 @StringCpy(i8* %0, i8* %12, i32 128)
ret void
}