#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 (text[0] == '\0')
    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),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
jne    1148 <Barcode_128c_verify+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    11be <Barcode_128c_verify+0x9e>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116e <Barcode_128c_verify+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    11be <Barcode_128c_verify+0x9e>
jmp    1173 <Barcode_128c_verify+0x53>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11b7 <Barcode_128c_verify+0x97>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    11a1 <Barcode_128c_verify+0x81>
movl   $0xffffffff,-0x4(%rbp)
jmp    11be <Barcode_128c_verify+0x9e>
jmp    11a6 <Barcode_128c_verify+0x86>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1173 <Barcode_128c_verify+0x53>
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    $0xffffffff,%ebp
cmpb   $0x0,(%rdi)
je     1169 <Barcode_128c_verify+0x49>
mov    %rdi,%rbx
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
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
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 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %32
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @strlen(i8* %11)
%13 = srem i32 %12, 2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 -1, i32* %2
br label %32
16: ; preds = %10
br label %17
17: ; preds = %28, %16
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = icmp ne i8 %19, 0
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = load i8*, i8** %3
%23 = load i8, i8* %22
%24 = call i32 @isdigit(i8 zeroext %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %21
store i32 -1, i32* %2
br label %32
27: ; preds = %21
br label %28
28: ; preds = %27
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %3
br label %17
31: ; preds = %17
store i32 0, i32* %2
br label %32
32: ; preds = %31, %26, %15, %9
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @Barcode_128c_verify(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %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
}