#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 */
char *index(char *, char);
char *firstwhite(char *s) {
  char *s1, *s2;
  s1 = index(s, ' ');
  s2 = index(s, '\t');
  if (s1) {
    if (s2)
      return (s1 < s2) ? s1 : s2;
    else
      return s1;
  } else
    return s2;
}


x86 assembly (clang, -O0):
<firstwhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <index@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1030 <index@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1193 <firstwhite+0x83>
cmpq   $0x0,-0x20(%rbp)
je     1186 <firstwhite+0x76>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1171 <firstwhite+0x61>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1179 <firstwhite+0x69>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    119b <firstwhite+0x8b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    119b <firstwhite+0x8b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstwhite>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x20,%esi
call   1030 <index@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <index@plt>
test   %r14,%r14
je     1147 <firstwhite+0x37>
test   %rax,%rax
je     1144 <firstwhite+0x34>
cmp    %rax,%r14
cmovb  %r14,%rax
jmp    1147 <firstwhite+0x37>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @firstwhite(i8* %0) {
%2 = tail call i8* @index(i8* %0, i8 signext 32)
%3 = tail call i8* @index(i8* %0, i8 signext 9)
%4 = icmp eq i8* %2, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = icmp eq i8* %3, null
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i8* %2, %3
%9 = select i1 %8, i8* %2, i8* %3
br label %10
10: ; preds = %1, %5, %7
%11 = phi i8* [ %9, %7 ], [ %2, %5 ], [ %3, %1 ]
ret i8* %11
}