#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*/ strlen(char *);
int Barcode_128b_verify(char *text) {
  if (!strlen(text))
    return -1;
  while (*text && *text >= 32 && !(*text & 0x80))
    text++;
  if (*text)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<Barcode_128b_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jne    113a <Barcode_128b_verify+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c1 <Barcode_128b_verify+0xb1>
jmp    113f <Barcode_128b_verify+0x2f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1180 <Barcode_128b_verify+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
jl     1180 <Barcode_128b_verify+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1190 <Barcode_128b_verify+0x80>
jmp    11a1 <Barcode_128b_verify+0x91>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113f <Barcode_128b_verify+0x2f>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11ba <Barcode_128b_verify+0xaa>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c1 <Barcode_128b_verify+0xb1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Barcode_128b_verify>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     1131 <Barcode_128b_verify+0x21>
nopl   (%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0x1f,%al
jg     1120 <Barcode_128b_verify+0x10>
neg    %al
sbb    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Barcode_128b_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 %37
8: ; preds = %1
br label %9
9: ; preds = %28, %8
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 32
br i1 %18, label %19, label %26
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = and i32 %22, 128
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
br label %26
26: ; preds = %19, %14, %9
%27 = phi i1 [ false, %14 ], [ false, %9 ], [ %25, %19 ]
br i1 %27, label %28, label %31
28: ; preds = %26
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %3
br label %9
31: ; preds = %26
%32 = load i8*, i8** %3
%33 = load i8, i8* %32
%34 = icmp ne i8 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %31
store i32 -1, i32* %2
br label %37
36: ; preds = %31
store i32 0, i32* %2
br label %37
37: ; preds = %36, %35, %7
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @Barcode_128b_verify(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %0, %1 ]
%6 = load i8, i8* %5
%7 = icmp sgt i8 %6, 31
%8 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %7, label %4, label %9
9: ; preds = %4
%10 = icmp ne i8 %6, 0
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %9, %1
%13 = phi i32 [ -1, %1 ], [ %11, %9 ]
ret i32 %13
}