#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_7__ TYPE_3__;
typedef struct TYPE_6__ TYPE_2__;
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
typedef int int32_t;
typedef int /*<<< orphan*/ buffer;
typedef int /*<<< orphan*/ URegularExpression;
struct TYPE_6__ {
  int /*<<< orphan*/ member_0;
};
struct TYPE_5__ {
  int /*<<< orphan*/ member_0;
};
struct TYPE_7__ {
  int member_0;
  int member_1;
  int /*<<< orphan*/ offset;
  TYPE_2__ member_3;
  TYPE_1__ member_2;
};
typedef TYPE_3__ UParseError;
typedef int /*<<< orphan*/ UFILE;
typedef scalar_t__ UErrorCode;
typedef int UChar;
typedef scalar_t__ UBool;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ FALSE;
int /*<<< orphan*/ UREGEX_CASE_INSENSITIVE;
scalar_t__ U_FAILURE(scalar_t__);
scalar_t__ U_REGEX_RULE_SYNTAX;
scalar_t__ U_ZERO_ERROR;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ u_cleanup();
char *u_errorName(scalar_t__);
int /*<<< orphan*/ u_fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *u_finit(int /*<<< orphan*/, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *);
int /*<<< orphan*/ u_fprintf(int /*<<< orphan*/ *, char *, int, ...);
int /*<<< orphan*/ uregex_close(int /*<<< orphan*/ *);
int uregex_end(int /*<<< orphan*/ *, int /*<<< orphan*/, scalar_t__ *);
scalar_t__ uregex_findNext(int /*<<< orphan*/ *, scalar_t__ *);
int uregex_group(int /*<<< orphan*/ *, int, int *, int, scalar_t__ *);
int uregex_groupCount(int /*<<< orphan*/ *, scalar_t__ *);
int /*<<< orphan*/ *uregex_open(int *, int, int /*<<< orphan*/, TYPE_3__ *,
                                scalar_t__ *);
int /*<<< orphan*/ uregex_setText(int /*<<< orphan*/ *, int *, int,
                                  scalar_t__ *);
int uregex_start(int /*<<< orphan*/ *, int /*<<< orphan*/, scalar_t__ *);
int main(void) {
  int ret;
  int32_t l, u;
  UErrorCode status;
  UFILE *ustdout, *ustderr;
  URegularExpression *uregex;
  UBool case_insensitive = FALSE;
  UParseError pe = {-1, -1, {0}, {0}};
  UChar pattern[] = {0x0028, 0x005C, 0x0070, 0x007B, 0x004C, 0x007D,
                     0x0029, 0x0028, 0x005C, 0x0070, 0x007B, 0x004E,
                     0x0064, 0x007D, 0x0029, 0};
  UChar string[] = {0xD835, 0xDE3C, 0xD835, 0xDE3C, 0xD835, 0xDFE2, 0xD835,
                    0xDE3D, 0xD835, 0xDE3D, 0xD835, 0xDFE3, 0xD835, 0xDE3E,
                    0xD835, 0xDE3E, 0xD835, 0xDFE4, 0};
  uregex = NULL;
  ret = EXIT_SUCCESS;
  status = U_ZERO_ERROR;
  ustdout = u_finit(stdout, NULL, NULL);
  ustderr = u_finit(stderr, NULL, NULL);
  uregex =
      uregex_open(pattern, -1, case_insensitive ? UREGEX_CASE_INSENSITIVE : 0,
                  &pe, &status);
  if (U_FAILURE(status)) {
    if (U_REGEX_RULE_SYNTAX == status) {
      u_fprintf(ustderr, "Invalid pattern: error at offset %d\n\t%S\n\t%*c\n",
                pe.offset, pattern, pe.offset, '^');
    }
    goto end;
  }
  uregex_setText(uregex, string, -1, &status);
  if (U_FAILURE(status)) {
    goto end;
  }
  while (uregex_findNext(uregex, &status)) {
    l = uregex_start(uregex, 0, &status);
    if (U_FAILURE(status)) {
      goto end;
    }
    u = uregex_end(uregex, 0, &status);
    if (U_FAILURE(status)) {
      goto end;
    }
    u_fprintf(ustdout, "Match found at %d position (to %d): %.*S\n", l, u,
              u - l, string + l);
    {
      UChar buffer[1024];
      int32_t i, l, g;
      l = uregex_groupCount(uregex, &status);
      if (U_FAILURE(status)) {
        fprintf(stderr,
                "ICU Error \"%s\" from "
                "uregex_groupCount"
                "()\n",
                u_errorName(status));
      }
      for (i = 1; i <= l; i++) {
        g = uregex_group(uregex, i, buffer,
                         (sizeof(buffer) / sizeof((buffer)[0])), &status);
        if (U_FAILURE(status)) {
          fprintf(stderr,
                  "ICU Error \"%s\" from "
                  "uregex_group"
                  "()\n",
                  u_errorName(status));
        }
        u_fprintf(ustdout, "$%d : %S\n", i, buffer);
      }
    }
  }
  if (U_FAILURE(status)) {
    goto end;
  }
  if (FALSE) {
  end:
    ret = EXIT_FAILURE;
  }
  if (NULL != ustderr) {
    u_fclose(ustderr);
  }
  if (NULL != ustdout) {
    u_fclose(ustdout);
  }
  if (NULL != uregex) {
    uregex_close(uregex);
  }
  u_cleanup();
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1110,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2d8f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    0xdd9(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xdd6(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xdd4(%rip),%eax
mov    %eax,-0x40(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xdd3(%rip),%rsi
mov    $0x40,%edx
call   1100 <memcpy@plt>
lea    -0xe0(%rbp),%rdi
lea    0xdfb(%rip),%rsi
mov    $0x4c,%edx
call   1100 <memcpy@plt>
movq   $0x0,-0x30(%rbp)
mov    0x2d32(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2d5e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2d20(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1090 <u_finit@plt>
mov    %rax,-0x20(%rbp)
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1090 <u_finit@plt>
mov    %rax,-0x28(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x10f8(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     12f0 <main+0xf0>
mov    0x2ce5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10fc(%rbp)
jmp    12fd <main+0xfd>
xor    %eax,%eax
mov    %eax,-0x10fc(%rbp)
jmp    12fd <main+0xfd>
mov    -0x10f8(%rbp),%rdi
mov    -0x10fc(%rbp),%edx
mov    $0xffffffff,%esi
lea    -0x50(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   10a0 <uregex_open@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   10b0 <U_FAILURE@plt>
cmp    $0x0,%rax
je     1372 <main+0x172>
mov    0x2c96(%rip),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    136d <main+0x16d>
mov    -0x28(%rbp),%rdi
mov    -0x48(%rbp),%edx
lea    -0x90(%rbp),%rcx
mov    -0x48(%rbp),%r8d
lea    0xd4c(%rip),%rsi
mov    $0x5e,%r9d
mov    $0x0,%al
call   10c0 <u_fprintf@plt>
jmp    157f <main+0x37f>
mov    -0x30(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    $0xffffffff,%edx
lea    -0x18(%rbp),%rcx
call   1080 <uregex_setText@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <U_FAILURE@plt>
cmp    $0x0,%rax
je     13a3 <main+0x1a3>
jmp    157f <main+0x37f>
jmp    13a8 <main+0x1a8>
mov    -0x30(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   10d0 <uregex_findNext@plt>
cmp    $0x0,%rax
je     1551 <main+0x351>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
lea    -0x18(%rbp),%rdx
call   1050 <uregex_start@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   10b0 <U_FAILURE@plt>
cmp    $0x0,%rax
je     13e9 <main+0x1e9>
jmp    157f <main+0x37f>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
lea    -0x18(%rbp),%rdx
call   1110 <uregex_end@plt>
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   10b0 <U_FAILURE@plt>
cmp    $0x0,%rax
je     1413 <main+0x213>
jmp    157f <main+0x37f>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x10(%rbp),%r8d
sub    -0xc(%rbp),%r8d
lea    -0xe0(%rbp),%r9
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r9
lea    0xc9c(%rip),%rsi
mov    $0x0,%al
call   10c0 <u_fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <uregex_groupCount@plt>
mov    %eax,-0x10e8(%rbp)
mov    -0x18(%rbp),%rdi
call   10b0 <U_FAILURE@plt>
cmp    $0x0,%rax
je     1498 <main+0x298>
mov    0x2b66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1100(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <u_errorName@plt>
mov    -0x1100(%rbp),%edi
mov    %rax,%rdx
lea    0xc71(%rip),%rsi
call   10f0 <fprintf@plt>
movl   $0x1,-0x10e4(%rbp)
mov    -0x10e4(%rbp),%eax
cmp    -0x10e8(%rbp),%eax
jg     154c <main+0x34c>
mov    -0x30(%rbp),%rdi
mov    -0x10e4(%rbp),%esi
lea    -0x10e0(%rbp),%rdx
mov    $0x400,%ecx
lea    -0x18(%rbp),%r8
call   1030 <uregex_group@plt>
mov    %eax,-0x10ec(%rbp)
mov    -0x18(%rbp),%rdi
call   10b0 <U_FAILURE@plt>
cmp    $0x0,%rax
je     1519 <main+0x319>
mov    0x2ae5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1104(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <u_errorName@plt>
mov    -0x1104(%rbp),%edi
mov    %rax,%rdx
lea    0xc19(%rip),%rsi
call   10f0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10e4(%rbp),%edx
lea    -0x10e0(%rbp),%rcx
lea    0xc20(%rip),%rsi
mov    $0x0,%al
call   10c0 <u_fprintf@plt>
mov    -0x10e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10e4(%rbp)
jmp    14a2 <main+0x2a2>
jmp    13a8 <main+0x1a8>
mov    -0x18(%rbp),%rdi
call   10b0 <U_FAILURE@plt>
cmp    $0x0,%rax
je     1569 <main+0x369>
jmp    157f <main+0x37f>
mov    0x2a38(%rip),%rax
cmpq   $0x0,(%rax)
je     158b <main+0x38b>
jmp    157f <main+0x37f>
mov    0x2a3a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
je     15a0 <main+0x3a0>
mov    -0x28(%rbp),%rdi
call   10e0 <u_fclose@plt>
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
je     15b5 <main+0x3b5>
mov    -0x20(%rbp),%rdi
call   10e0 <u_fclose@plt>
xor    %eax,%eax
cmp    -0x30(%rbp),%rax
je     15ca <main+0x3ca>
mov    -0x30(%rbp),%rdi
call   1060 <uregex_close@plt>
mov    $0x0,%al
call   1120 <u_cleanup@plt>
mov    -0x8(%rbp),%eax
add    $0x1110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10d8,%rsp
mov    0x2da0(%rip),%rax
mov    (%rax),%r14
mov    0xdff(%rip),%eax
mov    %eax,0x30(%rsp)
movups 0xde4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe28(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe0c(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xdf0(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xdd4(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movups 0xe44(%rip),%xmm0
movups %xmm0,0xbc(%rsp)
movaps 0xe29(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xe0a(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xdeb(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xdcc(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
mov    0x2d0d(%rip),%rax
mov    (%rax),%r15d
mov    0x2d3b(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%rsp)
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %esi,%esi
xor    %edx,%edx
call   1090 <u_finit@plt>
mov    %rax,0x8(%rsp)
mov    0x2d04(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1090 <u_finit@plt>
mov    %rax,%rbp
test   %r14,%r14
je     12f0 <main+0x100>
mov    0x2cda(%rip),%rax
mov    (%rax),%ebx
lea    0x40(%rsp),%rdi
lea    0x20(%rsp),%rcx
mov    %rsp,%r8
mov    $0xffffffff,%esi
mov    %ebx,%edx
call   10a0 <uregex_open@plt>
mov    %rax,%r12
mov    (%rsp),%rdi
call   10b0 <U_FAILURE@plt>
test   %rax,%rax
mov    %rbp,0x18(%rsp)
je     1356 <main+0x166>
mov    0x2caa(%rip),%rax
mov    (%rax),%rax
cmp    (%rsp),%rax
jne    137c <main+0x18c>
mov    0x28(%rsp),%edx
lea    0xd72(%rip),%rsi
lea    0x40(%rsp),%rcx
mov    0x18(%rsp),%rdi
mov    %edx,%r8d
mov    $0x5e,%r9d
xor    %eax,%eax
call   10c0 <u_fprintf@plt>
jmp    137c <main+0x18c>
lea    0x80(%rsp),%rsi
mov    %rsp,%rcx
mov    %r12,%rdi
mov    $0xffffffff,%edx
call   1080 <uregex_setText@plt>
mov    (%rsp),%rdi
call   10b0 <U_FAILURE@plt>
test   %rax,%rax
je     13cd <main+0x1dd>
mov    0x2c3d(%rip),%rax
mov    (%rax),%r15d
mov    0x18(%rsp),%rdi
test   %rdi,%rdi
je     1395 <main+0x1a5>
call   10e0 <u_fclose@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13a4 <main+0x1b4>
call   10e0 <u_fclose@plt>
test   %r12,%r12
je     13b1 <main+0x1c1>
mov    %r12,%rdi
call   1060 <uregex_close@plt>
xor    %eax,%eax
call   1110 <u_cleanup@plt>
mov    %r15d,%eax
add    $0x10d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%rsi
mov    %r12,%rdi
call   10d0 <uregex_findNext@plt>
test   %rax,%rax
je     156c <main+0x37c>
mov    %rsp,%rbx
lea    0xd0(%rsp),%r13
mov    %r15d,0x14(%rsp)
jmp    1419 <main+0x229>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    %rbx,%rsi
call   10d0 <uregex_findNext@plt>
test   %rax,%rax
mov    0x14(%rsp),%r15d
je     156c <main+0x37c>
mov    %r12,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1050 <uregex_start@plt>
mov    %rbx,%r14
mov    %eax,%ebx
mov    (%rsp),%rdi
call   10b0 <U_FAILURE@plt>
test   %rax,%rax
jne    137c <main+0x18c>
mov    %r12,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1100 <uregex_end@plt>
mov    %eax,%ebp
mov    (%rsp),%rdi
call   10b0 <U_FAILURE@plt>
test   %rax,%rax
jne    137c <main+0x18c>
mov    %ebp,%r8d
sub    %ebx,%r8d
movslq %ebx,%rax
lea    (%rsp,%rax,4),%r9
add    $0x80,%r9
mov    0x8(%rsp),%rdi
lea    0xc5c(%rip),%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   10c0 <u_fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1070 <uregex_groupCount@plt>
mov    %eax,%r15d
mov    (%rsp),%rdi
call   10b0 <U_FAILURE@plt>
test   %rax,%rax
mov    %r14,%rbx
je     14ce <main+0x2de>
mov    0x2b29(%rip),%rax
mov    (%rax),%ebx
mov    (%rsp),%rdi
call   1040 <u_errorName@plt>
mov    %ebx,%edi
mov    %rsp,%rbx
lea    0xc3e(%rip),%rsi
mov    %rax,%rdx
call   10f0 <fprintf@plt>
test   %r15d,%r15d
mov    0x8(%rsp),%rbp
jle    1400 <main+0x210>
neg    %r15d
mov    $0x1,%r14d
jmp    1520 <main+0x330>
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
lea    0xc57(%rip),%rsi
mov    %r14d,%edx
mov    %r13,%rcx
xor    %eax,%eax
call   10c0 <u_fprintf@plt>
lea    (%r15,%r14,1),%eax
add    $0x1,%eax
mov    %r14d,%ecx
add    $0x1,%ecx
mov    %ecx,%r14d
cmp    $0x1,%eax
je     1400 <main+0x210>
mov    %r12,%rdi
mov    %r14d,%esi
mov    %r13,%rdx
mov    $0x400,%ecx
mov    %rbx,%r8
call   1030 <uregex_group@plt>
mov    (%rsp),%rdi
call   10b0 <U_FAILURE@plt>
test   %rax,%rax
je     14f0 <main+0x300>
mov    0x2a8d(%rip),%rax
mov    (%rax),%ebx
mov    (%rsp),%rdi
call   1040 <u_errorName@plt>
mov    %ebx,%edi
mov    %rsp,%rbx
lea    0xbcb(%rip),%rsi
mov    %rax,%rdx
call   10f0 <fprintf@plt>
jmp    14f0 <main+0x300>
mov    (%rsp),%rdi
call   10b0 <U_FAILURE@plt>
mov    0x2a2c(%rip),%rcx
or     (%rcx),%rax
jne    137c <main+0x18c>
jmp    1386 <main+0x196>

LLVM IR (-O0):
%struct.TYPE_7__ = type { i32, i32, i32, %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_6__ = type { i32 }
%struct.TYPE_5__ = type { i32 }
@FALSE = global i64 0
@__const.main.pe = %struct.TYPE_7__ { i32 -1, i32 -1, i32 0, %struct.TYPE_6__ zeroinitializer, %struct.TYPE_5__ zeroinitializer }
@__const.main.pattern = [16 x i32] [i32 40, i32 92, i32 112, i32 123, i32 76, i32 125, i32 41, i32 40, i32 92, i32 112, i32 123, i32 78, i32 100, i32 125, i32 41, i32 0]
@__const.main.string = [19 x i32] [i32 55349, i32 56892, i32 55349, i32 56892, i32 55349, i32 57314, i32 55349, i32 56893, i32 55349, i32 56893, i32 55349, i32 57315, i32 55349, i32 56894, i32 55349, i32 56894, i32 55349, i32 57316, i32 0]
@EXIT_SUCCESS = global i32 0
@U_ZERO_ERROR = global i64 0
@stdout = global i32 0
@stderr = global i32 0
@UREGEX_CASE_INSENSITIVE = global i32 0
@U_REGEX_RULE_SYNTAX = global i64 0
@.str = [46 x i8] c"Invalid pattern: error at offset %d\0A\09%S\0A\09%*c\0A\00"
@.str.1 = [42 x i8] c"Match found at %d position (to %d): %.*S\0A\00"
@.str.2 = [41 x i8] c"ICU Error \22%s\22 from uregex_groupCount()\0A\00"
@.str.3 = [36 x i8] c"ICU Error \22%s\22 from uregex_group()\0A\00"
@.str.4 = [10 x i8] c"$%d : %S\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i64
%10 = alloca %struct.TYPE_7__
%11 = alloca [16 x i32]
%12 = alloca [19 x i32]
%13 = alloca [1024 x i32]
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %1
%17 = load i64, i64* @FALSE
store i64 %17, i64* %9
%18 = bitcast %struct.TYPE_7__* %10 to i8*
%19 = bitcast [16 x i32]* %11 to i8*
%20 = bitcast [19 x i32]* %12 to i8*
store i32* null, i32** %8
%21 = load i32, i32* @EXIT_SUCCESS
store i32 %21, i32* %2
%22 = load i64, i64* @U_ZERO_ERROR
store i64 %22, i64* %5
%23 = load i32, i32* @stdout
%24 = call i32* @u_finit(i32 %23, i32* null, i32* null)
store i32* %24, i32** %6
%25 = load i32, i32* @stderr
%26 = call i32* @u_finit(i32 %25, i32* null, i32* null)
store i32* %26, i32** %7
%27 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 0
%28 = load i64, i64* %9
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %0
%31 = load i32, i32* @UREGEX_CASE_INSENSITIVE
br label %33
32: ; preds = %0
br label %33
33: ; preds = %32, %30
%34 = phi i32 [ %31, %30 ], [ 0, %32 ]
%35 = call i32* @uregex_open(i32* %27, i32 -1, i32 %34, %struct.TYPE_7__* %10, i64* %5)
store i32* %35, i32** %8
%36 = load i64, i64* %5
%37 = call i64 @U_FAILURE(i64 %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %52
39: ; preds = %33
%40 = load i64, i64* @U_REGEX_RULE_SYNTAX
%41 = load i64, i64* %5
%42 = icmp eq i64 %40, %41
br i1 %42, label %43, label %51
43: ; preds = %39
%44 = load i32*, i32** %7
%45 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %10, i32 0, i32 2
%46 = load i32, i32* %45
%47 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 0
%48 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %10, i32 0, i32 2
%49 = load i32, i32* %48
%50 = call i32 (i32*, i8*, i32, ...) @u_fprintf(i32* %44, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %46, i32* %47, i32 %49, i32 94)
br label %51
51: ; preds = %43, %39
br label %137
52: ; preds = %33
%53 = load i32*, i32** %8
%54 = getelementptr inbounds [19 x i32], [19 x i32]* %12, i64 0, i64 0
%55 = call i32 @uregex_setText(i32* %53, i32* %54, i32 -1, i64* %5)
%56 = load i64, i64* %5
%57 = call i64 @U_FAILURE(i64 %56)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %60
59: ; preds = %52
br label %137
60: ; preds = %52
br label %61
61: ; preds = %127, %60
%62 = load i32*, i32** %8
%63 = call i64 @uregex_findNext(i32* %62, i64* %5)
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %128
65: ; preds = %61
%66 = load i32*, i32** %8
%67 = call i32 @uregex_start(i32* %66, i32 0, i64* %5)
store i32 %67, i32* %3
%68 = load i64, i64* %5
%69 = call i64 @U_FAILURE(i64 %68)
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %65
br label %137
72: ; preds = %65
%73 = load i32*, i32** %8
%74 = call i32 @uregex_end(i32* %73, i32 0, i64* %5)
store i32 %74, i32* %4
%75 = load i64, i64* %5
%76 = call i64 @U_FAILURE(i64 %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %79
78: ; preds = %72
br label %137
79: ; preds = %72
%80 = load i32*, i32** %6
%81 = load i32, i32* %3
%82 = load i32, i32* %4
%83 = load i32, i32* %4
%84 = load i32, i32* %3
%85 = sub nsw i32 %83, %84
%86 = getelementptr inbounds [19 x i32], [19 x i32]* %12, i64 0, i64 0
%87 = load i32, i32* %3
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32, i32* %86, i64 %88
%90 = call i32 (i32*, i8*, i32, ...) @u_fprintf(i32* %80, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %81, i32 %82, i32 %85, i32* %89)
%91 = load i32*, i32** %8
%92 = call i32 @uregex_groupCount(i32* %91, i64* %5)
store i32 %92, i32* %15
%93 = load i64, i64* %5
%94 = call i64 @U_FAILURE(i64 %93)
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %101
96: ; preds = %79
%97 = load i32, i32* @stderr
%98 = load i64, i64* %5
%99 = call i8* @u_errorName(i64 %98)
%100 = call i32 @fprintf(i32 %97, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %99)
br label %101
101: ; preds = %96, %79
store i32 1, i32* %14
br label %102
102: ; preds = %124, %101
%103 = load i32, i32* %14
%104 = load i32, i32* %15
%105 = icmp sle i32 %103, %104
br i1 %105, label %106, label %127
106: ; preds = %102
%107 = load i32*, i32** %8
%108 = load i32, i32* %14
%109 = getelementptr inbounds [1024 x i32], [1024 x i32]* %13, i64 0, i64 0
%110 = call i32 @uregex_group(i32* %107, i32 %108, i32* %109, i32 1024, i64* %5)
store i32 %110, i32* %16
%111 = load i64, i64* %5
%112 = call i64 @U_FAILURE(i64 %111)
%113 = icmp ne i64 %112, 0
br i1 %113, label %114, label %119
114: ; preds = %106
%115 = load i32, i32* @stderr
%116 = load i64, i64* %5
%117 = call i8* @u_errorName(i64 %116)
%118 = call i32 @fprintf(i32 %115, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %117)
br label %119
119: ; preds = %114, %106
%120 = load i32*, i32** %6
%121 = load i32, i32* %14
%122 = getelementptr inbounds [1024 x i32], [1024 x i32]* %13, i64 0, i64 0
%123 = call i32 (i32*, i8*, i32, ...) @u_fprintf(i32* %120, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %121, i32* %122)
br label %124
124: ; preds = %119
%125 = load i32, i32* %14
%126 = add nsw i32 %125, 1
store i32 %126, i32* %14
br label %102
127: ; preds = %102
br label %61
128: ; preds = %61
%129 = load i64, i64* %5
%130 = call i64 @U_FAILURE(i64 %129)
%131 = icmp ne i64 %130, 0
br i1 %131, label %132, label %133
132: ; preds = %128
br label %137
133: ; preds = %128
%134 = load i64, i64* @FALSE
%135 = icmp ne i64 %134, 0
br i1 %135, label %136, label %139
136: ; preds = %133
br label %137
137: ; preds = %136, %132, %78, %71, %59, %51
%138 = load i32, i32* @EXIT_FAILURE
store i32 %138, i32* %2
br label %139
139: ; preds = %137, %133
%140 = load i32*, i32** %7
%141 = icmp ne i32* null, %140
br i1 %141, label %142, label %145
142: ; preds = %139
%143 = load i32*, i32** %7
%144 = call i32 @u_fclose(i32* %143)
br label %145
145: ; preds = %142, %139
%146 = load i32*, i32** %6
%147 = icmp ne i32* null, %146
br i1 %147, label %148, label %151
148: ; preds = %145
%149 = load i32*, i32** %6
%150 = call i32 @u_fclose(i32* %149)
br label %151
151: ; preds = %148, %145
%152 = load i32*, i32** %8
%153 = icmp ne i32* null, %152
br i1 %153, label %154, label %157
154: ; preds = %151
%155 = load i32*, i32** %8
%156 = call i32 @uregex_close(i32* %155)
br label %157
157: ; preds = %154, %151
%158 = call i32 (...) @u_cleanup()
%159 = load i32, i32* %2
ret i32 %159
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i32, i32, i32, %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_6__ = type { i32 }
%struct.TYPE_5__ = type { i32 }
@FALSE = global i64 0
@__const.main.pe = %struct.TYPE_7__ { i32 -1, i32 -1, i32 0, %struct.TYPE_6__ zeroinitializer, %struct.TYPE_5__ zeroinitializer }
@__const.main.pattern = [16 x i32] [i32 40, i32 92, i32 112, i32 123, i32 76, i32 125, i32 41, i32 40, i32 92, i32 112, i32 123, i32 78, i32 100, i32 125, i32 41, i32 0]
@__const.main.string = [19 x i32] [i32 55349, i32 56892, i32 55349, i32 56892, i32 55349, i32 57314, i32 55349, i32 56893, i32 55349, i32 56893, i32 55349, i32 57315, i32 55349, i32 56894, i32 55349, i32 56894, i32 55349, i32 57316, i32 0]
@EXIT_SUCCESS = global i32 0
@U_ZERO_ERROR = global i64 0
@stdout = global i32 0
@stderr = global i32 0
@UREGEX_CASE_INSENSITIVE = global i32 0
@U_REGEX_RULE_SYNTAX = global i64 0
@.str = [46 x i8] c"Invalid pattern: error at offset %d\0A\09%S\0A\09%*c\0A\00"
@.str.1 = [42 x i8] c"Match found at %d position (to %d): %.*S\0A\00"
@.str.2 = [41 x i8] c"ICU Error \22%s\22 from uregex_groupCount()\0A\00"
@.str.3 = [36 x i8] c"ICU Error \22%s\22 from uregex_group()\0A\00"
@.str.4 = [10 x i8] c"$%d : %S\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i64
%2 = alloca %struct.TYPE_7__
%3 = alloca [16 x i32]
%4 = alloca [19 x i32]
%5 = alloca [1024 x i32]
%6 = bitcast i64* %1 to i8*
%7 = load i64, i64* @FALSE
%8 = bitcast %struct.TYPE_7__* %2 to i8*
%9 = bitcast [16 x i32]* %3 to i8*
%10 = bitcast [19 x i32]* %4 to i8*
%11 = load i32, i32* @EXIT_SUCCESS
%12 = load i64, i64* @U_ZERO_ERROR
store i64 %12, i64* %1
%13 = load i32, i32* @stdout
%14 = tail call i32* @u_finit(i32 %13, i32* null, i32* null)
%15 = load i32, i32* @stderr
%16 = tail call i32* @u_finit(i32 %15, i32* null, i32* null)
%17 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%18 = icmp eq i64 %7, 0
%19 = load i32, i32* @UREGEX_CASE_INSENSITIVE
%20 = select i1 %18, i32 0, i32 %19
%21 = call i32* @uregex_open(i32* %17, i32 -1, i32 %20, %struct.TYPE_7__* %2, i64* %1)
%22 = load i64, i64* %1
%23 = call i64 @U_FAILURE(i64 %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %33, label %25
25: ; preds = %0
%26 = load i64, i64* @U_REGEX_RULE_SYNTAX
%27 = load i64, i64* %1
%28 = icmp eq i64 %26, %27
br i1 %28, label %29, label %96
29: ; preds = %25
%30 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %2, i64 0, i32 2
%31 = load i32, i32* %30
%32 = call i32 (i32*, i8*, i32, ...) @u_fprintf(i32* %16, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %31, i32* %17, i32 %31, i32 94)
br label %96
33: ; preds = %0
%34 = getelementptr inbounds [19 x i32], [19 x i32]* %4, i64 0, i64 0
%35 = call i32 @uregex_setText(i32* %21, i32* %34, i32 -1, i64* %1)
%36 = load i64, i64* %1
%37 = call i64 @U_FAILURE(i64 %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %96
39: ; preds = %33
%40 = call i64 @uregex_findNext(i32* %21, i64* %1)
%41 = icmp eq i64 %40, 0
br i1 %41, label %89, label %42
42: ; preds = %39
%43 = bitcast [1024 x i32]* %5 to i8*
%44 = getelementptr inbounds [1024 x i32], [1024 x i32]* %5, i64 0, i64 0
br label %45
45: ; preds = %42, %86
%46 = call i32 @uregex_start(i32* %21, i32 0, i64* %1)
%47 = load i64, i64* %1
%48 = call i64 @U_FAILURE(i64 %47)
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %96
50: ; preds = %45
%51 = call i32 @uregex_end(i32* %21, i32 0, i64* %1)
%52 = load i64, i64* %1
%53 = call i64 @U_FAILURE(i64 %52)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %96
55: ; preds = %50
%56 = sub nsw i32 %51, %46
%57 = sext i32 %46 to i64
%58 = getelementptr inbounds [19 x i32], [19 x i32]* %4, i64 0, i64 %57
%59 = call i32 (i32*, i8*, i32, ...) @u_fprintf(i32* %14, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %46, i32 %51, i32 %56, i32* %58)
%60 = call i32 @uregex_groupCount(i32* %21, i64* %1)
%61 = load i64, i64* %1
%62 = call i64 @U_FAILURE(i64 %61)
%63 = icmp eq i64 %62, 0
br i1 %63, label %69, label %64
64: ; preds = %55
%65 = load i32, i32* @stderr
%66 = load i64, i64* %1
%67 = call i8* @u_errorName(i64 %66)
%68 = call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %67)
br label %69
69: ; preds = %64, %55
%70 = icmp slt i32 %60, 1
br i1 %70, label %86, label %71
71: ; preds = %69, %82
%72 = phi i32 [ %84, %82 ], [ 1, %69 ]
%73 = call i32 @uregex_group(i32* %21, i32 %72, i32* %44, i32 1024, i64* %1)
%74 = load i64, i64* %1
%75 = call i64 @U_FAILURE(i64 %74)
%76 = icmp eq i64 %75, 0
br i1 %76, label %82, label %77
77: ; preds = %71
%78 = load i32, i32* @stderr
%79 = load i64, i64* %1
%80 = call i8* @u_errorName(i64 %79)
%81 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %80)
br label %82
82: ; preds = %77, %71
%83 = call i32 (i32*, i8*, i32, ...) @u_fprintf(i32* %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %72, i32* %44)
%84 = add nuw i32 %72, 1
%85 = icmp eq i32 %72, %60
br i1 %85, label %86, label %71
86: ; preds = %82, %69
%87 = call i64 @uregex_findNext(i32* %21, i64* %1)
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %45
89: ; preds = %86, %39
%90 = load i64, i64* %1
%91 = call i64 @U_FAILURE(i64 %90)
%92 = icmp ne i64 %91, 0
%93 = load i64, i64* @FALSE
%94 = icmp ne i64 %93, 0
%95 = select i1 %92, i1 true, i1 %94
br i1 %95, label %96, label %98
96: ; preds = %50, %45, %89, %33, %25, %29
%97 = load i32, i32* @EXIT_FAILURE
br label %98
98: ; preds = %89, %96
%99 = phi i32 [ %97, %96 ], [ %11, %89 ]
%100 = icmp eq i32* %16, null
br i1 %100, label %103, label %101
101: ; preds = %98
%102 = call i32 @u_fclose(i32* %16)
br label %103
103: ; preds = %101, %98
%104 = icmp eq i32* %14, null
br i1 %104, label %107, label %105
105: ; preds = %103
%106 = call i32 @u_fclose(i32* %14)
br label %107
107: ; preds = %105, %103
%108 = icmp eq i32* %21, null
br i1 %108, label %111, label %109
109: ; preds = %107
%110 = call i32 @uregex_close(i32* %21)
br label %111
111: ; preds = %109, %107
%112 = call i32 (...) @u_cleanup()
ret i32 %99
}