#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 */
__attribute__((pure)) char *str_skip_char(char *restrict str) {
  if (!str)
    return NULL;
  while (((*str > ' ') && (*str <= '~')) || (*str < 0))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<str_skip_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <str_skip_char+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1183 <str_skip_char+0x83>
jmp    1125 <str_skip_char+0x25>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jle    114a <str_skip_char+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x7e,%ecx
mov    %al,-0x11(%rbp)
jle    115a <str_skip_char+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116a <str_skip_char+0x6a>
jmp    117b <str_skip_char+0x7b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1125 <str_skip_char+0x25>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_skip_char>:
test   %rdi,%rdi
je     1125 <str_skip_char+0x25>
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movzbl 0x1(%rax),%edx
add    $0x1,%rax
lea    -0x21(%rdx),%ecx
test   %dl,%dl
js     1110 <str_skip_char+0x10>
cmp    $0x5e,%cl
jb     1110 <str_skip_char+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @str_skip_char(i8* noalias %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %30
7: ; preds = %1
br label %8
8: ; preds = %25, %7
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sgt i32 %11, 32
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 126
br i1 %17, label %23, label %18
18: ; preds = %13, %8
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp slt i32 %21, 0
br label %23
23: ; preds = %18, %13
%24 = phi i1 [ true, %13 ], [ %22, %18 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %8
28: ; preds = %23
%29 = load i8*, i8** %3
store i8* %29, i8** %2
br label %30
30: ; preds = %28, %6
%31 = load i8*, i8** %2
ret i8* %31
}

LLVM IR (-O2):
define i8* @str_skip_char(i8* noalias %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %10, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = add i8 %5, -33
%7 = icmp ult i8 %6, 94
%8 = icmp slt i8 %5, 0
%9 = or i1 %8, %7
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %3, label %11
11: ; preds = %3, %1
%12 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %12
}