#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 ean_make_checksum(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ strcpy(unsigned char *, ...);
int strlen(unsigned char *);
int /*<<< orphan*/ strncmp(unsigned char *, char *, int);
unsigned char *upc_a_to_e(unsigned char *text) {
  static unsigned char result[16];
  int len, chksum;
  len = strlen(text);
  switch (len) {
  case 12:
    strcpy(result, text);
    result[11] = '\0';
    chksum = ean_make_checksum(result, 0);
    if (text[11] != (chksum - '0'))
      return NULL;
    break;
  case 11:
    chksum = ean_make_checksum(text, 0);
    break;
  default:
    return NULL;
  }
  strcpy(result, "00000000");
  if (text[0] != '0' && text[0] != '1')
    return NULL;
  result[0] = text[0];
  if ((text[3] == '0' || text[3] == '1' || text[3] == '2') &&
      !strncmp(text + 4, "0000", 4)) {
    memcpy(&result[1], text + 1, 2);
    memcpy(&result[3], text + 8, 3);
    result[6] = text[3];
  } else if (!strncmp(text + 4, "00000", 5)) {
    memcpy(&result[1], text + 1, 3);
    memcpy(&result[4], text + 9, 2);
    result[6] = '3';
  } else if (!strncmp(text + 5, "00000", 5)) {
    memcpy(&result[1], text + 1, 4);
    result[5] = text[10];
    result[6] = '4';
  } else if ((text[5] != '0') && !strncmp(text + 6, "0000", 4) &&
             text[10] >= '5' && text[10] <= '9') {
    memcpy(&result[1], text + 1, 5);
    result[6] = text[10];
  } else {
    return NULL;
  }
  result[7] = chksum + '0';
  return result;
}


x86 assembly (clang, -O0):
<upc_a_to_e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0xb,%eax
je     11df <upc_a_to_e+0x8f>
jmp    117c <upc_a_to_e+0x2c>
mov    -0x1c(%rbp),%eax
sub    $0xc,%eax
jne    11f2 <upc_a_to_e+0xa2>
jmp    118d <upc_a_to_e+0x3d>
mov    -0x10(%rbp),%rsi
lea    0x2ec8(%rip),%rdi
xor    %eax,%eax
call   1040 <strcpy@plt>
movb   $0x0,0x2ec5(%rip)
lea    0x2eb3(%rip),%rdi
xor    %esi,%esi
call   1050 <ean_make_checksum@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0xb(%rax),%eax
mov    -0x18(%rbp),%ecx
sub    $0x30,%ecx
cmp    %ecx,%eax
je     11da <upc_a_to_e+0x8a>
movq   $0x0,-0x8(%rbp)
jmp    144d <upc_a_to_e+0x2fd>
jmp    11ff <upc_a_to_e+0xaf>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <ean_make_checksum@plt>
mov    %eax,-0x18(%rbp)
jmp    11ff <upc_a_to_e+0xaf>
movq   $0x0,-0x8(%rbp)
jmp    144d <upc_a_to_e+0x2fd>
lea    0x2e5a(%rip),%rdi
lea    0xdf3(%rip),%rsi
xor    %eax,%eax
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x30,%eax
je     1241 <upc_a_to_e+0xf1>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x31,%eax
je     1241 <upc_a_to_e+0xf1>
movq   $0x0,-0x8(%rbp)
jmp    144d <upc_a_to_e+0x2fd>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2e13(%rip)
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0x30,%eax
je     1280 <upc_a_to_e+0x130>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0x31,%eax
je     1280 <upc_a_to_e+0x130>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0x32,%eax
jne    12e6 <upc_a_to_e+0x196>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
lea    0xd75(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    12e6 <upc_a_to_e+0x196>
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
lea    0x2db0(%rip),%rdi
mov    $0x2,%edx
call   1070 <memcpy@plt>
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
lea    0x2d99(%rip),%rdi
mov    $0x3,%edx
call   1070 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,0x2d85(%rip)
jmp    1436 <upc_a_to_e+0x2e6>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
lea    0xd0e(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1346 <upc_a_to_e+0x1f6>
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
lea    0x2d4a(%rip),%rdi
mov    $0x3,%edx
call   1070 <memcpy@plt>
mov    -0x10(%rbp),%rsi
add    $0x9,%rsi
lea    0x2d34(%rip),%rdi
mov    $0x2,%edx
call   1070 <memcpy@plt>
movb   $0x33,0x2d25(%rip)
jmp    1431 <upc_a_to_e+0x2e1>
mov    -0x10(%rbp),%rdi
add    $0x5,%rdi
lea    0xcae(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    139a <upc_a_to_e+0x24a>
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
lea    0x2cea(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    0xa(%rax),%al
mov    %al,0x2cd7(%rip)
movb   $0x34,0x2cd1(%rip)
jmp    142c <upc_a_to_e+0x2dc>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
cmp    $0x30,%eax
je     141a <upc_a_to_e+0x2ca>
mov    -0x10(%rbp),%rdi
add    $0x6,%rdi
lea    0xc4a(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    141a <upc_a_to_e+0x2ca>
mov    -0x10(%rbp),%rax
movzbl 0xa(%rax),%eax
cmp    $0x35,%eax
jl     141a <upc_a_to_e+0x2ca>
mov    -0x10(%rbp),%rax
movzbl 0xa(%rax),%eax
cmp    $0x39,%eax
jg     141a <upc_a_to_e+0x2ca>
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
lea    0x2c63(%rip),%rdi
mov    $0x5,%edx
call   1070 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    0xa(%rax),%al
mov    %al,0x2c51(%rip)
jmp    1427 <upc_a_to_e+0x2d7>
movq   $0x0,-0x8(%rbp)
jmp    144d <upc_a_to_e+0x2fd>
jmp    142c <upc_a_to_e+0x2dc>
jmp    1431 <upc_a_to_e+0x2e1>
jmp    1436 <upc_a_to_e+0x2e6>
mov    -0x18(%rbp),%eax
add    $0x30,%eax
mov    %al,0x2c25(%rip)
lea    0x2c17(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upc_a_to_e>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <strlen@plt>
cmp    $0xb,%eax
je     11ab <upc_a_to_e+0x5b>
cmp    $0xc,%eax
jne    1286 <upc_a_to_e+0x136>
lea    0x2eec(%rip),%rbp
xor    %r14d,%r14d
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <strcpy@plt>
movb   $0x0,0x2ee0(%rip)
mov    %rbp,%rdi
xor    %esi,%esi
call   1050 <ean_make_checksum@plt>
mov    %eax,%r15d
movzbl 0xb(%rbx),%eax
mov    %r15d,%ecx
add    $0xffffffd0,%ecx
cmp    %eax,%ecx
je     11b8 <upc_a_to_e+0x68>
jmp    131f <upc_a_to_e+0x1cf>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <ean_make_checksum@plt>
mov    %eax,%r15d
lea    0x2ea1(%rip),%r14
lea    0xe3a(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <strcpy@plt>
mov    (%rbx),%al
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x30,%cl
jne    1286 <upc_a_to_e+0x136>
mov    %al,0x2e7a(%rip)
mov    0x3(%rbx),%al
add    $0xd0,%al
cmp    $0x2,%al
ja     120c <upc_a_to_e+0xbc>
lea    0x4(%rbx),%rdi
lea    0xe0a(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12e1 <upc_a_to_e+0x191>
lea    0x4(%rbx),%rdi
lea    0xdec(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     128e <upc_a_to_e+0x13e>
lea    0x5(%rbx),%rbp
lea    0xdd3(%rip),%rsi
mov    %rbp,%rdi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12bf <upc_a_to_e+0x16f>
cmpb   $0x30,0x0(%rbp)
je     1286 <upc_a_to_e+0x136>
lea    0x6(%rbx),%rdi
lea    0xdb2(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1286 <upc_a_to_e+0x136>
mov    0xa(%rbx),%al
add    $0xcb,%al
cmp    $0x4,%al
ja     1286 <upc_a_to_e+0x136>
lea    0x1(%rbx),%rsi
lea    0x2ded(%rip),%rdi
mov    $0x5,%edx
call   1070 <memcpy@plt>
mov    0xa(%rbx),%al
jmp    130e <upc_a_to_e+0x1be>
xor    %r14d,%r14d
jmp    131f <upc_a_to_e+0x1cf>
lea    0x1(%rbx),%rsi
lea    0x2dc8(%rip),%rdi
mov    $0x3,%edx
call   1070 <memcpy@plt>
add    $0x9,%rbx
lea    0x2db6(%rip),%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1070 <memcpy@plt>
mov    $0x33,%al
jmp    130e <upc_a_to_e+0x1be>
lea    0x1(%rbx),%rsi
lea    0x2d97(%rip),%rdi
mov    $0x4,%edx
call   1070 <memcpy@plt>
mov    0xa(%rbx),%al
mov    %al,0x2d88(%rip)
mov    $0x34,%al
jmp    130e <upc_a_to_e+0x1be>
lea    0x1(%rbx),%rsi
lea    0x2d75(%rip),%rdi
mov    $0x2,%edx
call   1070 <memcpy@plt>
lea    0x8(%rbx),%rsi
lea    0x2d62(%rip),%rdi
mov    $0x3,%edx
call   1070 <memcpy@plt>
mov    0x3(%rbx),%al
mov    %al,0x2d52(%rip)
add    $0x30,%r15b
mov    %r15b,0x2d48(%rip)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@upc_a_to_e.result = internal global [16 x i8] zeroinitializer
@.str = [9 x i8] c"00000000\00"
@.str.1 = [5 x i8] c"0000\00"
@.str.2 = [6 x i8] c"00000\00"
define i8* @upc_a_to_e(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
switch i32 %8, label %25 [
i32 12, label %9
i32 11, label %22
]
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 (i8*, ...) @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0), i8* %10)
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 11)
%12 = call i32 @ean_make_checksum(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0), i32 0)
store i32 %12, i32* %5
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 11
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i32, i32* %5
%18 = sub nsw i32 %17, 48
%19 = icmp ne i32 %16, %18
br i1 %19, label %20, label %21
20: ; preds = %9
store i8* null, i8** %2
br label %138
21: ; preds = %9
br label %26
22: ; preds = %1
%23 = load i8*, i8** %3
%24 = call i32 @ean_make_checksum(i8* %23, i32 0)
store i32 %24, i32* %5
br label %26
25: ; preds = %1
store i8* null, i8** %2
br label %138
26: ; preds = %22, %21
%27 = call i32 (i8*, ...) @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = icmp ne i32 %31, 48
br i1 %32, label %33, label %40
33: ; preds = %26
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i64 0
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = icmp ne i32 %37, 49
br i1 %38, label %39, label %40
39: ; preds = %33
store i8* null, i8** %2
br label %138
40: ; preds = %33, %26
%41 = load i8*, i8** %3
%42 = getelementptr inbounds i8, i8* %41, i64 0
%43 = load i8, i8* %42
store i8 %43, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0)
%44 = load i8*, i8** %3
%45 = getelementptr inbounds i8, i8* %44, i64 3
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = icmp eq i32 %47, 48
br i1 %48, label %61, label %49
49: ; preds = %40
%50 = load i8*, i8** %3
%51 = getelementptr inbounds i8, i8* %50, i64 3
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = icmp eq i32 %53, 49
br i1 %54, label %61, label %55
55: ; preds = %49
%56 = load i8*, i8** %3
%57 = getelementptr inbounds i8, i8* %56, i64 3
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = icmp eq i32 %59, 50
br i1 %60, label %61, label %76
61: ; preds = %55, %49, %40
%62 = load i8*, i8** %3
%63 = getelementptr inbounds i8, i8* %62, i64 4
%64 = call i32 @strncmp(i8* %63, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%65 = icmp ne i32 %64, 0
br i1 %65, label %76, label %66
66: ; preds = %61
%67 = load i8*, i8** %3
%68 = getelementptr inbounds i8, i8* %67, i64 1
%69 = call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 1), i8* %68, i32 2)
%70 = load i8*, i8** %3
%71 = getelementptr inbounds i8, i8* %70, i64 8
%72 = call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 3), i8* %71, i32 3)
%73 = load i8*, i8** %3
%74 = getelementptr inbounds i8, i8* %73, i64 3
%75 = load i8, i8* %74
store i8 %75, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 6)
br label %134
76: ; preds = %61, %55
%77 = load i8*, i8** %3
%78 = getelementptr inbounds i8, i8* %77, i64 4
%79 = call i32 @strncmp(i8* %78, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%80 = icmp ne i32 %79, 0
br i1 %80, label %88, label %81
81: ; preds = %76
%82 = load i8*, i8** %3
%83 = getelementptr inbounds i8, i8* %82, i64 1
%84 = call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 1), i8* %83, i32 3)
%85 = load i8*, i8** %3
%86 = getelementptr inbounds i8, i8* %85, i64 9
%87 = call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 4), i8* %86, i32 2)
store i8 51, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 6)
br label %133
88: ; preds = %76
%89 = load i8*, i8** %3
%90 = getelementptr inbounds i8, i8* %89, i64 5
%91 = call i32 @strncmp(i8* %90, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%92 = icmp ne i32 %91, 0
br i1 %92, label %100, label %93
93: ; preds = %88
%94 = load i8*, i8** %3
%95 = getelementptr inbounds i8, i8* %94, i64 1
%96 = call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 1), i8* %95, i32 4)
%97 = load i8*, i8** %3
%98 = getelementptr inbounds i8, i8* %97, i64 10
%99 = load i8, i8* %98
store i8 %99, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 5)
store i8 52, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 6)
br label %132
100: ; preds = %88
%101 = load i8*, i8** %3
%102 = getelementptr inbounds i8, i8* %101, i64 5
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = icmp ne i32 %104, 48
br i1 %105, label %106, label %130
106: ; preds = %100
%107 = load i8*, i8** %3
%108 = getelementptr inbounds i8, i8* %107, i64 6
%109 = call i32 @strncmp(i8* %108, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%110 = icmp ne i32 %109, 0
br i1 %110, label %130, label %111
111: ; preds = %106
%112 = load i8*, i8** %3
%113 = getelementptr inbounds i8, i8* %112, i64 10
%114 = load i8, i8* %113
%115 = zext i8 %114 to i32
%116 = icmp sge i32 %115, 53
br i1 %116, label %117, label %130
117: ; preds = %111
%118 = load i8*, i8** %3
%119 = getelementptr inbounds i8, i8* %118, i64 10
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = icmp sle i32 %121, 57
br i1 %122, label %123, label %130
123: ; preds = %117
%124 = load i8*, i8** %3
%125 = getelementptr inbounds i8, i8* %124, i64 1
%126 = call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 1), i8* %125, i32 5)
%127 = load i8*, i8** %3
%128 = getelementptr inbounds i8, i8* %127, i64 10
%129 = load i8, i8* %128
store i8 %129, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 6)
br label %131
130: ; preds = %117, %111, %106, %100
store i8* null, i8** %2
br label %138
131: ; preds = %123
br label %132
132: ; preds = %131, %93
br label %133
133: ; preds = %132, %81
br label %134
134: ; preds = %133, %66
%135 = load i32, i32* %5
%136 = add nsw i32 %135, 48
%137 = trunc i32 %136 to i8
store i8 %137, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 7)
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0), i8** %2
br label %138
138: ; preds = %134, %130, %39, %25, %20
%139 = load i8*, i8** %2
ret i8* %139
}

LLVM IR (-O2):
@upc_a_to_e.result = internal global [16 x i8] zeroinitializer
@.str = [9 x i8] c"00000000\00"
@.str.1 = [5 x i8] c"0000\00"
@.str.2 = [6 x i8] c"00000\00"
define i8* @upc_a_to_e(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
switch i32 %2, label %72 [
i32 12, label %3
i32 11, label %11
]
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0), i8* %0)
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 11)
%5 = tail call i32 @ean_make_checksum(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0), i32 0)
%6 = getelementptr inbounds i8, i8* %0, i64 11
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = add nsw i32 %5, -48
%10 = icmp eq i32 %9, %8
br i1 %10, label %13, label %72
11: ; preds = %1
%12 = tail call i32 @ean_make_checksum(i8* %0, i32 0)
br label %13
13: ; preds = %3, %11
%14 = phi i32 [ %12, %11 ], [ %5, %3 ]
%15 = tail call i32 (i8*, ...) @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%16 = load i8, i8* %0
%17 = and i8 %16, -2
%18 = icmp eq i8 %17, 48
br i1 %18, label %19, label %72
19: ; preds = %13
store i8 %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0)
%20 = getelementptr inbounds i8, i8* %0, i64 3
%21 = load i8, i8* %20
%22 = add i8 %21, -48
%23 = icmp ult i8 %22, 3
br i1 %23, label %24, label %34
24: ; preds = %19
%25 = getelementptr inbounds i8, i8* %0, i64 4
%26 = tail call i32 @strncmp(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = getelementptr inbounds i8, i8* %0, i64 1
%30 = tail call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 1), i8* %29, i32 2)
%31 = getelementptr inbounds i8, i8* %0, i64 8
%32 = tail call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 3), i8* %31, i32 3)
%33 = load i8, i8* %20
br label %68
34: ; preds = %19, %24
%35 = getelementptr inbounds i8, i8* %0, i64 4
%36 = tail call i32 @strncmp(i8* %35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %34
%39 = getelementptr inbounds i8, i8* %0, i64 1
%40 = tail call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 1), i8* %39, i32 3)
%41 = getelementptr inbounds i8, i8* %0, i64 9
%42 = tail call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 4), i8* %41, i32 2)
br label %68
43: ; preds = %34
%44 = getelementptr inbounds i8, i8* %0, i64 5
%45 = tail call i32 @strncmp(i8* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %52
47: ; preds = %43
%48 = getelementptr inbounds i8, i8* %0, i64 1
%49 = tail call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 1), i8* %48, i32 4)
%50 = getelementptr inbounds i8, i8* %0, i64 10
%51 = load i8, i8* %50
store i8 %51, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 5)
br label %68
52: ; preds = %43
%53 = load i8, i8* %44
%54 = icmp eq i8 %53, 48
br i1 %54, label %72, label %55
55: ; preds = %52
%56 = getelementptr inbounds i8, i8* %0, i64 6
%57 = tail call i32 @strncmp(i8* %56, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %72
59: ; preds = %55
%60 = getelementptr inbounds i8, i8* %0, i64 10
%61 = load i8, i8* %60
%62 = add i8 %61, -53
%63 = icmp ult i8 %62, 5
br i1 %63, label %64, label %72
64: ; preds = %59
%65 = getelementptr inbounds i8, i8* %0, i64 1
%66 = tail call i32 @memcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 1), i8* %65, i32 5)
%67 = load i8, i8* %60
br label %68
68: ; preds = %38, %64, %47, %28
%69 = phi i8 [ 51, %38 ], [ %67, %64 ], [ 52, %47 ], [ %33, %28 ]
store i8 %69, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 6)
%70 = trunc i32 %14 to i8
%71 = add i8 %70, 48
store i8 %71, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 7)
br label %72
72: ; preds = %13, %52, %55, %59, %1, %3, %68
%73 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @upc_a_to_e.result, i64 0, i64 0), %68 ], [ null, %3 ], [ null, %1 ], [ null, %13 ], [ null, %59 ], [ null, %55 ], [ null, %52 ]
ret i8* %73
}