#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*/ isdigit(unsigned char);
int strlen(unsigned char *);
int Barcode_128c_verify(unsigned char *text) {
  if (!strlen(text))
    return -1;
  if (strlen(text) % 2)
    return -1;
  for (; *text; text++)
    if (!isdigit(*text))
      return -1;
  return 0;
}


x86 assembly (clang, -O0):
<Barcode_128c_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%eax
jne    114a <Barcode_128c_verify+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <Barcode_128c_verify+0xa0>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1170 <Barcode_128c_verify+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <Barcode_128c_verify+0xa0>
jmp    1175 <Barcode_128c_verify+0x55>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11b9 <Barcode_128c_verify+0x99>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    11a3 <Barcode_128c_verify+0x83>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <Barcode_128c_verify+0xa0>
jmp    11a8 <Barcode_128c_verify+0x88>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1175 <Barcode_128c_verify+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Barcode_128c_verify>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0xffffffff,%ebp
test   %eax,%eax
je     1169 <Barcode_128c_verify+0x49>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   $0x1,%al
jne    1169 <Barcode_128c_verify+0x49>
mov    (%rbx),%al
test   %al,%al
je     1167 <Barcode_128c_verify+0x47>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1169 <Barcode_128c_verify+0x49>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <Barcode_128c_verify+0x30>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Barcode_128c_verify(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = load i8, i8* %0
%10 = icmp eq i8 %9, 0
br i1 %10, label %20, label %14
11: ; preds = %14
%12 = load i8, i8* %19
%13 = icmp eq i8 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %8, %11
%15 = phi i8 [ %12, %11 ], [ %9, %8 ]
%16 = phi i8* [ %19, %11 ], [ %0, %8 ]
%17 = tail call i32 @isdigit(i8 zeroext %15)
%18 = icmp eq i32 %17, 0
%19 = getelementptr inbounds i8, i8* %16, i64 1
br i1 %18, label %20, label %11
20: ; preds = %14, %11, %8, %4, %1
%21 = phi i32 [ -1, %1 ], [ -1, %4 ], [ 0, %8 ], [ -1, %14 ], [ 0, %11 ]
ret i32 %21
}