#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 */
typedef int /*<<< orphan*/ s;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memmove(char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcat(char *, char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
char *strstr(char *, char *);
int main(int argc, char **argv) {
  char s[1024];
  char fmt[20];
  char *p;
  int inside_trace = 0;
  FILE *f = fopen(argv[1], "r");
  int n;
  while (fgets(s, sizeof(s), f)) {
    if (!inside_trace && strstr(s, "TRACE_MSG")) {
      inside_trace = 1;
    }
    if (inside_trace && (p = strstr(s, "(FL, "))) {
      memmove(p, p + 5, strlen(p + 5) + 1);
    }
    if (inside_trace && (p = strchr(s, '\"'))) {
      n = 0;
      p++;
      strcpy(fmt, "FMT_");
      while (*p != '\"') {
        if (*p == '%') {
          p++;
          switch (*p) {
          case 'h':
            strcat(fmt, "_H");
            p++;
            n++;
            break;
          case 'l':
            strcat(fmt, "_L");
            p++;
            n += 4;
            break;
          case 'u':
          case 'd':
          case 'i':
          case 'x':
            strcat(fmt, "_D");
            n += 2;
            break;
          case 'p':
            strcat(fmt, "_P");
            n += 3;
            break;
          case 'c':
            strcat(fmt, "_C");
            n++;
            break;
          }
        }
        p++;
        if (!strncmp(p, "\" TRACE_FORMAT_64,", 18)) {
          strcat(fmt, "_A");
          p += 16;
          n += 8;
          break;
        } else if (!strncmp(p, "\" TRACE_FORMAT_64 \"", 19)) {
          strcat(fmt, "_A");
          p += 19;
          n += 8;
        }
      }
      if (!strcmp(fmt, "FMT_")) {
        strcat(fmt, "_0");
      }
      fprintf(stderr, "#define %s\t\t%d\n", fmt, n);
      p++;
      memmove(p + strlen(fmt) + 3, p, strlen(p) + 1);
      *p++ = ',';
      *p++ = ' ';
      *p++ = '(';
      memcpy(p, fmt, strlen(fmt));
    }
    if (inside_trace && strchr(s, ';')) {
      inside_trace = 0;
    }
    fputs(s, stdout);
    *s = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x490,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x43c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe56(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x448(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x448(%rbp),%rdx
mov    $0x400,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     16fc <main+0x52c>
cmpl   $0x0,-0x43c(%rbp)
jne    1264 <main+0x94>
lea    -0x410(%rbp),%rdi
lea    0xe0f(%rip),%rsi
call   10f0 <strstr@plt>
cmp    $0x0,%rax
je     1264 <main+0x94>
movl   $0x1,-0x43c(%rbp)
cmpl   $0x0,-0x43c(%rbp)
je     12dd <main+0x10d>
lea    -0x410(%rbp),%rdi
lea    0xde5(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x438(%rbp)
cmp    $0x0,%rax
je     12dd <main+0x10d>
mov    -0x438(%rbp),%rax
mov    %rax,-0x460(%rbp)
mov    -0x438(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x458(%rbp)
mov    -0x438(%rbp),%rdi
add    $0x5,%rdi
call   1050 <strlen@plt>
mov    -0x460(%rbp),%rdi
mov    -0x458(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   10c0 <memmove@plt>
cmpl   $0x0,-0x43c(%rbp)
je     16a9 <main+0x4d9>
lea    -0x410(%rbp),%rdi
mov    $0x22,%esi
call   1060 <strchr@plt>
mov    %rax,-0x438(%rbp)
cmp    $0x0,%rax
je     16a9 <main+0x4d9>
movl   $0x0,-0x44c(%rbp)
mov    -0x438(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x438(%rbp)
lea    -0x430(%rbp),%rdi
lea    0xd34(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x438(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     155b <main+0x38b>
mov    -0x438(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    1490 <main+0x2c0>
mov    -0x438(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x438(%rbp)
mov    -0x438(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffff9d,%eax
mov    %eax,%ecx
mov    %rcx,-0x468(%rbp)
sub    $0x15,%eax
ja     148b <main+0x2bb>
mov    -0x468(%rbp),%rax
lea    0xc60(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x430(%rbp),%rdi
lea    0xcb8(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x438(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x438(%rbp)
mov    -0x44c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44c(%rbp)
jmp    148b <main+0x2bb>
lea    -0x430(%rbp),%rdi
lea    0xc82(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x438(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x438(%rbp)
mov    -0x44c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x44c(%rbp)
jmp    148b <main+0x2bb>
lea    -0x430(%rbp),%rdi
lea    0xc4c(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x44c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x44c(%rbp)
jmp    148b <main+0x2bb>
lea    -0x430(%rbp),%rdi
lea    0xc28(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x44c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x44c(%rbp)
jmp    148b <main+0x2bb>
lea    -0x430(%rbp),%rdi
lea    0xc04(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x44c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44c(%rbp)
jmp    1490 <main+0x2c0>
mov    -0x438(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x438(%rbp)
mov    -0x438(%rbp),%rdi
lea    0xbce(%rip),%rsi
mov    $0x12,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    14fc <main+0x32c>
lea    -0x430(%rbp),%rdi
lea    0xbc0(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x438(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x438(%rbp)
mov    -0x44c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x44c(%rbp)
jmp    155b <main+0x38b>
mov    -0x438(%rbp),%rdi
lea    0xb8a(%rip),%rsi
mov    $0x13,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1551 <main+0x381>
lea    -0x430(%rbp),%rdi
lea    0xb66(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x438(%rbp),%rax
add    $0x13,%rax
mov    %rax,-0x438(%rbp)
mov    -0x44c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x44c(%rbp)
jmp    1556 <main+0x386>
jmp    133b <main+0x16b>
lea    -0x430(%rbp),%rdi
lea    0xb01(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    158a <main+0x3ba>
lea    -0x430(%rbp),%rdi
lea    0xb23(%rip),%rsi
call   10e0 <strcat@plt>
mov    0x2a4f(%rip),%rax
mov    (%rax),%edi
lea    -0x430(%rbp),%rdx
mov    -0x44c(%rbp),%ecx
lea    0xb04(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x438(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x438(%rbp)
mov    -0x438(%rbp),%rax
mov    %rax,-0x490(%rbp)
lea    -0x430(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x490(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x3,%rax
mov    %rax,-0x488(%rbp)
mov    -0x438(%rbp),%rax
mov    %rax,-0x480(%rbp)
mov    -0x438(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x488(%rbp),%rdi
mov    -0x480(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   10c0 <memmove@plt>
mov    -0x438(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x438(%rbp)
movb   $0x2c,(%rax)
mov    -0x438(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x438(%rbp)
movb   $0x20,(%rax)
mov    -0x438(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x438(%rbp)
movb   $0x28,(%rax)
mov    -0x438(%rbp),%rax
mov    %rax,-0x478(%rbp)
lea    -0x430(%rbp),%rax
mov    %rax,-0x470(%rbp)
lea    -0x430(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x478(%rbp),%rdi
mov    -0x470(%rbp),%rsi
mov    %eax,%edx
call   10b0 <memcpy@plt>
cmpl   $0x0,-0x43c(%rbp)
je     16db <main+0x50b>
lea    -0x410(%rbp),%rdi
mov    $0x3b,%esi
call   1060 <strchr@plt>
cmp    $0x0,%rax
je     16db <main+0x50b>
movl   $0x0,-0x43c(%rbp)
lea    -0x410(%rbp),%rdi
mov    0x28ef(%rip),%rax
mov    (%rax),%esi
call   1070 <fputs@plt>
movb   $0x0,-0x410(%rbp)
jmp    120e <main+0x3e>
xor    %eax,%eax
add    $0x490,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
mov    0x8(%rsi),%rdi
lea    0xe7c(%rip),%rsi
call   10c0 <fopen@plt>
lea    0x30(%rsp),%rdi
mov    $0x400,%esi
mov    %rax,0x8(%rsp)
mov    %rax,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     14dd <main+0x31d>
xor    %ebx,%ebx
lea    0x30(%rsp),%r13
lea    0x10(%rsp),%r15
lea    0xe6a(%rip),%r14
jmp    12db <main+0x11b>
nopl   0x0(%rax)
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
lea    0xe7b(%rip),%rsi
mov    %r15,%rdx
mov    %r13d,%ecx
call   1090 <fprintf@plt>
lea    0x1(%r12),%rbx
mov    %r15,%rdi
call   1050 <strlen@plt>
cltq
lea    0x4(%r12),%r13
lea    (%r12,%rax,1),%rbp
add    $0x4,%rbp
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10b0 <memmove@plt>
movw   $0x202c,0x1(%r12)
20
movb   $0x28,0x3(%r12)
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   10a0 <memcpy@plt>
lea    0x30(%rsp),%r13
mov    %r13,%rdi
mov    $0x3b,%esi
call   1060 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    0x2d27(%rip),%rax
mov    (%rax),%esi
mov    %r13,%rdi
call   1070 <fputs@plt>
movb   $0x0,0x30(%rsp)
mov    %r13,%rdi
mov    $0x400,%esi
mov    0x8(%rsp),%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     14dd <main+0x31d>
test   %ebx,%ebx
jne    12f7 <main+0x137>
mov    %r13,%rdi
lea    0xd71(%rip),%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
je     14d6 <main+0x316>
mov    %r13,%rdi
lea    0xd63(%rip),%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
je     132b <main+0x16b>
mov    %rax,%rbp
mov    %rax,%rbx
add    $0x5,%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10b0 <memmove@plt>
mov    %r13,%rdi
mov    $0x22,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1295 <main+0xd5>
mov    %rax,%r12
add    $0x1,%r12
mov    %r15,%rdi
lea    0xd18(%rip),%rsi
call   1040 <strcpy@plt>
xor    %r13d,%r13d
lea    0xc9f(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r12),%eax
cmp    $0x25,%al
je     1390 <main+0x1d0>
cmp    $0x22,%al
je     14aa <main+0x2ea>
mov    %r12,%rbx
jmp    1430 <main+0x270>
nopl   0x0(%rax)
lea    0x1(%r12),%rbx
movsbl 0x1(%r12),%eax
add    $0xffffff9d,%eax
cmp    $0x15,%eax
ja     1430 <main+0x270>
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
mov    %r15,%rdi
lea    0xcba(%rip),%rsi
call   10d0 <strcat@plt>
add    $0x2,%r13d
jmp    1430 <main+0x270>
mov    %r15,%rdi
lea    0xcab(%rip),%rsi
call   10d0 <strcat@plt>
add    $0x1,%r13d
jmp    1430 <main+0x270>
mov    %r15,%rdi
lea    0xc8a(%rip),%rsi
call   10d0 <strcat@plt>
add    $0x2,%r12
add    $0x1,%r13d
mov    %r12,%rbx
jmp    1430 <main+0x270>
mov    %r15,%rdi
lea    0xc71(%rip),%rsi
call   10d0 <strcat@plt>
add    $0x2,%r12
add    $0x4,%r13d
mov    %r12,%rbx
jmp    1430 <main+0x270>
mov    %r15,%rdi
lea    0xc5b(%rip),%rsi
call   10d0 <strcat@plt>
add    $0x3,%r13d
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%rbx),%r12
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x12,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1490 <main+0x2d0>
mov    %r12,%rdi
lea    0xc42(%rip),%rsi
mov    $0x13,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1370 <main+0x1b0>
mov    %r15,%rdi
lea    0xc23(%rip),%rsi
call   10d0 <strcat@plt>
add    $0x14,%rbx
add    $0x8,%r13d
mov    %rbx,%r12
jmp    1370 <main+0x1b0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
lea    0xbf7(%rip),%rsi
call   10d0 <strcat@plt>
add    $0x11,%rbx
add    $0x8,%r13d
mov    %rbx,%r12
mov    0x10(%rsp),%eax
mov    $0x5f544d46,%ecx
xor    %ecx,%eax
movzbl 0x14(%rsp),%ecx
or     %eax,%ecx
jne    1220 <main+0x60>
mov    %r15,%rdi
lea    0xbdc(%rip),%rsi
call   10d0 <strcat@plt>
jmp    1220 <main+0x60>
xor    %ebx,%ebx
jmp    12aa <main+0xea>
xor    %eax,%eax
add    $0x438,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [10 x i8] c"TRACE_MSG\00"
@.str.2 = [6 x i8] c"(FL, \00"
@.str.3 = [5 x i8] c"FMT_\00"
@.str.4 = [3 x i8] c"_H\00"
@.str.5 = [3 x i8] c"_L\00"
@.str.6 = [3 x i8] c"_D\00"
@.str.7 = [3 x i8] c"_P\00"
@.str.8 = [3 x i8] c"_C\00"
@.str.9 = [19 x i8] c"\22 TRACE_FORMAT_64,\00"
@.str.10 = [3 x i8] c"_A\00"
@.str.11 = [20 x i8] c"\22 TRACE_FORMAT_64 \22\00"
@.str.12 = [3 x i8] c"_0\00"
@stderr = global i32 0
@.str.13 = [16 x i8] c"#define %s\09\09%d\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca [20 x i8]
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %15, i32** %10
br label %16
16: ; preds = %173, %2
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%18 = load i32*, i32** %10
%19 = call i64 @fgets(i8* %17, i32 1024, i32* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %178
21: ; preds = %16
%22 = load i32, i32* %9
%23 = icmp ne i32 %22, 0
br i1 %23, label %29, label %24
24: ; preds = %21
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%26 = call i8* @strstr(i8* %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %29
28: ; preds = %24
store i32 1, i32* %9
br label %29
29: ; preds = %28, %24, %21
%30 = load i32, i32* %9
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %45
32: ; preds = %29
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%34 = call i8* @strstr(i8* %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i8* %34, i8** %8
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %45
36: ; preds = %32
%37 = load i8*, i8** %8
%38 = load i8*, i8** %8
%39 = getelementptr inbounds i8, i8* %38, i64 5
%40 = load i8*, i8** %8
%41 = getelementptr inbounds i8, i8* %40, i64 5
%42 = call i32 @strlen(i8* %41)
%43 = add nsw i32 %42, 1
%44 = call i32 @memmove(i8* %37, i8* %39, i32 %43)
br label %45
45: ; preds = %36, %32, %29
%46 = load i32, i32* %9
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %165
48: ; preds = %45
%49 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%50 = call i8* @strchr(i8* %49, i8 signext 34)
store i8* %50, i8** %8
%51 = icmp ne i8* %50, null
br i1 %51, label %52, label %165
52: ; preds = %48
store i32 0, i32* %11
%53 = load i8*, i8** %8
%54 = getelementptr inbounds i8, i8* %53, i32 1
store i8* %54, i8** %8
%55 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%56 = call i32 @strcpy(i8* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %57
57: ; preds = %128, %52
%58 = load i8*, i8** %8
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp ne i32 %60, 34
br i1 %61, label %62, label %129
62: ; preds = %57
%63 = load i8*, i8** %8
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 37
br i1 %66, label %67, label %103
67: ; preds = %62
%68 = load i8*, i8** %8
%69 = getelementptr inbounds i8, i8* %68, i32 1
store i8* %69, i8** %8
%70 = load i8*, i8** %8
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
switch i32 %72, label %102 [
i32 104, label %73
i32 108, label %80
i32 117, label %87
i32 100, label %87
i32 105, label %87
i32 120, label %87
i32 112, label %92
i32 99, label %97
]
73: ; preds = %67
%74 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%75 = call i32 @strcat(i8* %74, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%76 = load i8*, i8** %8
%77 = getelementptr inbounds i8, i8* %76, i32 1
store i8* %77, i8** %8
%78 = load i32, i32* %11
%79 = add nsw i32 %78, 1
store i32 %79, i32* %11
br label %102
80: ; preds = %67
%81 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%82 = call i32 @strcat(i8* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%83 = load i8*, i8** %8
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %8
%85 = load i32, i32* %11
%86 = add nsw i32 %85, 4
store i32 %86, i32* %11
br label %102
87: ; preds = %67, %67, %67, %67
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%89 = call i32 @strcat(i8* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%90 = load i32, i32* %11
%91 = add nsw i32 %90, 2
store i32 %91, i32* %11
br label %102
92: ; preds = %67
%93 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%94 = call i32 @strcat(i8* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%95 = load i32, i32* %11
%96 = add nsw i32 %95, 3
store i32 %96, i32* %11
br label %102
97: ; preds = %67
%98 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%99 = call i32 @strcat(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%100 = load i32, i32* %11
%101 = add nsw i32 %100, 1
store i32 %101, i32* %11
br label %102
102: ; preds = %67, %97, %92, %87, %80, %73
br label %103
103: ; preds = %102, %62
%104 = load i8*, i8** %8
%105 = getelementptr inbounds i8, i8* %104, i32 1
store i8* %105, i8** %8
%106 = load i8*, i8** %8
%107 = call i32 @strncmp(i8* %106, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 18)
%108 = icmp ne i32 %107, 0
br i1 %108, label %116, label %109
109: ; preds = %103
%110 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%111 = call i32 @strcat(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%112 = load i8*, i8** %8
%113 = getelementptr inbounds i8, i8* %112, i64 16
store i8* %113, i8** %8
%114 = load i32, i32* %11
%115 = add nsw i32 %114, 8
store i32 %115, i32* %11
br label %129
116: ; preds = %103
%117 = load i8*, i8** %8
%118 = call i32 @strncmp(i8* %117, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 19)
%119 = icmp ne i32 %118, 0
br i1 %119, label %127, label %120
120: ; preds = %116
%121 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%122 = call i32 @strcat(i8* %121, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%123 = load i8*, i8** %8
%124 = getelementptr inbounds i8, i8* %123, i64 19
store i8* %124, i8** %8
%125 = load i32, i32* %11
%126 = add nsw i32 %125, 8
store i32 %126, i32* %11
br label %127
127: ; preds = %120, %116
br label %128
128: ; preds = %127
br label %57
129: ; preds = %109, %57
%130 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%131 = call i32 @strcmp(i8* %130, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%132 = icmp ne i32 %131, 0
br i1 %132, label %136, label %133
133: ; preds = %129
%134 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%135 = call i32 @strcat(i8* %134, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %136
136: ; preds = %133, %129
%137 = load i32, i32* @stderr
%138 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%139 = load i32, i32* %11
%140 = call i32 @fprintf(i32 %137, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i8* %138, i32 %139)
%141 = load i8*, i8** %8
%142 = getelementptr inbounds i8, i8* %141, i32 1
store i8* %142, i8** %8
%143 = load i8*, i8** %8
%144 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%145 = call i32 @strlen(i8* %144)
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i8, i8* %143, i64 %146
%148 = getelementptr inbounds i8, i8* %147, i64 3
%149 = load i8*, i8** %8
%150 = load i8*, i8** %8
%151 = call i32 @strlen(i8* %150)
%152 = add nsw i32 %151, 1
%153 = call i32 @memmove(i8* %148, i8* %149, i32 %152)
%154 = load i8*, i8** %8
%155 = getelementptr inbounds i8, i8* %154, i32 1
store i8* %155, i8** %8
store i8 44, i8* %154
%156 = load i8*, i8** %8
%157 = getelementptr inbounds i8, i8* %156, i32 1
store i8* %157, i8** %8
store i8 32, i8* %156
%158 = load i8*, i8** %8
%159 = getelementptr inbounds i8, i8* %158, i32 1
store i8* %159, i8** %8
store i8 40, i8* %158
%160 = load i8*, i8** %8
%161 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%162 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%163 = call i32 @strlen(i8* %162)
%164 = call i32 @memcpy(i8* %160, i8* %161, i32 %163)
br label %165
165: ; preds = %136, %48, %45
%166 = load i32, i32* %9
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %173
168: ; preds = %165
%169 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%170 = call i8* @strchr(i8* %169, i8 signext 59)
%171 = icmp ne i8* %170, null
br i1 %171, label %172, label %173
172: ; preds = %168
store i32 0, i32* %9
br label %173
173: ; preds = %172, %168, %165
%174 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%175 = load i32, i32* @stdout
%176 = call i32 @fputs(i8* %174, i32 %175)
%177 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
store i8 0, i8* %177
br label %16
178: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [10 x i8] c"TRACE_MSG\00"
@.str.2 = [6 x i8] c"(FL, \00"
@.str.3 = [5 x i8] c"FMT_\00"
@.str.4 = [3 x i8] c"_H\00"
@.str.5 = [3 x i8] c"_L\00"
@.str.6 = [3 x i8] c"_D\00"
@.str.7 = [3 x i8] c"_P\00"
@.str.8 = [3 x i8] c"_C\00"
@.str.9 = [19 x i8] c"\22 TRACE_FORMAT_64,\00"
@.str.10 = [3 x i8] c"_A\00"
@.str.11 = [20 x i8] c"\22 TRACE_FORMAT_64 \22\00"
@.str.12 = [3 x i8] c"_0\00"
@stderr = global i32 0
@.str.13 = [16 x i8] c"#define %s\09\09%d\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = call i64 @fgets(i8* %5, i32 1024, i32* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %110, label %12
12: ; preds = %2, %104
%13 = phi i32 [ %105, %104 ], [ 0, %2 ]
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i8* %16, null
br i1 %17, label %104, label %18
18: ; preds = %12, %15
%19 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i8* %19, null
br i1 %20, label %26, label %21
21: ; preds = %18
%22 = getelementptr inbounds i8, i8* %19, i64 5
%23 = call i32 @strlen(i8* %22)
%24 = add nsw i32 %23, 1
%25 = call i32 @memmove(i8* %19, i8* %22, i32 %24)
br label %26
26: ; preds = %18, %21
%27 = call i8* @strchr(i8* %5, i8 signext 34)
%28 = icmp eq i8* %27, null
br i1 %28, label %100, label %29
29: ; preds = %26
%30 = getelementptr inbounds i8, i8* %27, i64 1
%31 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %70, %29
%33 = phi i8* [ %30, %29 ], [ %71, %70 ]
%34 = phi i32 [ 0, %29 ], [ %72, %70 ]
%35 = load i8, i8* %33
switch i8 %35, label %57 [
i8 34, label %77
i8 37, label %36
]
36: ; preds = %32
%37 = getelementptr inbounds i8, i8* %33, i64 1
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
switch i32 %39, label %57 [
i32 104, label %40
i32 108, label %44
i32 117, label %48
i32 100, label %48
i32 105, label %48
i32 120, label %48
i32 112, label %51
i32 99, label %54
]
40: ; preds = %36
%41 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%42 = getelementptr inbounds i8, i8* %33, i64 2
%43 = add nsw i32 %34, 1
br label %57
44: ; preds = %36
%45 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%46 = getelementptr inbounds i8, i8* %33, i64 2
%47 = add nsw i32 %34, 4
br label %57
48: ; preds = %36, %36, %36, %36
%49 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%50 = add nsw i32 %34, 2
br label %57
51: ; preds = %36
%52 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%53 = add nsw i32 %34, 3
br label %57
54: ; preds = %36
%55 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%56 = add nsw i32 %34, 1
br label %57
57: ; preds = %32, %40, %44, %48, %51, %54, %36
%58 = phi i8* [ %37, %36 ], [ %37, %54 ], [ %37, %51 ], [ %37, %48 ], [ %46, %44 ], [ %42, %40 ], [ %33, %32 ]
%59 = phi i32 [ %34, %36 ], [ %56, %54 ], [ %53, %51 ], [ %50, %48 ], [ %47, %44 ], [ %43, %40 ], [ %34, %32 ]
%60 = getelementptr inbounds i8, i8* %58, i64 1
%61 = call i32 @strncmp(i8* %60, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 18)
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %67
63: ; preds = %57
%64 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%65 = getelementptr inbounds i8, i8* %58, i64 17
%66 = add nsw i32 %59, 8
br label %77
67: ; preds = %57
%68 = call i32 @strncmp(i8* %60, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 19)
%69 = icmp eq i32 %68, 0
br i1 %69, label %73, label %70
70: ; preds = %67, %73
%71 = phi i8* [ %60, %67 ], [ %75, %73 ]
%72 = phi i32 [ %59, %67 ], [ %76, %73 ]
br label %32
73: ; preds = %67
%74 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%75 = getelementptr inbounds i8, i8* %58, i64 20
%76 = add nsw i32 %59, 8
br label %70
77: ; preds = %32, %63
%78 = phi i8* [ %65, %63 ], [ %33, %32 ]
%79 = phi i32 [ %66, %63 ], [ %34, %32 ]
%80 = call i32 @bcmp(i8* dereferenceable(5) %6, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 5)
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %84
82: ; preds = %77
%83 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %84
84: ; preds = %77, %82
%85 = load i32, i32* @stderr
%86 = call i32 @fprintf(i32 %85, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i8* %6, i32 %79)
%87 = getelementptr inbounds i8, i8* %78, i64 1
%88 = call i32 @strlen(i8* %6)
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %78, i64 4
%91 = getelementptr inbounds i8, i8* %90, i64 %89
%92 = call i32 @strlen(i8* %87)
%93 = add nsw i32 %92, 1
%94 = call i32 @memmove(i8* %91, i8* %87, i32 %93)
%95 = getelementptr inbounds i8, i8* %78, i64 2
store i8 44, i8* %87
%96 = getelementptr inbounds i8, i8* %78, i64 3
store i8 32, i8* %95
%97 = getelementptr inbounds i8, i8* %78, i64 4
store i8 40, i8* %96
%98 = call i32 @strlen(i8* %6)
%99 = call i32 @memcpy(i8* %97, i8* %6, i32 %98)
br label %100
100: ; preds = %84, %26
%101 = call i8* @strchr(i8* %5, i8 signext 59)
%102 = icmp eq i8* %101, null
%103 = zext i1 %102 to i32
br label %104
104: ; preds = %100, %15
%105 = phi i32 [ %103, %100 ], [ 0, %15 ]
%106 = load i32, i32* @stdout
%107 = call i32 @fputs(i8* %5, i32 %106)
store i8 0, i8* %5
%108 = call i64 @fgets(i8* %5, i32 1024, i32* %9)
%109 = icmp eq i64 %108, 0
br i1 %109, label %110, label %12
110: ; preds = %104, %2
ret i32 0
}