#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(unsigned char *);
int Barcode_93_verify(unsigned char *text) {
  int i;
  if (!strlen(text))
    return -1;
  for (i = 0; text[i]; i++) {
    if ((int)text[i] > 127)
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Barcode_93_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_93_verify+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <Barcode_93_verify+0x7e>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1187 <Barcode_93_verify+0x77>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x7f,%eax
jle    1174 <Barcode_93_verify+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <Barcode_93_verify+0x7e>
jmp    1179 <Barcode_93_verify+0x69>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <Barcode_93_verify+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Barcode_93_verify>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
je     1141 <Barcode_93_verify+0x31>
mov    (%rbx),%cl
test   %cl,%cl
je     113f <Barcode_93_verify+0x2f>
add    $0x1,%rbx
xchg   %ax,%ax
test   %cl,%cl
js     1141 <Barcode_93_verify+0x31>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <Barcode_93_verify+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

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