#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 */
scalar_t__ isspace(unsigned char);
void strip_char(const char *s, char *t) {
  unsigned int i = 0;
  unsigned int j = 0;
  while ((t[j] = s[i++]) != '\0')
    if (isspace((unsigned char)t[j]) == 0)
      j++;
}


x86 assembly (clang, -O0):
<strip_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1180 <strip_char+0x70>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movzbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    117b <strip_char+0x6b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112e <strip_char+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_char>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
mov    %al,(%rsi)
test   %al,%al
je     1151 <strip_char+0x41>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
mov    $0x1,%ebp
nopl   0x0(%rax)
movzbl %al,%edi
call   1030 <isspace@plt>
cmp    $0x1,%rax
adc    $0x0,%ebx
mov    %ebp,%eax
movzbl (%r15,%rax,1),%eax
mov    %al,(%r14,%rbx,1)
add    $0x1,%ebp
test   %al,%al
jne    1130 <strip_char+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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