#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 BUFSIZ;
int /*<<< orphan*/ printf(char *, ...);
char *regcmp(char const *, int /*<<< orphan*/ *);
char *regex(char const *, char *, ...);
int /*<<< orphan*/ strncpy(char *, char *, int);
main(int argc, char **argv) {
  const char *wsre = "^[ \t]*";
  const char *cwsre = NULL;
  if ((cwsre = regcmp(wsre, NULL)) == NULL)
    printf("regcmp failed ...\n");
  else
    printf("regcmp succeeded ...\n");
  const char *qmre = "([\"'])$0";
  const char *cqmre = NULL;
  if ((cqmre = regcmp(qmre, NULL)) == NULL)
    printf("regcmp failed ...\n");
  else
    printf("regcmp succeeded ...\n");
  const char *conre = "[^\\\"']*([\\\"'])$0";
  const char *cconre = NULL;
  if ((cconre = regcmp(conre, NULL)) == NULL)
    printf("regcmp failed ...\n");
  else
    printf("regcmp succeeded ...\n");
  for (int arg = 1; arg < argc; arg++) {
    char *cursor = argv[arg];
    char *newcursor = NULL;
    char strval[BUFSIZ];
    char qm[BUFSIZ];
    if ((newcursor = regex(cwsre, cursor)) != NULL) {
      cursor = newcursor;
    }
    if ((newcursor = regex(cqmre, cursor, qm)) == NULL) {
      printf("NOT A STRING ... %s\n", cursor);
      continue;
    }
    char *startqm = cursor;
    char *endqm = cursor;
    cursor = newcursor;
    printf("found a >>%s<< ...\n", qm);
    int found = 0;
    for (int done = 0;
         !done && (newcursor = regex(cconre, cursor, strval)) != NULL;) {
      switch (*strval) {
      case '\\':
        if (*newcursor == '\0') {
          printf("NOT A STRING ... %s\n", startqm);
          done = 1;
          continue;
        }
        cursor = ++newcursor;
        break;
      case '"':
      case '\'':
        if (*strval == *startqm) {
          endqm = newcursor;
          strncpy(strval, startqm, endqm - startqm);
          strval[endqm - startqm] = '\0';
          printf("FOUND A STRING ... <%s>\n", strval);
          found = done = 1;
          continue;
        }
        cursor = newcursor;
        break;
      }
    }
    if (!found)
      printf("NOT A STRING ... %s\n", startqm);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea0(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <regcmp@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    119a <main+0x5a>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    11a8 <main+0x68>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe81(%rip),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <regcmp@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    11e9 <main+0xa9>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    11f7 <main+0xb7>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe3b(%rip),%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <regcmp@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1238 <main+0xf8>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1246 <main+0x106>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    152d <main+0x3ed>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    0x2d68(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x60(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xa0(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x68(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    $0x0,%al
call   1030 <regex@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
je     12e6 <main+0x1a6>
mov    -0x58(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x98(%rbp),%rdx
mov    -0x30(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    $0x0,%al
call   1030 <regex@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
jne    1328 <main+0x1e8>
mov    -0x50(%rbp),%rsi
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x4,-0x74(%rbp)
jmp    14fe <main+0x3be>
mov    -0x98(%rbp),%rsi
mov    -0x50(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    0xd0e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0x90(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x90(%rbp)
mov    %al,-0xa1(%rbp)
jne    13a8 <main+0x268>
mov    -0xa0(%rbp),%rdx
mov    -0x40(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    $0x0,%al
call   1030 <regex@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0xa1(%rbp)
mov    -0xa1(%rbp),%al
test   $0x1,%al
jne    13bb <main+0x27b>
jmp    14d8 <main+0x398>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xa8(%rbp)
sub    $0x22,%eax
je     1447 <main+0x307>
jmp    13d9 <main+0x299>
mov    -0xa8(%rbp),%eax
sub    $0x27,%eax
je     1447 <main+0x307>
jmp    13ed <main+0x2ad>
mov    -0xa8(%rbp),%eax
sub    $0x5c,%eax
jne    14d3 <main+0x393>
jmp    1401 <main+0x2c1>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1432 <main+0x2f2>
mov    -0x80(%rbp),%rsi
lea    0xc2e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x90(%rbp)
jmp    136c <main+0x22c>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    %rax,-0x50(%rbp)
jmp    14d3 <main+0x393>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
mov    -0x80(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    14cb <main+0x38b>
mov    -0xa0(%rbp),%rdi
mov    -0x58(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x80(%rbp),%rsi
mov    -0x88(%rbp),%rax
mov    -0x80(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1040 <strncpy@plt>
mov    -0xa0(%rbp),%rsi
mov    -0x88(%rbp),%rax
mov    -0x80(%rbp),%rcx
sub    %rcx,%rax
movb   $0x0,(%rsi,%rax,1)
lea    0xbc8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x90(%rbp)
movl   $0x1,-0x8c(%rbp)
jmp    136c <main+0x22c>
mov    -0x58(%rbp),%rax
mov    %rax,-0x50(%rbp)
jmp    136c <main+0x22c>
cmpl   $0x0,-0x8c(%rbp)
jne    14f7 <main+0x3b7>
mov    -0x80(%rbp),%rsi
lea    0xb5a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x74(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,%rsp
mov    -0x74(%rbp),%eax
test   %eax,%eax
je     151a <main+0x3da>
jmp    1515 <main+0x3d5>
jmp    151f <main+0x3df>
jmp    151f <main+0x3df>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    124d <main+0x10d>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,-0x60(%rbp)
mov    %edi,%r14d
lea    0xe91(%rip),%rdi
xor    %esi,%esi
call   1060 <regcmp@plt>
mov    %rax,-0x58(%rbp)
test   %rax,%rax
lea    0xef4(%rip),%r15
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
cmove  %r15,%rdi
call   1050 <puts@plt>
lea    0xe69(%rip),%rdi
xor    %esi,%esi
call   1060 <regcmp@plt>
mov    %rax,-0x50(%rbp)
test   %rax,%rax
mov    %rbx,%rdi
cmove  %r15,%rdi
call   1050 <puts@plt>
lea    0xe51(%rip),%rdi
xor    %esi,%esi
call   1060 <regcmp@plt>
mov    %rax,-0x40(%rbp)
test   %rax,%rax
cmove  %r15,%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
cmp    $0x2,%r14d
jl     1341 <main+0x1f1>
mov    %r14d,%eax
mov    %rax,-0x48(%rbp)
mov    $0x1,%ecx
jmp    123a <main+0xea>
lea    0xe29(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe0a(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
add    $0x1,%rcx
cmp    -0x48(%rbp),%rcx
je     1341 <main+0x1f1>
mov    %rsp,-0x30(%rbp)
mov    -0x60(%rbp),%rax
mov    %rcx,-0x38(%rbp)
mov    (%rax,%rcx,8),%r15
mov    0x2d8f(%rip),%rcx
mov    (%rcx),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    (%rcx),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x58(%rbp),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <regex@plt>
mov    %rax,%r14
test   %rax,%rax
cmove  %r15,%r14
mov    -0x50(%rbp),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <regex@plt>
test   %rax,%rax
je     1210 <main+0xc0>
mov    %rax,%r12
lea    0xd83(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x40(%rbp),%rbx
jmp    12d8 <main+0x188>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    (%r14),%al
je     131b <main+0x1cb>
mov    %r15,%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <regex@plt>
mov    %rax,%r15
test   %rax,%rax
je     1210 <main+0xc0>
movzbl 0x0(%r13),%eax
movsbl %al,%ecx
cmp    $0x22,%ecx
je     12d0 <main+0x180>
cmp    $0x27,%ecx
je     12d0 <main+0x180>
cmp    $0x5c,%ecx
jne    12d8 <main+0x188>
cmpb   $0x0,(%r15)
je     11f1 <main+0xa1>
add    $0x1,%r15
jmp    12d5 <main+0x185>
sub    %r14,%r15
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <strncpy@plt>
movb   $0x0,0x0(%r13,%r15,1)
lea    0xd11(%rip),%rdi
mov    %r13,%rsi
jmp    121a <main+0xca>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"^[ \09]*\00"
@.str.1 = [19 x i8] c"regcmp failed ...\0A\00"
@.str.2 = [22 x i8] c"regcmp succeeded ...\0A\00"
@.str.3 = [9 x i8] c"([\22'])$0\00"
@.str.4 = [17 x i8] c"[^\\\22']*([\\\22'])$0\00"
@BUFSIZ = global i32 0
@.str.5 = [21 x i8] c"NOT A STRING ... %s\0A\00"
@.str.6 = [20 x i8] c"found a >>%s<< ...\0A\00"
@.str.7 = [25 x i8] c"FOUND A STRING ... <%s>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i64
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i32
%22 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* null, i8** %7
%23 = load i8*, i8** %6
%24 = call i8* @regcmp(i8* %23, i32* null)
store i8* %24, i8** %7
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %28
26: ; preds = %2
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %30
28: ; preds = %2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %8
store i8* null, i8** %9
%31 = load i8*, i8** %8
%32 = call i8* @regcmp(i8* %31, i32* null)
store i8* %32, i8** %9
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %38
36: ; preds = %30
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %38
38: ; preds = %36, %34
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8** %10
store i8* null, i8** %11
%39 = load i8*, i8** %10
%40 = call i8* @regcmp(i8* %39, i32* null)
store i8* %40, i8** %11
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %46
44: ; preds = %38
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %46
46: ; preds = %44, %42
store i32 1, i32* %12
br label %47
47: ; preds = %145, %46
%48 = load i32, i32* %12
%49 = load i32, i32* %4
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %148
51: ; preds = %47
%52 = load i8**, i8*** %5
%53 = load i32, i32* %12
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %52, i64 %54
%56 = load i8*, i8** %55
store i8* %56, i8** %13
store i8* null, i8** %14
%57 = load i32, i32* @BUFSIZ
%58 = zext i32 %57 to i64
%59 = call i8* @llvm.stacksave()
store i8* %59, i8** %15
%60 = alloca i8, i64 %58
store i64 %58, i64* %16
%61 = load i32, i32* @BUFSIZ
%62 = zext i32 %61 to i64
%63 = alloca i8, i64 %62
store i64 %62, i64* %17
%64 = load i8*, i8** %7
%65 = load i8*, i8** %13
%66 = call i8* (i8*, i8*, ...) @regex(i8* %64, i8* %65)
store i8* %66, i8** %14
%67 = icmp ne i8* %66, null
br i1 %67, label %68, label %70
68: ; preds = %51
%69 = load i8*, i8** %14
store i8* %69, i8** %13
br label %70
70: ; preds = %68, %51
%71 = load i8*, i8** %9
%72 = load i8*, i8** %13
%73 = call i8* (i8*, i8*, ...) @regex(i8* %71, i8* %72, i8* %63)
store i8* %73, i8** %14
%74 = icmp eq i8* %73, null
br i1 %74, label %75, label %78
75: ; preds = %70
%76 = load i8*, i8** %13
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %76)
store i32 4, i32* %18
br label %141
78: ; preds = %70
%79 = load i8*, i8** %13
store i8* %79, i8** %19
%80 = load i8*, i8** %13
store i8* %80, i8** %20
%81 = load i8*, i8** %14
store i8* %81, i8** %13
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %63)
store i32 0, i32* %21
store i32 0, i32* %22
br label %83
83: ; preds = %133, %114, %101, %78
%84 = load i32, i32* %22
%85 = icmp ne i32 %84, 0
br i1 %85, label %91, label %86
86: ; preds = %83
%87 = load i8*, i8** %11
%88 = load i8*, i8** %13
%89 = call i8* (i8*, i8*, ...) @regex(i8* %87, i8* %88, i8* %60)
store i8* %89, i8** %14
%90 = icmp ne i8* %89, null
br label %91
91: ; preds = %86, %83
%92 = phi i1 [ false, %83 ], [ %90, %86 ]
br i1 %92, label %93, label %134
93: ; preds = %91
%94 = load i8, i8* %60
%95 = sext i8 %94 to i32
switch i32 %95, label %133 [
i32 92, label %96
i32 34, label %107
i32 39, label %107
]
96: ; preds = %93
%97 = load i8*, i8** %14
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %104
101: ; preds = %96
%102 = load i8*, i8** %19
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %102)
store i32 1, i32* %22
br label %83
104: ; preds = %96
%105 = load i8*, i8** %14
%106 = getelementptr inbounds i8, i8* %105, i32 1
store i8* %106, i8** %14
store i8* %106, i8** %13
br label %133
107: ; preds = %93, %93
%108 = load i8, i8* %60
%109 = sext i8 %108 to i32
%110 = load i8*, i8** %19
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %109, %112
br i1 %113, label %114, label %131
114: ; preds = %107
%115 = load i8*, i8** %14
store i8* %115, i8** %20
%116 = load i8*, i8** %19
%117 = load i8*, i8** %20
%118 = load i8*, i8** %19
%119 = ptrtoint i8* %117 to i64
%120 = ptrtoint i8* %118 to i64
%121 = sub i64 %119, %120
%122 = trunc i64 %121 to i32
%123 = call i32 @strncpy(i8* %60, i8* %116, i32 %122)
%124 = load i8*, i8** %20
%125 = load i8*, i8** %19
%126 = ptrtoint i8* %124 to i64
%127 = ptrtoint i8* %125 to i64
%128 = sub i64 %126, %127
%129 = getelementptr inbounds i8, i8* %60, i64 %128
store i8 0, i8* %129
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %60)
store i32 1, i32* %22
store i32 1, i32* %21
br label %83
131: ; preds = %107
%132 = load i8*, i8** %14
store i8* %132, i8** %13
br label %133
133: ; preds = %93, %131, %104
br label %83
134: ; preds = %91
%135 = load i32, i32* %21
%136 = icmp ne i32 %135, 0
br i1 %136, label %140, label %137
137: ; preds = %134
%138 = load i8*, i8** %19
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %138)
br label %140
140: ; preds = %137, %134
store i32 0, i32* %18
br label %141
141: ; preds = %140, %75
%142 = load i8*, i8** %15
%143 = load i32, i32* %18
switch i32 %143, label %149 [
i32 0, label %144
i32 4, label %145
]
144: ; preds = %141
br label %145
145: ; preds = %144, %141
%146 = load i32, i32* %12
%147 = add nsw i32 %146, 1
store i32 %147, i32* %12
br label %47
148: ; preds = %47
ret i32 0
149: ; preds = %141
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"^[ \09]*\00"
@.str.3 = [9 x i8] c"([\22'])$0\00"
@.str.4 = [17 x i8] c"[^\\\22']*([\\\22'])$0\00"
@BUFSIZ = global i32 0
@.str.5 = [21 x i8] c"NOT A STRING ... %s\0A\00"
@.str.6 = [20 x i8] c"found a >>%s<< ...\0A\00"
@.str.7 = [25 x i8] c"FOUND A STRING ... <%s>\0A\00"
@str.9 = [21 x i8] c"regcmp succeeded ...\00"
@str.12 = [18 x i8] c"regcmp failed ...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i8* @regcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* null)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i8* @regcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32* null)
%8 = icmp eq i8* %7, null
%9 = select i1 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = tail call i8* @regcmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32* null)
%12 = icmp eq i8* %11, null
%13 = select i1 %12, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0)
%14 = tail call i32 @puts(i8* dereferenceable(1) %13)
%15 = icmp sgt i32 %0, 1
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = zext i32 %0 to i64
br label %19
18: ; preds = %70, %2
ret i32 0
19: ; preds = %16, %70
%20 = phi i64 [ 1, %16 ], [ %71, %70 ]
%21 = getelementptr inbounds i8*, i8** %1, i64 %20
%22 = load i8*, i8** %21
%23 = load i32, i32* @BUFSIZ
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
%26 = alloca i8, i64 %24
%27 = load i32, i32* @BUFSIZ
%28 = zext i32 %27 to i64
%29 = alloca i8, i64 %28
%30 = call i8* (i8*, i8*, ...) @regex(i8* %3, i8* %22)
%31 = icmp eq i8* %30, null
%32 = select i1 %31, i8* %22, i8* %30
%33 = call i8* (i8*, i8*, ...) @regex(i8* %7, i8* %32, i8* %29)
%34 = icmp eq i8* %33, null
br i1 %34, label %35, label %37
35: ; preds = %19
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %32)
br label %70
37: ; preds = %19
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %29)
%39 = ptrtoint i8* %32 to i64
%40 = call i8* (i8*, i8*, ...) @regex(i8* %11, i8* %33, i8* %26)
%41 = icmp eq i8* %40, null
br i1 %41, label %68, label %49
42: ; preds = %61
%43 = ptrtoint i8* %50 to i64
%44 = sub i64 %43, %39
%45 = trunc i64 %44 to i32
%46 = call i32 @strncpy(i8* %26, i8* %32, i32 %45)
%47 = getelementptr inbounds i8, i8* %26, i64 %44
store i8 0, i8* %47
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %26)
br label %70
49: ; preds = %37, %64
%50 = phi i8* [ %66, %64 ], [ %40, %37 ]
%51 = phi i8* [ %65, %64 ], [ %33, %37 ]
%52 = load i8, i8* %26
%53 = sext i8 %52 to i32
switch i32 %53, label %64 [
i32 92, label %54
i32 34, label %61
i32 39, label %61
]
54: ; preds = %49
%55 = load i8, i8* %50
%56 = icmp eq i8 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %32)
br label %68
59: ; preds = %54
%60 = getelementptr inbounds i8, i8* %50, i64 1
br label %64
61: ; preds = %49, %49
%62 = load i8, i8* %32
%63 = icmp eq i8 %52, %62
br i1 %63, label %42, label %64
64: ; preds = %49, %61, %59
%65 = phi i8* [ %60, %59 ], [ %51, %49 ], [ %50, %61 ]
%66 = call i8* (i8*, i8*, ...) @regex(i8* %11, i8* %65, i8* %26)
%67 = icmp eq i8* %66, null
br i1 %67, label %68, label %49
68: ; preds = %64, %37, %57
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %32)
br label %70
70: ; preds = %42, %68, %35
%71 = add nuw nsw i64 %20, 1
%72 = icmp eq i64 %71, %17
br i1 %72, label %18, label %19
}