#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 *strchr(char const *, char);
int is_single_file(const char *outfile_pattern) {
  const char *p = outfile_pattern;
  do {
    p = strchr(p, '%');
    if (p && p[1] >= '1' && p[1] <= '9')
      return 0;
    if (p)
      p++;
  } while (p);
  return 1;
}


x86 assembly (clang, -O0):
<is_single_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x25,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116f <is_single_file+0x5f>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x31,%eax
jl     116f <is_single_file+0x5f>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x39,%eax
jg     116f <is_single_file+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    119d <is_single_file+0x8d>
cmpq   $0x0,-0x18(%rbp)
je     1186 <is_single_file+0x76>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    118b <is_single_file+0x7b>
cmpq   $0x0,-0x18(%rbp)
jne    1124 <is_single_file+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_single_file>:
push   %rbx
mov    $0x25,%esi
call   1030 <strchr@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1156 <is_single_file+0x46>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x1(%rax),%ecx
add    $0xcf,%cl
cmp    $0x8,%cl
jbe    1154 <is_single_file+0x44>
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x25,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <is_single_file+0x20>
jmp    1156 <is_single_file+0x46>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_single_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
br label %6
6: ; preds = %31, %1
%7 = load i8*, i8** %4
%8 = call i8* @strchr(i8* %7, i8 signext 37)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %24
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 49
br i1 %16, label %17, label %24
17: ; preds = %11
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 57
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 0, i32* %2
br label %35
24: ; preds = %17, %11, %6
%25 = load i8*, i8** %4
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %4
br label %30
30: ; preds = %27, %24
br label %31
31: ; preds = %30
%32 = load i8*, i8** %4
%33 = icmp ne i8* %32, null
br i1 %33, label %6, label %34
34: ; preds = %31
store i32 1, i32* %2
br label %35
35: ; preds = %34, %23
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
define i32 @is_single_file(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 37)
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = tail call i8* @strchr(i8* dereferenceable(1) %9, i8 signext 37)
%6 = icmp eq i8* %5, null
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8* [ %5, %4 ], [ %2, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = add i8 %10, -49
%12 = icmp ult i8 %11, 9
br i1 %12, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}