#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*/ strcpy(char *, char *);
scalar_t__ tolower(char);
void removeCharacter(char *str, char car, char *strString) {
  int i;
  strcpy(strString, "");
  i = 0;
  while (*str != '\0') {
    if (tolower(*str) != tolower(car)) {
      strString[i++] = *str;
    }
    str++;
  }
  strString[i] = '\0';
}


x86 assembly (clang, -O0):
<removeCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11b2 <removeCharacter+0x92>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    %rax,-0x28(%rbp)
movsbl -0x9(%rbp),%edi
call   1040 <tolower@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     11a1 <removeCharacter+0x81>
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114d <removeCharacter+0x2d>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeCharacter>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec9(%rip),%rsi
mov    %rdx,%rdi
call   1030 <strcpy@plt>
mov    (%rbx),%al
test   %al,%al
je     1194 <removeCharacter+0x74>
add    $0x1,%rbx
xor    %r12d,%r12d
movsbl %bpl,%r15d
jmp    116b <removeCharacter+0x4b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1197 <removeCharacter+0x77>
movsbl %al,%edi
call   1040 <tolower@plt>
mov    %rax,%rbp
mov    %r15d,%edi
call   1040 <tolower@plt>
cmp    %rax,%rbp
je     1160 <removeCharacter+0x40>
movzbl -0x1(%rbx),%eax
movslq %r12d,%rcx
add    $0x1,%r12d
mov    %al,(%r14,%rcx,1)
jmp    1160 <removeCharacter+0x40>
xor    %r12d,%r12d
movslq %r12d,%rax
movb   $0x0,(%r14,%rax,1)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @removeCharacter(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %30, %3
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %33
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = call i64 @tolower(i8 signext %17)
%19 = load i8, i8* %5
%20 = call i64 @tolower(i8 signext %19)
%21 = icmp ne i64 %18, %20
br i1 %21, label %22, label %30
22: ; preds = %15
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = load i8*, i8** %6
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
%28 = sext i32 %26 to i64
%29 = getelementptr inbounds i8, i8* %25, i64 %28
store i8 %24, i8* %29
br label %30
30: ; preds = %22, %15
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %4
br label %10
33: ; preds = %10
%34 = load i8*, i8** %6
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
store i8 0, i8* %37
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @removeCharacter(i8* nocapture %0, i8 signext %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %24, label %7
7: ; preds = %3, %19
%8 = phi i8 [ %22, %19 ], [ %5, %3 ]
%9 = phi i32 [ %20, %19 ], [ 0, %3 ]
%10 = phi i8* [ %21, %19 ], [ %0, %3 ]
%11 = tail call i64 @tolower(i8 signext %8)
%12 = tail call i64 @tolower(i8 signext %1)
%13 = icmp eq i64 %11, %12
br i1 %13, label %19, label %14
14: ; preds = %7
%15 = load i8, i8* %10
%16 = add nsw i32 %9, 1
%17 = sext i32 %9 to i64
%18 = getelementptr inbounds i8, i8* %2, i64 %17
store i8 %15, i8* %18
br label %19
19: ; preds = %14, %7
%20 = phi i32 [ %16, %14 ], [ %9, %7 ]
%21 = getelementptr inbounds i8, i8* %10, i64 1
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %7
24: ; preds = %19, %3
%25 = phi i32 [ 0, %3 ], [ %20, %19 ]
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %2, i64 %26
store i8 0, i8* %27
ret void
}