#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__ iswhite(char);
int strcmp(char *, char *);
int strlen(char *);
int nowhite_strcmp(char *s, char *t) {
  char *p;
  while (iswhite(*s))
    s++;
  while (iswhite(*t))
    t++;
  if ((*s == 0) || (*t == 0))
    return strcmp(s, t);
  p = s + strlen(s) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  p = t + strlen(t) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  return strcmp(s, t);
}


x86 assembly (clang, -O0):
<nowhite_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1050 <iswhite@plt>
cmp    $0x0,%rax
je     1167 <nowhite_strcmp+0x37>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1140 <nowhite_strcmp+0x10>
jmp    116c <nowhite_strcmp+0x3c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1050 <iswhite@plt>
cmp    $0x0,%rax
je     1193 <nowhite_strcmp+0x63>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116c <nowhite_strcmp+0x3c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11b3 <nowhite_strcmp+0x83>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11c8 <nowhite_strcmp+0x98>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    127c <nowhite_strcmp+0x14c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1050 <iswhite@plt>
cmp    $0x0,%rax
je     121a <nowhite_strcmp+0xea>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
jmp    11ed <nowhite_strcmp+0xbd>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1050 <iswhite@plt>
cmp    $0x0,%rax
je     126c <nowhite_strcmp+0x13c>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
jmp    123f <nowhite_strcmp+0x10f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nowhite_strcmp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nop
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1050 <iswhite@plt>
test   %rax,%rax
jne    1140 <nowhite_strcmp+0x10>
add    $0xffffffffffffffff,%r14
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14),%edi
add    $0x1,%r14
call   1050 <iswhite@plt>
test   %rax,%rax
jne    1160 <nowhite_strcmp+0x30>
cmpb   $0x0,(%rbx)
je     11fa <nowhite_strcmp+0xca>
cmpb   $0x0,(%r14)
je     11fa <nowhite_strcmp+0xca>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movslq %eax,%r15
movsbl -0x1(%rbx,%r15,1),%edi
call   1050 <iswhite@plt>
test   %rax,%rax
je     11ba <nowhite_strcmp+0x8a>
nopl   (%rax)
movb   $0x0,-0x1(%rbx,%r15,1)
movsbl -0x2(%rbx,%r15,1),%edi
call   1050 <iswhite@plt>
add    $0xffffffffffffffff,%r15
test   %rax,%rax
jne    11a0 <nowhite_strcmp+0x70>
mov    %r14,%rdi
call   1030 <strlen@plt>
movslq %eax,%r15
movsbl -0x1(%r14,%r15,1),%edi
call   1050 <iswhite@plt>
test   %rax,%rax
je     11fa <nowhite_strcmp+0xca>
cs nopw 0x0(%rax,%rax,1)
nop
movb   $0x0,-0x1(%r14,%r15,1)
movsbl -0x2(%r14,%r15,1),%edi
call   1050 <iswhite@plt>
add    $0xffffffffffffffff,%r15
test   %rax,%rax
jne    11e0 <nowhite_strcmp+0xb0>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
define i32 @nowhite_strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %7
7: ; preds = %12, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = call i64 @iswhite(i8 signext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
br label %7
15: ; preds = %7
br label %16
16: ; preds = %21, %15
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = call i64 @iswhite(i8 signext %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
br label %16
24: ; preds = %16
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %34, label %29
29: ; preds = %24
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %29, %24
%35 = load i8*, i8** %4
%36 = load i8*, i8** %5
%37 = call i32 @strcmp(i8* %35, i8* %36)
store i32 %37, i32* %3
br label %72
38: ; preds = %29
%39 = load i8*, i8** %4
%40 = load i8*, i8** %4
%41 = call i32 @strlen(i8* %40)
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %39, i64 %42
%44 = getelementptr inbounds i8, i8* %43, i64 -1
store i8* %44, i8** %6
br label %45
45: ; preds = %50, %38
%46 = load i8*, i8** %6
%47 = load i8, i8* %46
%48 = call i64 @iswhite(i8 signext %47)
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %45
%51 = load i8*, i8** %6
%52 = getelementptr inbounds i8, i8* %51, i32 -1
store i8* %52, i8** %6
store i8 0, i8* %51
br label %45
53: ; preds = %45
%54 = load i8*, i8** %5
%55 = load i8*, i8** %5
%56 = call i32 @strlen(i8* %55)
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %54, i64 %57
%59 = getelementptr inbounds i8, i8* %58, i64 -1
store i8* %59, i8** %6
br label %60
60: ; preds = %65, %53
%61 = load i8*, i8** %6
%62 = load i8, i8* %61
%63 = call i64 @iswhite(i8 signext %62)
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %60
%66 = load i8*, i8** %6
%67 = getelementptr inbounds i8, i8* %66, i32 -1
store i8* %67, i8** %6
store i8 0, i8* %66
br label %60
68: ; preds = %60
%69 = load i8*, i8** %4
%70 = load i8*, i8** %5
%71 = call i32 @strcmp(i8* %69, i8* %70)
store i32 %71, i32* %3
br label %72
72: ; preds = %68, %34
%73 = load i32, i32* %3
ret i32 %73
}

LLVM IR (-O2):
define i32 @nowhite_strcmp(i8* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = tail call i64 @iswhite(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3, %9
%10 = phi i8* [ %14, %9 ], [ %1, %3 ]
%11 = load i8, i8* %10
%12 = tail call i64 @iswhite(i8 signext %11)
%13 = icmp eq i64 %12, 0
%14 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %13, label %15, label %9
15: ; preds = %9
%16 = load i8, i8* %4
%17 = icmp eq i8 %16, 0
br i1 %17, label %49, label %18
18: ; preds = %15
%19 = load i8, i8* %10
%20 = icmp eq i8 %19, 0
br i1 %20, label %49, label %21
21: ; preds = %18
%22 = tail call i32 @strlen(i8* %4)
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %4, i64 %23
%25 = getelementptr inbounds i8, i8* %24, i64 -1
%26 = load i8, i8* %25
%27 = tail call i64 @iswhite(i8 signext %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %35, label %29
29: ; preds = %21, %29
%30 = phi i8* [ %31, %29 ], [ %25, %21 ]
store i8 0, i8* %30
%31 = getelementptr inbounds i8, i8* %30, i64 -1
%32 = load i8, i8* %31
%33 = tail call i64 @iswhite(i8 signext %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %29
35: ; preds = %29, %21
%36 = tail call i32 @strlen(i8* %10)
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %10, i64 %37
%39 = getelementptr inbounds i8, i8* %38, i64 -1
%40 = load i8, i8* %39
%41 = tail call i64 @iswhite(i8 signext %40)
%42 = icmp eq i64 %41, 0
br i1 %42, label %49, label %43
43: ; preds = %35, %43
%44 = phi i8* [ %45, %43 ], [ %39, %35 ]
store i8 0, i8* %44
%45 = getelementptr inbounds i8, i8* %44, i64 -1
%46 = load i8, i8* %45
%47 = tail call i64 @iswhite(i8 signext %46)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %43
49: ; preds = %43, %35, %15, %18
%50 = tail call i32 @strcmp(i8* %4, i8* %10)
ret i32 %50
}