#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*/ inc_counter(char *);
void handle_status_line(char *arg) {
  char *p;
  for (p = arg; *p && !(*(p) == ' ' || *(p) == '\t'); p++)
    ;
  if (*p) {
    int save = *p;
    *p = 0;
    inc_counter(arg);
    *p = save;
  } else
    inc_counter(arg);
}


x86 assembly (clang, -O0):
<handle_status_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1166 <handle_status_line+0x56>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x16(%rbp)
je     115e <handle_status_line+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
xor    $0xff,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1176 <handle_status_line+0x66>
jmp    118c <handle_status_line+0x7c>
jmp    117b <handle_status_line+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <handle_status_line+0x14>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11c3 <handle_status_line+0xb3>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <inc_counter@plt>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    11cc <handle_status_line+0xbc>
mov    -0x8(%rbp),%rdi
call   1030 <inc_counter@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_status_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
movzbl (%r14),%ebx
test   %bl,%bl
je     114c <handle_status_line+0x3c>
cmp    $0x9,%bl
je     1138 <handle_status_line+0x28>
cmp    $0x20,%bl
je     1138 <handle_status_line+0x28>
add    $0x1,%r14
jmp    1120 <handle_status_line+0x10>
movb   $0x0,(%r14)
call   1030 <inc_counter@plt>
mov    %bl,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <inc_counter@plt>

LLVM IR (-O0):
define void @handle_status_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
br label %6
6: ; preds = %27, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 32
br i1 %15, label %21, label %16
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 9
br label %21
21: ; preds = %16, %11
%22 = phi i1 [ true, %11 ], [ %20, %16 ]
%23 = xor i1 %22, true
br label %24
24: ; preds = %21, %6
%25 = phi i1 [ false, %6 ], [ %23, %21 ]
br i1 %25, label %26, label %30
26: ; preds = %24
br label %27
27: ; preds = %26
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %6
30: ; preds = %24
%31 = load i8*, i8** %3
%32 = load i8, i8* %31
%33 = icmp ne i8 %32, 0
br i1 %33, label %34, label %44
34: ; preds = %30
%35 = load i8*, i8** %3
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
store i32 %37, i32* %4
%38 = load i8*, i8** %3
store i8 0, i8* %38
%39 = load i8*, i8** %2
%40 = call i32 @inc_counter(i8* %39)
%41 = load i32, i32* %4
%42 = trunc i32 %41 to i8
%43 = load i8*, i8** %3
store i8 %42, i8* %43
br label %47
44: ; preds = %30
%45 = load i8*, i8** %2
%46 = call i32 @inc_counter(i8* %45)
br label %47
47: ; preds = %44, %34
ret void
}

LLVM IR (-O2):
define void @handle_status_line(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %9
i8 9, label %7
i8 32, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
store i8 0, i8* %3
%8 = tail call i32 @inc_counter(i8* %0)
store i8 %4, i8* %3
br label %11
9: ; preds = %2
%10 = tail call i32 @inc_counter(i8* %0)
br label %11
11: ; preds = %9, %7
ret void
}