#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
scalar_t__ isdigit(char);
void printxdigitstraight(FILE *fh_out, int len, char *linein) {
  static int p, pd;
  pd = 0;
  for (p = 0; p < len; p++) {
    if (isdigit(linein[p])) {
      pd++;
    }
  }
  if (p != pd) {
    fprintf(fh_out, "%s\n", linein);
  }
  return;
}


x86 assembly (clang, -O0):
<printxdigitstraight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,0x2efb(%rip)
movl   $0x0,0x2eed(%rip)
mov    0x2ee7(%rip),%eax
cmp    -0xc(%rbp),%eax
jge    119c <printxdigitstraight+0x7c>
mov    -0x18(%rbp),%rax
movslq 0x2ed3(%rip),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1183 <printxdigitstraight+0x63>
mov    0x2ebe(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eb5(%rip)
jmp    1188 <printxdigitstraight+0x68>
mov    0x2ea6(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e9d(%rip)
jmp    1147 <printxdigitstraight+0x27>
mov    0x2e92(%rip),%eax
cmp    0x2e90(%rip),%eax
je     11c2 <printxdigitstraight+0xa2>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe43(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printxdigitstraight>:
push   %rbp
push   %r14
push   %rbx
movl   $0x0,0x2f0a(%rip)
movl   $0x0,0x2efc(%rip)
test   %esi,%esi
jle    1184 <printxdigitstraight+0x64>
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
jmp    1163 <printxdigitstraight+0x43>
nopl   0x0(%rax,%rax,1)
mov    0x2ede(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed5(%rip)
cmp    %ebp,%eax
jge    117c <printxdigitstraight+0x5c>
cltq
movsbl (%rbx,%rax,1),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1150 <printxdigitstraight+0x30>
addl   $0x1,0x2ebe(%rip)
jmp    1150 <printxdigitstraight+0x30>
cmp    0x2eb6(%rip),%eax
jne    1189 <printxdigitstraight+0x69>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe70(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@printxdigitstraight.p = internal global i32 0
@printxdigitstraight.pd = internal global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @printxdigitstraight(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 0, i32* @printxdigitstraight.pd
store i32 0, i32* @printxdigitstraight.p
br label %7
7: ; preds = %23, %3
%8 = load i32, i32* @printxdigitstraight.p
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = load i8*, i8** %6
%13 = load i32, i32* @printxdigitstraight.p
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i64 @isdigit(i8 signext %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %11
%20 = load i32, i32* @printxdigitstraight.pd
%21 = add nsw i32 %20, 1
store i32 %21, i32* @printxdigitstraight.pd
br label %22
22: ; preds = %19, %11
br label %23
23: ; preds = %22
%24 = load i32, i32* @printxdigitstraight.p
%25 = add nsw i32 %24, 1
store i32 %25, i32* @printxdigitstraight.p
br label %7
26: ; preds = %7
%27 = load i32, i32* @printxdigitstraight.p
%28 = load i32, i32* @printxdigitstraight.pd
%29 = icmp ne i32 %27, %28
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = load i32*, i32** %4
%32 = load i8*, i8** %6
%33 = call i32 @fprintf(i32* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %30, %26
ret void
}

LLVM IR (-O2):
@printxdigitstraight.p = internal unnamed_addr global i32 0
@printxdigitstraight.pd = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @printxdigitstraight(i32* nocapture %0, i32 %1, i8* %2) {
store i32 0, i32* @printxdigitstraight.pd
store i32 0, i32* @printxdigitstraight.p
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %24
5: ; preds = %3, %15
%6 = phi i32 [ %17, %15 ], [ 0, %3 ]
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
%9 = load i8, i8* %8
%10 = tail call i64 @isdigit(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %5
%13 = load i32, i32* @printxdigitstraight.pd
%14 = add nsw i32 %13, 1
store i32 %14, i32* @printxdigitstraight.pd
br label %15
15: ; preds = %5, %12
%16 = load i32, i32* @printxdigitstraight.p
%17 = add nsw i32 %16, 1
store i32 %17, i32* @printxdigitstraight.p
%18 = icmp slt i32 %17, %1
br i1 %18, label %5, label %19
19: ; preds = %15
%20 = load i32, i32* @printxdigitstraight.pd
%21 = icmp eq i32 %17, %20
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %24
24: ; preds = %3, %22, %19
ret void
}