#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*/ isspace(char);
void strtrim(char *inStr, char *outStr, char *list) {
  char *in = inStr;
  char *out = outStr;
  *outStr = 0;
  while (*in) {
    if (!isspace(*in)) {
      *out = *in;
      out++;
      *out = 0;
    }
    in++;
  }
}


x86 assembly (clang, -O0):
<strtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     118d <strtrim+0x7d>
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    117c <strtrim+0x6c>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113b <strtrim+0x2b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtrim>:
push   %r14
push   %rbx
push   %rax
movb   $0x0,(%rsi)
mov    (%rdi),%al
test   %al,%al
je     1159 <strtrim+0x49>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    113b <strtrim+0x2b>
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1159 <strtrim+0x49>
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1130 <strtrim+0x20>
movzbl -0x1(%rbx),%eax
mov    %al,(%r14)
movb   $0x0,0x1(%r14)
add    $0x1,%r14
jmp    1130 <strtrim+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strtrim(i8* nocapture %0, i8* nocapture writeonly %1, i8* nocapture readnone %2) {
store i8 0, i8* %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %3, %15
%7 = phi i8 [ %18, %15 ], [ %4, %3 ]
%8 = phi i8* [ %16, %15 ], [ %1, %3 ]
%9 = phi i8* [ %17, %15 ], [ %0, %3 ]
%10 = tail call i32 @isspace(i8 signext %7)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %6
%13 = load i8, i8* %9
store i8 %13, i8* %8
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %14
br label %15
15: ; preds = %12, %6
%16 = phi i8* [ %8, %6 ], [ %14, %12 ]
%17 = getelementptr inbounds i8, i8* %9, i64 1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %6
20: ; preds = %15, %3
ret void
}