#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__ _sub_digit(char *, size_t, char);
int _sub_digits(char *from, size_t from_len, char *digits) {
  for (char *r = digits; *r; r++) {
    if (0 != _sub_digit(from, from_len, *r)) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<_sub_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     117d <_sub_digits+0x6d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rax
movsbl (%rax),%edx
call   1030 <_sub_digit@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1167 <_sub_digits+0x57>
movl   $0x1,-0x4(%rbp)
jmp    1184 <_sub_digits+0x74>
jmp    116c <_sub_digits+0x5c>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    112c <_sub_digits+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sub_digits>:
push   %r15
push   %r14
push   %rbx
mov    (%rdx),%cl
test   %cl,%cl
je     1158 <_sub_digits+0x48>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %cl,%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <_sub_digit@plt>
test   %rax,%rax
jne    114e <_sub_digits+0x3e>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <_sub_digits+0x20>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
jmp    115a <_sub_digits+0x4a>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @_sub_digits(i8* %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
%9 = load i8*, i8** %7
store i8* %9, i8** %8
br label %10
10: ; preds = %23, %3
%11 = load i8*, i8** %8
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = load i8*, i8** %8
%18 = load i8, i8* %17
%19 = call i64 @_sub_digit(i8* %15, i64 %16, i8 signext %18)
%20 = icmp ne i64 0, %19
br i1 %20, label %21, label %22
21: ; preds = %14
store i32 1, i32* %4
br label %27
22: ; preds = %14
br label %23
23: ; preds = %22
%24 = load i8*, i8** %8
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %8
br label %10
26: ; preds = %10
store i32 0, i32* %4
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @_sub_digits(i8* %0, i64 %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %9
6: ; preds = %9
%7 = load i8, i8* %14
%8 = icmp eq i8 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %3, %6
%10 = phi i8 [ %7, %6 ], [ %4, %3 ]
%11 = phi i8* [ %14, %6 ], [ %2, %3 ]
%12 = tail call i64 @_sub_digit(i8* %0, i64 %1, i8 signext %10)
%13 = icmp eq i64 %12, 0
%14 = getelementptr inbounds i8, i8* %11, i64 1
br i1 %13, label %6, label %15
15: ; preds = %9, %6
%16 = xor i1 %13, true
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %15, %3
%19 = phi i32 [ 0, %3 ], [ %17, %15 ]
ret i32 %19
}