#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 */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  int member_0;
  int member_1;
  int rm_so;
  char *rm_eo;
};
typedef TYPE_1__ regmatch_t;
typedef int /*<<< orphan*/ regex_t;
typedef int /*<<< orphan*/ mat;
typedef int /*<<< orphan*/ locales;

/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ REG_EXTENDED;
scalar_t__ REG_NOERROR;
scalar_t__ REG_NOMATCH;
int /*<<< orphan*/ memcmp(TYPE_1__ *, TYPE_1__ *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
scalar_t__ regcomp(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
scalar_t__ regexec(int /*<<< orphan*/ *, char const *, int, TYPE_1__ *,
                   int /*<<< orphan*/);
int /*<<< orphan*/ *setlocale(int /*<<< orphan*/, char const *);
int main(int argc, char *argv[]) {
  regex_t re;
  regmatch_t mat[10];
  int i, j, ret = 0;
  const char *locales[] = {"C", "de_DE.UTF-8"};
  const char *string = "http://www.regex.com/pattern/matching.html#intro";
  regmatch_t expect[10] = {{0, 48},  {0, 5},   {0, 4},   {5, 20},  {7, 20},
                           {20, 42}, {-1, -1}, {-1, -1}, {42, 48}, {43, 48}};
  for (i = 0; i < sizeof(locales) / sizeof(locales[0]); ++i) {
    if (setlocale(LC_ALL, locales[i]) == NULL) {
      puts("cannot set locale");
      ret = 1;
    } else if (regcomp(
                   &re,
                   "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?",
                   REG_EXTENDED) != REG_NOERROR) {
      puts("cannot compile the regular expression");
      ret = 1;
    } else if (regexec(&re, string, 10, mat, 0) == REG_NOMATCH) {
      puts("no match");
      ret = 1;
    } else {
      if (!memcmp(mat, expect, sizeof(mat)))
        printf("matching ok for %s locale\n", locales[i]);
      else {
        printf("matching failed for %s locale:\n", locales[i]);
        ret = 1;
        for (j = 0; j < 9; ++j)
          if (mat[j].rm_so != -1)
            printf("%d: %.*s\n", j, mat[j].rm_eo - mat[j].rm_so,
                   string + mat[j].rm_so);
      }
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x11c(%rbp)
mov    0x2c56(%rip),%rax
mov    %rax,-0x130(%rbp)
mov    0x2c50(%rip),%rax
mov    %rax,-0x128(%rbp)
lea    0xe58(%rip),%rax
mov    %rax,-0x138(%rbp)
lea    -0x230(%rbp),%rdi
lea    0xf35(%rip),%rsi
mov    $0xf0,%edx
call   1070 <memcpy@plt>
movl   $0x0,-0x114(%rbp)
movslq -0x114(%rbp),%rax
cmp    $0x2,%rax
jae    1417 <main+0x2a7>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
movslq -0x114(%rbp),%rax
mov    -0x130(%rbp,%rax,8),%rsi
ff
call   1090 <setlocale@plt>
cmp    $0x0,%rax
jne    1232 <main+0xc2>
lea    0xe21(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x11c(%rbp)
jmp    13fe <main+0x28e>
mov    0x2d97(%rip),%rax
mov    (%rax),%edx
lea    -0x14(%rbp),%rdi
lea    0xe0b(%rip),%rsi
call   1050 <regcomp@plt>
mov    0x2d96(%rip),%rcx
cmp    (%rcx),%rax
je     1276 <main+0x106>
lea    0xe29(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x11c(%rbp)
jmp    13f9 <main+0x289>
mov    -0x138(%rbp),%rsi
lea    -0x110(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0xa,%edx
xor    %r8d,%r8d
call   1080 <regexec@plt>
mov    0x2d44(%rip),%rcx
cmp    (%rcx),%rax
jne    12c0 <main+0x150>
lea    0xe05(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x11c(%rbp)
jmp    13f4 <main+0x284>
lea    -0x110(%rbp),%rdi
lea    -0x230(%rbp),%rsi
mov    $0xf0,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%eax
jne    1303 <main+0x193>
movslq -0x114(%rbp),%rax
mov    -0x130(%rbp,%rax,8),%rsi
ff
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ef <main+0x27f>
movslq -0x114(%rbp),%rax
mov    -0x130(%rbp,%rax,8),%rsi
ff
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x11c(%rbp)
movl   $0x0,-0x118(%rbp)
cmpl   $0x9,-0x118(%rbp)
jge    13ea <main+0x27a>
movslq -0x118(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
cmpl   $0xffffffff,0x8(%rax)
je     13d1 <main+0x261>
mov    -0x118(%rbp),%esi
movslq -0x118(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0x10(%rax),%rdx
movslq -0x118(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq 0x8(%rax),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdx
mov    -0x138(%rbp),%rcx
movslq -0x118(%rbp),%rdi
lea    -0x110(%rbp),%rax
imul   $0x18,%rdi,%rdi
add    %rdi,%rax
movslq 0x8(%rax),%rax
add    %rax,%rcx
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13d6 <main+0x266>
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    1334 <main+0x1c4>
jmp    13ef <main+0x27f>
jmp    13f4 <main+0x284>
jmp    13f9 <main+0x289>
jmp    13fe <main+0x28e>
jmp    1403 <main+0x293>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    11df <main+0x6f>
mov    -0x11c(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1f8,%rsp
lea    0xf78(%rip),%rsi
lea    0x100(%rsp),%rdi
mov    $0xf0,%edx
call   1070 <memcpy@plt>
mov    $0x1,%r14b
mov    0x2e24(%rip),%r15
lea    0x2c45(%rip),%rbx
lea    0xc(%rsp),%r13
lea    0x10(%rsp),%r12
xor    %eax,%eax
movl   $0x0,0x4(%rsp)
jmp    11f9 <main+0x89>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe68(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,0x4(%rsp)
mov    $0x1,%eax
test   $0x1,%r14b
mov    $0x0,%r14d
je     14fa <main+0x38a>
mov    (%r15),%edi
mov    (%rbx,%rax,8),%rbp
mov    %rbp,%rsi
call   1090 <setlocale@plt>
test   %rax,%rax
je     11d0 <main+0x60>
mov    %r14d,0x8(%rsp)
mov    %rbx,%r14
mov    %r15,%rbx
mov    0x2db1(%rip),%rax
mov    (%rax),%edx
mov    %r13,%r15
mov    %r13,%rdi
lea    0xe23(%rip),%rsi
call   1050 <regcomp@plt>
mov    0x2dae(%rip),%rcx
cmp    (%rcx),%rax
jne    1290 <main+0x120>
mov    %r15,%rdi
lea    0xdc5(%rip),%rsi
mov    $0xa,%edx
mov    %r12,%rbx
mov    %r12,%rcx
xor    %r8d,%r8d
call   1080 <regexec@plt>
mov    0x2d7d(%rip),%rcx
cmp    (%rcx),%rax
jne    12b7 <main+0x147>
lea    0xe42(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,0x4(%rsp)
mov    %rbx,%r12
jmp    14e2 <main+0x372>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xdf4(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,0x4(%rsp)
mov    %r15,%r13
mov    %rbx,%r15
mov    %r14,%rbx
mov    0x8(%rsp),%r14d
jmp    11e4 <main+0x74>
mov    %rbx,%rdi
lea    0x100(%rsp),%rsi
mov    $0xf0,%edx
call   1060 <memcmp@plt>
test   %eax,%eax
je     14d1 <main+0x361>
lea    0xdfa(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x18(%rsp),%rcx
cmp    $0xffffffffffffffff,%rcx
je     1312 <main+0x1a2>
mov    0x20(%rsp),%rdx
sub    %rcx,%rdx
lea    0xd0f(%rip),%rax
add    %rax,%rcx
lea    0xdec(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x30(%rsp),%rcx
cmp    $0xffffffffffffffff,%rcx
je     1342 <main+0x1d2>
mov    0x38(%rsp),%rdx
sub    %rcx,%rdx
lea    0xce2(%rip),%rax
add    %rax,%rcx
lea    0xdbf(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x48(%rsp),%rcx
cmp    $0xffffffffffffffff,%rcx
je     1372 <main+0x202>
mov    0x50(%rsp),%rdx
sub    %rcx,%rdx
lea    0xcb2(%rip),%rax
add    %rax,%rcx
lea    0xd8f(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x60(%rsp),%rcx
cmp    $0xffffffffffffffff,%rcx
mov    0x2c46(%rip),%r15
mov    0x8(%rsp),%r14d
je     13ae <main+0x23e>
mov    0x68(%rsp),%rdx
sub    %rcx,%rdx
lea    0xc76(%rip),%rax
add    %rax,%rcx
lea    0xd53(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x78(%rsp),%rcx
cmp    $0xffffffffffffffff,%rcx
lea    0x2a32(%rip),%rbx
je     13e8 <main+0x278>
mov    0x80(%rsp),%rdx
sub    %rcx,%rdx
lea    0xc3c(%rip),%rax
add    %rax,%rcx
lea    0xd19(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x90(%rsp),%rcx
cmp    $0xffffffffffffffff,%rcx
je     141e <main+0x2ae>
mov    0x98(%rsp),%rdx
sub    %rcx,%rdx
lea    0xc06(%rip),%rax
add    %rax,%rcx
lea    0xce3(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0xa8(%rsp),%rcx
cmp    $0xffffffffffffffff,%rcx
je     1454 <main+0x2e4>
mov    0xb0(%rsp),%rdx
sub    %rcx,%rdx
lea    0xbd0(%rip),%rax
add    %rax,%rcx
lea    0xcad(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0xc0(%rsp),%rcx
cmp    $0xffffffffffffffff,%rcx
je     148a <main+0x31a>
mov    0xc8(%rsp),%rdx
sub    %rcx,%rdx
lea    0xb9a(%rip),%rax
add    %rax,%rcx
lea    0xc77(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0xd8(%rsp),%rcx
movl   $0x1,0x4(%rsp)
cmp    $0xffffffffffffffff,%rcx
je     11e4 <main+0x74>
mov    0xe0(%rsp),%rdx
sub    %rcx,%rdx
lea    0xb58(%rip),%rax
add    %rax,%rcx
lea    0xc35(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e4 <main+0x74>
lea    0xbe2(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2adf(%rip),%r15
lea    0x2900(%rip),%rbx
mov    0x8(%rsp),%r14d
jmp    11e4 <main+0x74>
mov    0x4(%rsp),%eax
add    $0x1f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32, i32, i32, i8* }
@.str = [2 x i8] c"C\00"
@.str.1 = [12 x i8] c"de_DE.UTF-8\00"
@__const.main.locales = [2 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [49 x i8] c"http://www.regex.com/pattern/matching.html#intro\00"
@__const.main.expect = [10 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 0, i32 48, i32 0, i8* null }, %struct.TYPE_5__ { i32 0, i32 5, i32 0, i8* null }, %struct.TYPE_5__ { i32 0, i32 4, i32 0, i8* null }, %struct.TYPE_5__ { i32 5, i32 20, i32 0, i8* null }, %struct.TYPE_5__ { i32 7, i32 20, i32 0, i8* null }, %struct.TYPE_5__ { i32 20, i32 42, i32 0, i8* null }, %struct.TYPE_5__ { i32 -1, i32 -1, i32 0, i8* null }, %struct.TYPE_5__ { i32 -1, i32 -1, i32 0, i8* null }, %struct.TYPE_5__ { i32 42, i32 48, i32 0, i8* null }, %struct.TYPE_5__ { i32 43, i32 48, i32 0, i8* null }]
@LC_ALL = global i32 0
@.str.3 = [18 x i8] c"cannot set locale\00"
@.str.4 = [58 x i8] c"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\00"
@REG_EXTENDED = global i32 0
@REG_NOERROR = global i64 0
@.str.5 = [38 x i8] c"cannot compile the regular expression\00"
@REG_NOMATCH = global i64 0
@.str.6 = [9 x i8] c"no match\00"
@.str.7 = [27 x i8] c"matching ok for %s locale\0A\00"
@.str.8 = [32 x i8] c"matching failed for %s locale:\0A\00"
@.str.9 = [10 x i8] c"%d: %.*s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x %struct.TYPE_5__]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [2 x i8*]
%12 = alloca i8*
%13 = alloca [10 x %struct.TYPE_5__]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %10
%14 = bitcast [2 x i8*]* %11 to i8*
store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8** %12
%15 = bitcast [10 x %struct.TYPE_5__]* %13 to i8*
store i32 0, i32* %8
br label %16
16: ; preds = %105, %2
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = icmp ult i64 %18, 2
br i1 %19, label %20, label %108
20: ; preds = %16
%21 = load i32, i32* @LC_ALL
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [2 x i8*], [2 x i8*]* %11, i64 0, i64 %23
%25 = load i8*, i8** %24
%26 = call i32* @setlocale(i32 %21, i8* %25)
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %30
28: ; preds = %20
%29 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %10
br label %104
30: ; preds = %20
%31 = load i32, i32* @REG_EXTENDED
%32 = call i64 @regcomp(i32* %6, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 %31)
%33 = load i64, i64* @REG_NOERROR
%34 = icmp ne i64 %32, %33
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = call i32 @puts(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %10
br label %103
37: ; preds = %30
%38 = load i8*, i8** %12
%39 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %7, i64 0, i64 0
%40 = call i64 @regexec(i32* %6, i8* %38, i32 10, %struct.TYPE_5__* %39, i32 0)
%41 = load i64, i64* @REG_NOMATCH
%42 = icmp eq i64 %40, %41
br i1 %42, label %43, label %45
43: ; preds = %37
%44 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %10
br label %102
45: ; preds = %37
%46 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %7, i64 0, i64 0
%47 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %13, i64 0, i64 0
%48 = call i32 @memcmp(%struct.TYPE_5__* %46, %struct.TYPE_5__* %47, i32 240)
%49 = icmp ne i32 %48, 0
br i1 %49, label %56, label %50
50: ; preds = %45
%51 = load i32, i32* %8
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [2 x i8*], [2 x i8*]* %11, i64 0, i64 %52
%54 = load i8*, i8** %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %54)
br label %101
56: ; preds = %45
%57 = load i32, i32* %8
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [2 x i8*], [2 x i8*]* %11, i64 0, i64 %58
%60 = load i8*, i8** %59
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %60)
store i32 1, i32* %10
store i32 0, i32* %9
br label %62
62: ; preds = %97, %56
%63 = load i32, i32* %9
%64 = icmp slt i32 %63, 9
br i1 %64, label %65, label %100
65: ; preds = %62
%66 = load i32, i32* %9
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %7, i64 0, i64 %67
%69 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %68, i32 0, i32 2
%70 = load i32, i32* %69
%71 = icmp ne i32 %70, -1
br i1 %71, label %72, label %96
72: ; preds = %65
%73 = load i32, i32* %9
%74 = load i32, i32* %9
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %7, i64 0, i64 %75
%77 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %76, i32 0, i32 3
%78 = load i8*, i8** %77
%79 = load i32, i32* %9
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %7, i64 0, i64 %80
%82 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %81, i32 0, i32 2
%83 = load i32, i32* %82
%84 = sext i32 %83 to i64
%85 = sub i64 0, %84
%86 = getelementptr inbounds i8, i8* %78, i64 %85
%87 = load i8*, i8** %12
%88 = load i32, i32* %9
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %7, i64 0, i64 %89
%91 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %90, i32 0, i32 2
%92 = load i32, i32* %91
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %87, i64 %93
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %73, i8* %86, i8* %94)
br label %96
96: ; preds = %72, %65
br label %97
97: ; preds = %96
%98 = load i32, i32* %9
%99 = add nsw i32 %98, 1
store i32 %99, i32* %9
br label %62
100: ; preds = %62
br label %101
101: ; preds = %100, %50
br label %102
102: ; preds = %101, %43
br label %103
103: ; preds = %102, %35
br label %104
104: ; preds = %103, %28
br label %105
105: ; preds = %104
%106 = load i32, i32* %8
%107 = add nsw i32 %106, 1
store i32 %107, i32* %8
br label %16
108: ; preds = %16
%109 = load i32, i32* %10
ret i32 %109
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32, i32, i32, i8* }
@.str = [2 x i8] c"C\00"
@.str.1 = [12 x i8] c"de_DE.UTF-8\00"
@__const.main.locales = [2 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [49 x i8] c"http://www.regex.com/pattern/matching.html#intro\00"
@__const.main.expect = [10 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 0, i32 48, i32 0, i8* null }, %struct.TYPE_5__ { i32 0, i32 5, i32 0, i8* null }, %struct.TYPE_5__ { i32 0, i32 4, i32 0, i8* null }, %struct.TYPE_5__ { i32 5, i32 20, i32 0, i8* null }, %struct.TYPE_5__ { i32 7, i32 20, i32 0, i8* null }, %struct.TYPE_5__ { i32 20, i32 42, i32 0, i8* null }, %struct.TYPE_5__ { i32 -1, i32 -1, i32 0, i8* null }, %struct.TYPE_5__ { i32 -1, i32 -1, i32 0, i8* null }, %struct.TYPE_5__ { i32 42, i32 48, i32 0, i8* null }, %struct.TYPE_5__ { i32 43, i32 48, i32 0, i8* null }]
@LC_ALL = global i32 0
@.str.3 = [18 x i8] c"cannot set locale\00"
@.str.4 = [58 x i8] c"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\00"
@REG_EXTENDED = global i32 0
@REG_NOERROR = global i64 0
@.str.5 = [38 x i8] c"cannot compile the regular expression\00"
@REG_NOMATCH = global i64 0
@.str.6 = [9 x i8] c"no match\00"
@.str.7 = [27 x i8] c"matching ok for %s locale\0A\00"
@.str.8 = [32 x i8] c"matching failed for %s locale:\0A\00"
@.str.9 = [10 x i8] c"%d: %.*s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [10 x %struct.TYPE_5__]
%5 = alloca [10 x %struct.TYPE_5__]
%6 = bitcast i32* %3 to i8*
%7 = bitcast [10 x %struct.TYPE_5__]* %4 to i8*
%8 = bitcast [10 x %struct.TYPE_5__]* %5 to i8*
%9 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 0
%10 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %5, i64 0, i64 0
%11 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 0, i32 2
%12 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 0, i32 3
%13 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 1, i32 2
%14 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 1, i32 3
%15 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 2, i32 2
%16 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 2, i32 3
%17 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 3, i32 2
%18 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 3, i32 3
%19 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 4, i32 2
%20 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 4, i32 3
%21 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 5, i32 2
%22 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 5, i32 3
%23 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 6, i32 2
%24 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 6, i32 3
%25 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 7, i32 2
%26 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 7, i32 3
%27 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 8, i32 2
%28 = getelementptr inbounds [10 x %struct.TYPE_5__], [10 x %struct.TYPE_5__]* %4, i64 0, i64 8, i32 3
br label %29
29: ; preds = %2, %149
%30 = phi i1 [ true, %2 ], [ false, %149 ]
%31 = phi i64 [ 0, %2 ], [ 1, %149 ]
%32 = phi i32 [ 0, %2 ], [ %150, %149 ]
%33 = load i32, i32* @LC_ALL
%34 = getelementptr inbounds [2 x i8*], [2 x i8*]* @__const.main.locales, i64 0, i64 %31
%35 = load i8*, i8** %34
%36 = call i32* @setlocale(i32 %33, i8* %35)
%37 = icmp eq i32* %36, null
br i1 %37, label %38, label %40
38: ; preds = %29
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %149
40: ; preds = %29
%41 = load i32, i32* @REG_EXTENDED
%42 = call i64 @regcomp(i32* %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 %41)
%43 = load i64, i64* @REG_NOERROR
%44 = icmp eq i64 %42, %43
br i1 %44, label %47, label %45
45: ; preds = %40
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
br label %149
47: ; preds = %40
%48 = call i64 @regexec(i32* %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i32 10, %struct.TYPE_5__* %9, i32 0)
%49 = load i64, i64* @REG_NOMATCH
%50 = icmp eq i64 %48, %49
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %149
53: ; preds = %47
%54 = call i32 @memcmp(%struct.TYPE_5__* %9, %struct.TYPE_5__* %10, i32 240)
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %35)
br label %149
58: ; preds = %53
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %35)
%60 = load i32, i32* %11
%61 = icmp eq i32 %60, -1
br i1 %61, label %69, label %62
62: ; preds = %58
%63 = load i8*, i8** %12
%64 = sext i32 %60 to i64
%65 = sub nsw i64 0, %64
%66 = getelementptr inbounds i8, i8* %63, i64 %65
%67 = getelementptr inbounds [49 x i8], [49 x i8]* @.str.2, i64 0, i64 %64
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 0, i8* %66, i8* %67)
br label %69
69: ; preds = %58, %62
%70 = load i32, i32* %13
%71 = icmp eq i32 %70, -1
br i1 %71, label %79, label %72
72: ; preds = %69
%73 = load i8*, i8** %14
%74 = sext i32 %70 to i64
%75 = sub nsw i64 0, %74
%76 = getelementptr inbounds i8, i8* %73, i64 %75
%77 = getelementptr inbounds [49 x i8], [49 x i8]* @.str.2, i64 0, i64 %74
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 1, i8* %76, i8* %77)
br label %79
79: ; preds = %72, %69
%80 = load i32, i32* %15
%81 = icmp eq i32 %80, -1
br i1 %81, label %89, label %82
82: ; preds = %79
%83 = load i8*, i8** %16
%84 = sext i32 %80 to i64
%85 = sub nsw i64 0, %84
%86 = getelementptr inbounds i8, i8* %83, i64 %85
%87 = getelementptr inbounds [49 x i8], [49 x i8]* @.str.2, i64 0, i64 %84
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 2, i8* %86, i8* %87)
br label %89
89: ; preds = %82, %79
%90 = load i32, i32* %17
%91 = icmp eq i32 %90, -1
br i1 %91, label %99, label %92
92: ; preds = %89
%93 = load i8*, i8** %18
%94 = sext i32 %90 to i64
%95 = sub nsw i64 0, %94
%96 = getelementptr inbounds i8, i8* %93, i64 %95
%97 = getelementptr inbounds [49 x i8], [49 x i8]* @.str.2, i64 0, i64 %94
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 3, i8* %96, i8* %97)
br label %99
99: ; preds = %92, %89
%100 = load i32, i32* %19
%101 = icmp eq i32 %100, -1
br i1 %101, label %109, label %102
102: ; preds = %99
%103 = load i8*, i8** %20
%104 = sext i32 %100 to i64
%105 = sub nsw i64 0, %104
%106 = getelementptr inbounds i8, i8* %103, i64 %105
%107 = getelementptr inbounds [49 x i8], [49 x i8]* @.str.2, i64 0, i64 %104
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 4, i8* %106, i8* %107)
br label %109
109: ; preds = %102, %99
%110 = load i32, i32* %21
%111 = icmp eq i32 %110, -1
br i1 %111, label %119, label %112
112: ; preds = %109
%113 = load i8*, i8** %22
%114 = sext i32 %110 to i64
%115 = sub nsw i64 0, %114
%116 = getelementptr inbounds i8, i8* %113, i64 %115
%117 = getelementptr inbounds [49 x i8], [49 x i8]* @.str.2, i64 0, i64 %114
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 5, i8* %116, i8* %117)
br label %119
119: ; preds = %112, %109
%120 = load i32, i32* %23
%121 = icmp eq i32 %120, -1
br i1 %121, label %129, label %122
122: ; preds = %119
%123 = load i8*, i8** %24
%124 = sext i32 %120 to i64
%125 = sub nsw i64 0, %124
%126 = getelementptr inbounds i8, i8* %123, i64 %125
%127 = getelementptr inbounds [49 x i8], [49 x i8]* @.str.2, i64 0, i64 %124
%128 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 6, i8* %126, i8* %127)
br label %129
129: ; preds = %122, %119
%130 = load i32, i32* %25
%131 = icmp eq i32 %130, -1
br i1 %131, label %139, label %132
132: ; preds = %129
%133 = load i8*, i8** %26
%134 = sext i32 %130 to i64
%135 = sub nsw i64 0, %134
%136 = getelementptr inbounds i8, i8* %133, i64 %135
%137 = getelementptr inbounds [49 x i8], [49 x i8]* @.str.2, i64 0, i64 %134
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 7, i8* %136, i8* %137)
br label %139
139: ; preds = %132, %129
%140 = load i32, i32* %27
%141 = icmp eq i32 %140, -1
br i1 %141, label %149, label %142
142: ; preds = %139
%143 = load i8*, i8** %28
%144 = sext i32 %140 to i64
%145 = sub nsw i64 0, %144
%146 = getelementptr inbounds i8, i8* %143, i64 %145
%147 = getelementptr inbounds [49 x i8], [49 x i8]* @.str.2, i64 0, i64 %144
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 8, i8* %146, i8* %147)
br label %149
149: ; preds = %139, %142, %38, %51, %56, %45
%150 = phi i32 [ 1, %38 ], [ 1, %45 ], [ 1, %51 ], [ %32, %56 ], [ 1, %142 ], [ 1, %139 ]
br i1 %30, label %29, label %151
151: ; preds = %149
ret i32 %150
}