#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*/ string_trim_character(char *, int /*<<< orphan*/);
char *string_trim_character_array(char *data, char *character_array) {
  if (!data || !*data || !character_array || !character_array) {
    return data;
  }
  while (*character_array) {
    string_trim_character(data, *character_array++);
  }
  return data;
}


x86 assembly (clang, -O0):
<string_trim_character_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114e <string_trim_character_array+0x3e>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <string_trim_character_array+0x3e>
cmpq   $0x0,-0x18(%rbp)
je     114e <string_trim_character_array+0x3e>
cmpq   $0x0,-0x18(%rbp)
jne    115b <string_trim_character_array+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1195 <string_trim_character_array+0x85>
jmp    1160 <string_trim_character_array+0x50>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     118d <string_trim_character_array+0x7d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%esi
call   1030 <string_trim_character@plt>
jmp    1160 <string_trim_character_array+0x50>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_trim_character_array>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1156 <string_trim_character_array+0x46>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1156 <string_trim_character_array+0x46>
cmpb   $0x0,(%r14)
je     1156 <string_trim_character_array+0x46>
mov    (%rbx),%al
test   %al,%al
je     1156 <string_trim_character_array+0x46>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <string_trim_character@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <string_trim_character_array+0x30>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @string_trim_character_array(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %5
%17 = icmp ne i8* %16, null
br i1 %17, label %20, label %18
18: ; preds = %15, %12, %8, %2
%19 = load i8*, i8** %4
store i8* %19, i8** %3
br label %34
20: ; preds = %15
br label %21
21: ; preds = %25, %20
%22 = load i8*, i8** %5
%23 = load i8, i8* %22
%24 = icmp ne i8 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %21
%26 = load i8*, i8** %4
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %5
%29 = load i8, i8* %27
%30 = sext i8 %29 to i32
%31 = call i32 @string_trim_character(i8* %26, i32 %30)
br label %21
32: ; preds = %21
%33 = load i8*, i8** %4
store i8* %33, i8** %3
br label %34
34: ; preds = %32, %18
%35 = load i8*, i8** %3
ret i8* %35
}

LLVM IR (-O2):
define i8* @string_trim_character_array(i8* returned %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %20, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp ne i8 %5, 0
%7 = icmp ne i8* %1, null
%8 = and i1 %7, %6
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = load i8, i8* %1
%11 = icmp eq i8 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %9, %12
%13 = phi i8 [ %18, %12 ], [ %10, %9 ]
%14 = phi i8* [ %15, %12 ], [ %1, %9 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = sext i8 %13 to i32
%17 = tail call i32 @string_trim_character(i8* %0, i32 %16)
%18 = load i8, i8* %15
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %12
20: ; preds = %12, %9, %2, %4
ret i8* %0
}