#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 */
char *str_replace(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ *strstr(char *, char *);
char *pronoun_gender(char *gender, char *name, char *str) {
  char *dest;
  dest = str_replace(str, " ", " ");
  if (strstr(str, "$name$") != NULL)
    dest = str_replace(str, "$name$", name);
  if ((strcmp(gender, "M") == 0) && (strstr(dest, "$shehe$") != NULL))
    strcpy(dest, str_replace(dest, "$shehe$", "he"));
  else if ((strcmp(gender, "F") == 0) && (strstr(dest, "$shehe$") != NULL))
    strcpy(dest, str_replace(dest, "$shehe$", "she"));
  if ((strcmp(gender, "M") == 0) && (strstr(dest, "$SheHe$") != NULL))
    strcpy(dest, str_replace(dest, "$SheHe$", "He"));
  else if ((strcmp(gender, "F") == 0) && (strstr(dest, "$SheHe$") != NULL))
    strcpy(dest, str_replace(dest, "$SheHe$", "She"));
  if ((strcmp(gender, "M") == 0) && (strstr(dest, "$herhim$") != NULL))
    strcpy(dest, str_replace(dest, "$herhim$", "him"));
  else if ((strcmp(gender, "F") == 0) && (strstr(dest, "$herhim$") != NULL))
    strcpy(dest, str_replace(dest, "$herhim$", "her"));
  if ((strcmp(gender, "M") == 0) && (strstr(dest, "$herhis$") != NULL))
    strcpy(dest, str_replace(dest, "$herhis$", "his"));
  else if ((strcmp(gender, "F") == 0) && (strstr(dest, "$herhis$") != NULL))
    strcpy(dest, str_replace(dest, "$herhis$", "her"));
  if ((strcmp(gender, "M") == 0) && (strstr(dest, "$HerHis$") != NULL))
    strcpy(dest, str_replace(dest, "$HerHis$", "His"));
  else if ((strcmp(gender, "F") == 0) && (strstr(dest, "$HerHis$") != NULL))
    strcpy(dest, str_replace(dest, "$HerHis$", "Her"));
  return dest;
}


x86 assembly (clang, -O0):
<pronoun_gender>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xea1(%rip),%rdx
mov    %rdx,%rsi
call   1050 <str_replace@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     119d <pronoun_gender+0x5d>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe6e(%rip),%rsi
call   1050 <str_replace@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1201 <pronoun_gender+0xc1>
mov    -0x20(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1201 <pronoun_gender+0xc1>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe27(%rip),%rsi
lea    0xe3a(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    1265 <pronoun_gender+0x125>
mov    -0x8(%rbp),%rdi
lea    0xe07(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1260 <pronoun_gender+0x120>
mov    -0x20(%rbp),%rdi
lea    0xde5(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1260 <pronoun_gender+0x120>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xdc3(%rip),%rsi
lea    0xdc6(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    1265 <pronoun_gender+0x125>
mov    -0x8(%rbp),%rdi
lea    0xd99(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12c9 <pronoun_gender+0x189>
mov    -0x20(%rbp),%rdi
lea    0xd8f(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     12c9 <pronoun_gender+0x189>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xd6d(%rip),%rsi
lea    0xd6e(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x38(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    132d <pronoun_gender+0x1ed>
mov    -0x8(%rbp),%rdi
lea    0xd3f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1328 <pronoun_gender+0x1e8>
mov    -0x20(%rbp),%rdi
lea    0xd2b(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1328 <pronoun_gender+0x1e8>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xd09(%rip),%rsi
lea    0xd0d(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x40(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    132d <pronoun_gender+0x1ed>
mov    -0x8(%rbp),%rdi
lea    0xcd1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1391 <pronoun_gender+0x251>
mov    -0x20(%rbp),%rdi
lea    0xcd6(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1391 <pronoun_gender+0x251>
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xcb4(%rip),%rsi
lea    0xcb6(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x48(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    13f5 <pronoun_gender+0x2b5>
mov    -0x8(%rbp),%rdi
lea    0xc77(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13f0 <pronoun_gender+0x2b0>
mov    -0x20(%rbp),%rdi
lea    0xc72(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     13f0 <pronoun_gender+0x2b0>
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc50(%rip),%rsi
lea    0xc56(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x50(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    13f5 <pronoun_gender+0x2b5>
mov    -0x8(%rbp),%rdi
lea    0xc09(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1459 <pronoun_gender+0x319>
mov    -0x20(%rbp),%rdi
lea    0xc1f(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1459 <pronoun_gender+0x319>
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xbfd(%rip),%rsi
lea    0xbff(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x58(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    14bd <pronoun_gender+0x37d>
mov    -0x8(%rbp),%rdi
lea    0xbaf(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    14b8 <pronoun_gender+0x378>
mov    -0x20(%rbp),%rdi
lea    0xbbb(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     14b8 <pronoun_gender+0x378>
mov    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xb99(%rip),%rsi
lea    0xb8e(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x60(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    14bd <pronoun_gender+0x37d>
mov    -0x8(%rbp),%rdi
lea    0xb41(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1521 <pronoun_gender+0x3e1>
mov    -0x20(%rbp),%rdi
lea    0xb64(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1521 <pronoun_gender+0x3e1>
mov    -0x20(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xb42(%rip),%rsi
lea    0xb44(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x68(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    1585 <pronoun_gender+0x445>
mov    -0x8(%rbp),%rdi
lea    0xae7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1580 <pronoun_gender+0x440>
mov    -0x20(%rbp),%rdi
lea    0xb00(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1580 <pronoun_gender+0x440>
mov    -0x20(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xade(%rip),%rsi
lea    0xae4(%rip),%rdx
call   1050 <str_replace@plt>
mov    -0x70(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    1585 <pronoun_gender+0x445>
mov    -0x20(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pronoun_gender>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r12
mov    %rdi,%r15
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1050 <str_replace@plt>
mov    %rax,%r14
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     118f <pronoun_gender+0x4f>
lea    0xe81(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
call   1050 <str_replace@plt>
mov    %rax,%r14
lea    0xe73(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11d4 <pronoun_gender+0x94>
lea    0xe69(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1209 <pronoun_gender+0xc9>
lea    0xe4d(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1209 <pronoun_gender+0xc9>
lea    0xe43(%rip),%rdx
jmp    11ef <pronoun_gender+0xaf>
lea    0xe30(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     11a3 <pronoun_gender+0x63>
lea    0xe36(%rip),%rdx
lea    0xe15(%rip),%rsi
mov    %r14,%rdi
call   1050 <str_replace@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xdf9(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     124e <pronoun_gender+0x10e>
lea    0xdef(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1283 <pronoun_gender+0x143>
lea    0xde1(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1283 <pronoun_gender+0x143>
lea    0xdd8(%rip),%rdx
jmp    1269 <pronoun_gender+0x129>
lea    0xdc4(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     121d <pronoun_gender+0xdd>
lea    0xdb8(%rip),%rdx
lea    0xda9(%rip),%rsi
mov    %r14,%rdi
call   1050 <str_replace@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xd7f(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12c8 <pronoun_gender+0x188>
lea    0xd75(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    12fd <pronoun_gender+0x1bd>
lea    0xd76(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     12fd <pronoun_gender+0x1bd>
lea    0xd6f(%rip),%rdx
jmp    12e3 <pronoun_gender+0x1a3>
lea    0xd59(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1297 <pronoun_gender+0x157>
lea    0xd4e(%rip),%rdx
lea    0xd3e(%rip),%rsi
mov    %r14,%rdi
call   1050 <str_replace@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xd05(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1342 <pronoun_gender+0x202>
lea    0xcfb(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1377 <pronoun_gender+0x237>
lea    0xd0d(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1377 <pronoun_gender+0x237>
lea    0xcf5(%rip),%rdx
jmp    135d <pronoun_gender+0x21d>
lea    0xcf0(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1311 <pronoun_gender+0x1d1>
lea    0xce5(%rip),%rdx
lea    0xcd5(%rip),%rsi
mov    %r14,%rdi
call   1050 <str_replace@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xc8b(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     13bc <pronoun_gender+0x27c>
lea    0xc81(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    13f1 <pronoun_gender+0x2b1>
lea    0xca0(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     13f1 <pronoun_gender+0x2b1>
lea    0xc99(%rip),%rdx
jmp    13d7 <pronoun_gender+0x297>
lea    0xc83(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     138b <pronoun_gender+0x24b>
lea    0xc78(%rip),%rdx
lea    0xc68(%rip),%rsi
mov    %r14,%rdi
call   1050 <str_replace@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [7 x i8] c"$name$\00"
@.str.2 = [2 x i8] c"M\00"
@.str.3 = [8 x i8] c"$shehe$\00"
@.str.4 = [3 x i8] c"he\00"
@.str.5 = [2 x i8] c"F\00"
@.str.6 = [4 x i8] c"she\00"
@.str.7 = [8 x i8] c"$SheHe$\00"
@.str.8 = [3 x i8] c"He\00"
@.str.9 = [4 x i8] c"She\00"
@.str.10 = [9 x i8] c"$herhim$\00"
@.str.11 = [4 x i8] c"him\00"
@.str.12 = [4 x i8] c"her\00"
@.str.13 = [9 x i8] c"$herhis$\00"
@.str.14 = [4 x i8] c"his\00"
@.str.15 = [9 x i8] c"$HerHis$\00"
@.str.16 = [4 x i8] c"His\00"
@.str.17 = [4 x i8] c"Her\00"
define i8* @pronoun_gender(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i8* @str_replace(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %7
%10 = load i8*, i8** %6
%11 = call i32* @strstr(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = call i8* @str_replace(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i8* %16, i8** %7
br label %17
17: ; preds = %13, %3
%18 = load i8*, i8** %4
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i8*, i8** %7
%23 = call i32* @strstr(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i32* %23, null
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8*, i8** %7
%27 = load i8*, i8** %7
%28 = call i8* @str_replace(i8* %27, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 @strcpy(i8* %26, i8* %28)
br label %44
30: ; preds = %21, %17
%31 = load i8*, i8** %4
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %43
34: ; preds = %30
%35 = load i8*, i8** %7
%36 = call i32* @strstr(i8* %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%37 = icmp ne i32* %36, null
br i1 %37, label %38, label %43
38: ; preds = %34
%39 = load i8*, i8** %7
%40 = load i8*, i8** %7
%41 = call i8* @str_replace(i8* %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%42 = call i32 @strcpy(i8* %39, i8* %41)
br label %43
43: ; preds = %38, %34, %30
br label %44
44: ; preds = %43, %25
%45 = load i8*, i8** %4
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %57
48: ; preds = %44
%49 = load i8*, i8** %7
%50 = call i32* @strstr(i8* %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%51 = icmp ne i32* %50, null
br i1 %51, label %52, label %57
52: ; preds = %48
%53 = load i8*, i8** %7
%54 = load i8*, i8** %7
%55 = call i8* @str_replace(i8* %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%56 = call i32 @strcpy(i8* %53, i8* %55)
br label %71
57: ; preds = %48, %44
%58 = load i8*, i8** %4
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %70
61: ; preds = %57
%62 = load i8*, i8** %7
%63 = call i32* @strstr(i8* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%64 = icmp ne i32* %63, null
br i1 %64, label %65, label %70
65: ; preds = %61
%66 = load i8*, i8** %7
%67 = load i8*, i8** %7
%68 = call i8* @str_replace(i8* %67, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%69 = call i32 @strcpy(i8* %66, i8* %68)
br label %70
70: ; preds = %65, %61, %57
br label %71
71: ; preds = %70, %52
%72 = load i8*, i8** %4
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %84
75: ; preds = %71
%76 = load i8*, i8** %7
%77 = call i32* @strstr(i8* %76, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%78 = icmp ne i32* %77, null
br i1 %78, label %79, label %84
79: ; preds = %75
%80 = load i8*, i8** %7
%81 = load i8*, i8** %7
%82 = call i8* @str_replace(i8* %81, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%83 = call i32 @strcpy(i8* %80, i8* %82)
br label %98
84: ; preds = %75, %71
%85 = load i8*, i8** %4
%86 = call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %97
88: ; preds = %84
%89 = load i8*, i8** %7
%90 = call i32* @strstr(i8* %89, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%91 = icmp ne i32* %90, null
br i1 %91, label %92, label %97
92: ; preds = %88
%93 = load i8*, i8** %7
%94 = load i8*, i8** %7
%95 = call i8* @str_replace(i8* %94, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%96 = call i32 @strcpy(i8* %93, i8* %95)
br label %97
97: ; preds = %92, %88, %84
br label %98
98: ; preds = %97, %79
%99 = load i8*, i8** %4
%100 = call i64 @strcmp(i8* %99, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %102, label %111
102: ; preds = %98
%103 = load i8*, i8** %7
%104 = call i32* @strstr(i8* %103, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%105 = icmp ne i32* %104, null
br i1 %105, label %106, label %111
106: ; preds = %102
%107 = load i8*, i8** %7
%108 = load i8*, i8** %7
%109 = call i8* @str_replace(i8* %108, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%110 = call i32 @strcpy(i8* %107, i8* %109)
br label %125
111: ; preds = %102, %98
%112 = load i8*, i8** %4
%113 = call i64 @strcmp(i8* %112, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%114 = icmp eq i64 %113, 0
br i1 %114, label %115, label %124
115: ; preds = %111
%116 = load i8*, i8** %7
%117 = call i32* @strstr(i8* %116, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%118 = icmp ne i32* %117, null
br i1 %118, label %119, label %124
119: ; preds = %115
%120 = load i8*, i8** %7
%121 = load i8*, i8** %7
%122 = call i8* @str_replace(i8* %121, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%123 = call i32 @strcpy(i8* %120, i8* %122)
br label %124
124: ; preds = %119, %115, %111
br label %125
125: ; preds = %124, %106
%126 = load i8*, i8** %4
%127 = call i64 @strcmp(i8* %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%128 = icmp eq i64 %127, 0
br i1 %128, label %129, label %138
129: ; preds = %125
%130 = load i8*, i8** %7
%131 = call i32* @strstr(i8* %130, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%132 = icmp ne i32* %131, null
br i1 %132, label %133, label %138
133: ; preds = %129
%134 = load i8*, i8** %7
%135 = load i8*, i8** %7
%136 = call i8* @str_replace(i8* %135, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%137 = call i32 @strcpy(i8* %134, i8* %136)
br label %152
138: ; preds = %129, %125
%139 = load i8*, i8** %4
%140 = call i64 @strcmp(i8* %139, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%141 = icmp eq i64 %140, 0
br i1 %141, label %142, label %151
142: ; preds = %138
%143 = load i8*, i8** %7
%144 = call i32* @strstr(i8* %143, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%145 = icmp ne i32* %144, null
br i1 %145, label %146, label %151
146: ; preds = %142
%147 = load i8*, i8** %7
%148 = load i8*, i8** %7
%149 = call i8* @str_replace(i8* %148, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%150 = call i32 @strcpy(i8* %147, i8* %149)
br label %151
151: ; preds = %146, %142, %138
br label %152
152: ; preds = %151, %133
%153 = load i8*, i8** %7
ret i8* %153
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [7 x i8] c"$name$\00"
@.str.2 = [2 x i8] c"M\00"
@.str.3 = [8 x i8] c"$shehe$\00"
@.str.4 = [3 x i8] c"he\00"
@.str.5 = [2 x i8] c"F\00"
@.str.6 = [4 x i8] c"she\00"
@.str.7 = [8 x i8] c"$SheHe$\00"
@.str.8 = [3 x i8] c"He\00"
@.str.9 = [4 x i8] c"She\00"
@.str.10 = [9 x i8] c"$herhim$\00"
@.str.11 = [4 x i8] c"him\00"
@.str.12 = [4 x i8] c"her\00"
@.str.13 = [9 x i8] c"$herhis$\00"
@.str.14 = [4 x i8] c"his\00"
@.str.15 = [9 x i8] c"$HerHis$\00"
@.str.16 = [4 x i8] c"His\00"
@.str.17 = [4 x i8] c"Her\00"
define i8* @pronoun_gender(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @str_replace(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32* @strstr(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i8* @str_replace(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %9
9: ; preds = %7, %3
%10 = phi i8* [ %8, %7 ], [ %4, %3 ]
%11 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %22
16: ; preds = %13, %9
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %16
%20 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %26, label %22
22: ; preds = %19, %13
%23 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %13 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), %19 ]
%24 = tail call i8* @str_replace(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %23)
%25 = tail call i32 @strcpy(i8* %10, i8* %24)
br label %26
26: ; preds = %22, %16, %19
%27 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %38
32: ; preds = %29, %26
%33 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %42
35: ; preds = %32
%36 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%37 = icmp eq i32* %36, null
br i1 %37, label %42, label %38
38: ; preds = %35, %29
%39 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %29 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %35 ]
%40 = tail call i8* @str_replace(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %39)
%41 = tail call i32 @strcpy(i8* %10, i8* %40)
br label %42
42: ; preds = %38, %32, %35
%43 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %54
48: ; preds = %45, %42
%49 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %58
51: ; preds = %48
%52 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%53 = icmp eq i32* %52, null
br i1 %53, label %58, label %54
54: ; preds = %51, %45
%55 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), %45 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), %51 ]
%56 = tail call i8* @str_replace(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* %55)
%57 = tail call i32 @strcpy(i8* %10, i8* %56)
br label %58
58: ; preds = %54, %48, %51
%59 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%63 = icmp eq i32* %62, null
br i1 %63, label %64, label %70
64: ; preds = %61, %58
%65 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %74
67: ; preds = %64
%68 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%69 = icmp eq i32* %68, null
br i1 %69, label %74, label %70
70: ; preds = %67, %61
%71 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), %61 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), %67 ]
%72 = tail call i8* @str_replace(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* %71)
%73 = tail call i32 @strcpy(i8* %10, i8* %72)
br label %74
74: ; preds = %70, %64, %67
%75 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%79 = icmp eq i32* %78, null
br i1 %79, label %80, label %86
80: ; preds = %77, %74
%81 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %90
83: ; preds = %80
%84 = tail call i32* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%85 = icmp eq i32* %84, null
br i1 %85, label %90, label %86
86: ; preds = %83, %77
%87 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), %77 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), %83 ]
%88 = tail call i8* @str_replace(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* %87)
%89 = tail call i32 @strcpy(i8* %10, i8* %88)
br label %90
90: ; preds = %86, %80, %83
ret i8* %10
}