#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 */
long MM_CONSOLE;
int MM_ERROR;
int MM_HALT;
int MM_INFO;
int MM_NOCON;
int MM_NOMSG;
int MM_NOTOK;
char *MM_NULLSEV;
long MM_PRINT;
int MM_WARNING;
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ _strcolcmp(char *const, char *);
int /*<<< orphan*/ close(int);
int dprintf(int, char *, char const *, char *, char *, char const *, char *,
            char const *, char *, char const *);
char *getenv(char *);
int open(char *, int /*<<< orphan*/);
char *strchr(char *, char);
int fmtmsg(long classification, const char *label, int severity,
           const char *text, const char *action, const char *tag) {
  int ret = 0, i, consolefd, verb = 0;
  char *errstring = MM_NULLSEV, *cmsg = getenv("MSGVERB");
  char *const msgs[] = {"label", "severity", "text", "action", "tag", NULL};
  int cs;
  if (severity == MM_HALT)
    errstring = "HALT: ";
  else if (severity == MM_ERROR)
    errstring = "ERROR: ";
  else if (severity == MM_WARNING)
    errstring = "WARNING: ";
  else if (severity == MM_INFO)
    errstring = "INFO: ";
  if (classification & MM_CONSOLE) {
    consolefd = open("/dev/console", O_WRONLY);
    if (consolefd < 0) {
      ret = MM_NOCON;
    } else {
      if (dprintf(consolefd, "%s%s%s%s%s%s%s%s\n", label ? label : "",
                  label ? ": " : "", severity ? errstring : "",
                  text ? text : "", action ? "\nTO FIX: " : "",
                  action ? action : "", action ? " " : "", tag ? tag : "") < 1)
        ret = MM_NOCON;
      close(consolefd);
    }
  }
  if (classification & MM_PRINT) {
    while (cmsg && cmsg[0]) {
      for (i = 0; msgs[i]; i++) {
        if (!_strcolcmp(msgs[i], cmsg))
          break;
      }
      if (msgs[i] == NULL) {
        verb = 0xFF;
        break;
      } else {
        verb |= (1 << i);
        cmsg = strchr(cmsg, ':');
        if (cmsg)
          cmsg++;
      }
    }
    if (!verb)
      verb = 0xFF;
    if (dprintf(2, "%s%s%s%s%s%s%s%s\n", (verb & 1 && label) ? label : "",
                (verb & 1 && label) ? ": " : "",
                (verb & 2 && severity) ? errstring : "",
                (verb & 4 && text) ? text : "",
                (verb & 8 && action) ? "\nTO FIX: " : "",
                (verb & 8 && action) ? action : "",
                (verb & 8 && action) ? " " : "",
                (verb & 16 && tag) ? tag : "") < 1)
      ret |= MM_NOMSG;
  }
  if ((ret & (MM_NOCON | MM_NOMSG)) == (MM_NOCON | MM_NOMSG))
    ret = MM_NOTOK;
  return ret;
}


x86 assembly (clang, -O0):
<fmtmsg>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x198,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x48(%rbp)
mov    0x2e08(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
lea    0xe4a(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1060 <memset@plt>
lea    0xe2f(%rip),%rax
mov    %rax,-0x90(%rbp)
lea    0xe27(%rip),%rax
mov    %rax,-0x88(%rbp)
lea    0xe22(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    0xe1c(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    0xe18(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2d77(%rip),%rcx
cmp    (%rcx),%eax
jne    1231 <fmtmsg+0xc1>
lea    0xdff(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    12a1 <fmtmsg+0x131>
mov    -0x1c(%rbp),%eax
mov    0x2d4d(%rip),%rcx
cmp    (%rcx),%eax
jne    1253 <fmtmsg+0xe3>
lea    0xde4(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    129c <fmtmsg+0x12c>
mov    -0x1c(%rbp),%eax
mov    0x2d63(%rip),%rcx
cmp    (%rcx),%eax
jne    1275 <fmtmsg+0x105>
lea    0xdca(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    1297 <fmtmsg+0x127>
mov    -0x1c(%rbp),%eax
mov    0x2d51(%rip),%rcx
cmp    (%rcx),%eax
jne    1292 <fmtmsg+0x122>
lea    0xdb2(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    1297 <fmtmsg+0x127>
jmp    129c <fmtmsg+0x12c>
jmp    12a1 <fmtmsg+0x131>
mov    -0x10(%rbp),%rax
mov    0x2d1c(%rip),%rcx
and    (%rcx),%rax
cmp    $0x0,%rax
je     14f4 <fmtmsg+0x384>
mov    0x2cd8(%rip),%rax
mov    (%rax),%esi
lea    0xd7e(%rip),%rdi
call   1090 <open@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    12ec <fmtmsg+0x17c>
mov    0x2d16(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
jmp    14ef <fmtmsg+0x37f>
mov    -0x44(%rbp),%eax
mov    %eax,-0x98(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1310 <fmtmsg+0x1a0>
mov    -0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
jmp    1323 <fmtmsg+0x1b3>
lea    0xd4e(%rip),%rax
mov    %rax,-0xa0(%rbp)
jmp    1323 <fmtmsg+0x1b3>
mov    -0xa0(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xd29(%rip),%rax
lea    0xcfa(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0xa8(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     136c <fmtmsg+0x1fc>
mov    -0x50(%rbp),%rax
mov    %rax,-0xb8(%rbp)
jmp    137f <fmtmsg+0x20f>
lea    0xcf2(%rip),%rax
mov    %rax,-0xb8(%rbp)
jmp    137f <fmtmsg+0x20f>
mov    -0xb8(%rbp),%rax
mov    %rax,-0xc0(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     13a8 <fmtmsg+0x238>
mov    -0x28(%rbp),%rax
mov    %rax,-0xc8(%rbp)
jmp    13bb <fmtmsg+0x24b>
lea    0xcb6(%rip),%rax
mov    %rax,-0xc8(%rbp)
jmp    13bb <fmtmsg+0x24b>
mov    -0xc8(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0x30(%rbp),%rdx
lea    0xc91(%rip),%rax
lea    0xc8b(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0xd0(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1405 <fmtmsg+0x295>
mov    -0x30(%rbp),%rax
mov    %rax,-0xe0(%rbp)
jmp    1418 <fmtmsg+0x2a8>
lea    0xc59(%rip),%rax
mov    %rax,-0xe0(%rbp)
jmp    1418 <fmtmsg+0x2a8>
mov    -0xe0(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0x30(%rbp),%rdx
lea    0xc34(%rip),%rax
lea    0xc06(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0xe8(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1462 <fmtmsg+0x2f2>
mov    -0x38(%rbp),%rax
mov    %rax,-0xf8(%rbp)
jmp    1475 <fmtmsg+0x305>
lea    0xbfc(%rip),%rax
mov    %rax,-0xf8(%rbp)
jmp    1475 <fmtmsg+0x305>
mov    -0xe8(%rbp),%r10
mov    -0xf0(%rbp),%r11
mov    -0xd0(%rbp),%rbx
mov    -0xd8(%rbp),%r9
mov    -0xc0(%rbp),%r8
mov    -0xa8(%rbp),%rcx
mov    -0xb0(%rbp),%rdx
mov    -0x98(%rbp),%edi
mov    -0xf8(%rbp),%rax
lea    0xb9a(%rip),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1080 <dprintf@plt>
cmp    $0x1,%eax
jge    14e7 <fmtmsg+0x377>
mov    0x2b16(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x44(%rbp),%edi
call   1070 <close@plt>
jmp    14f4 <fmtmsg+0x384>
mov    -0x10(%rbp),%rax
mov    0x2ae1(%rip),%rcx
and    (%rcx),%rax
cmp    $0x0,%rax
je     18c3 <fmtmsg+0x753>
jmp    1511 <fmtmsg+0x3a1>
xor    %eax,%eax
cmpq   $0x0,-0x58(%rbp)
mov    %al,-0xf9(%rbp)
je     1537 <fmtmsg+0x3c7>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xf9(%rbp)
mov    -0xf9(%rbp),%al
test   $0x1,%al
jne    154a <fmtmsg+0x3da>
jmp    15fc <fmtmsg+0x48c>
movl   $0x0,-0x40(%rbp)
movslq -0x40(%rbp),%rax
cmpq   $0x0,-0x90(%rbp,%rax,8)
je     159a <fmtmsg+0x42a>
movslq -0x40(%rbp),%rax
mov    -0x90(%rbp,%rax,8),%rdi
ff
mov    -0x58(%rbp),%rsi
call   1040 <_strcolcmp@plt>
cmp    $0x0,%eax
jne    1587 <fmtmsg+0x417>
jmp    159a <fmtmsg+0x42a>
jmp    158c <fmtmsg+0x41c>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1551 <fmtmsg+0x3e1>
movslq -0x40(%rbp),%rax
cmpq   $0x0,-0x90(%rbp,%rax,8)
jne    15b9 <fmtmsg+0x449>
movl   $0xff,-0x48(%rbp)
jmp    15fc <fmtmsg+0x48c>
mov    -0x40(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x58(%rbp),%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     15f2 <fmtmsg+0x482>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    15f7 <fmtmsg+0x487>
jmp    1511 <fmtmsg+0x3a1>
cmpl   $0x0,-0x48(%rbp)
jne    160d <fmtmsg+0x49d>
movl   $0xff,-0x48(%rbp)
mov    -0x48(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1637 <fmtmsg+0x4c7>
cmpq   $0x0,-0x18(%rbp)
je     1637 <fmtmsg+0x4c7>
mov    -0x18(%rbp),%rax
mov    %rax,-0x108(%rbp)
jmp    164a <fmtmsg+0x4da>
lea    0xa27(%rip),%rax
mov    %rax,-0x108(%rbp)
jmp    164a <fmtmsg+0x4da>
mov    -0x108(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x48(%rbp),%ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x109(%rbp)
je     167d <fmtmsg+0x50d>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x109(%rbp)
mov    -0x109(%rbp),%dl
lea    0x9db(%rip),%rax
lea    0x9ac(%rip),%rcx
test   $0x1,%dl
cmovne %rcx,%rax
mov    %rax,-0x120(%rbp)
mov    -0x48(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     16c8 <fmtmsg+0x558>
cmpl   $0x0,-0x1c(%rbp)
je     16c8 <fmtmsg+0x558>
mov    -0x50(%rbp),%rax
mov    %rax,-0x128(%rbp)
jmp    16db <fmtmsg+0x56b>
lea    0x996(%rip),%rax
mov    %rax,-0x128(%rbp)
jmp    16db <fmtmsg+0x56b>
mov    -0x128(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    -0x48(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1713 <fmtmsg+0x5a3>
cmpq   $0x0,-0x28(%rbp)
je     1713 <fmtmsg+0x5a3>
mov    -0x28(%rbp),%rax
mov    %rax,-0x138(%rbp)
jmp    1726 <fmtmsg+0x5b6>
lea    0x94b(%rip),%rax
mov    %rax,-0x138(%rbp)
jmp    1726 <fmtmsg+0x5b6>
mov    -0x138(%rbp),%rax
mov    %rax,-0x148(%rbp)
mov    -0x48(%rbp),%ecx
and    $0x8,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x139(%rbp)
je     1759 <fmtmsg+0x5e9>
cmpq   $0x0,-0x30(%rbp)
setne  %al
mov    %al,-0x139(%rbp)
mov    -0x139(%rbp),%dl
lea    0x8ff(%rip),%rax
lea    0x8f9(%rip),%rcx
test   $0x1,%dl
cmovne %rcx,%rax
mov    %rax,-0x150(%rbp)
mov    -0x48(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     17a5 <fmtmsg+0x635>
cmpq   $0x0,-0x30(%rbp)
je     17a5 <fmtmsg+0x635>
mov    -0x30(%rbp),%rax
mov    %rax,-0x158(%rbp)
jmp    17b8 <fmtmsg+0x648>
lea    0x8b9(%rip),%rax
mov    %rax,-0x158(%rbp)
jmp    17b8 <fmtmsg+0x648>
mov    -0x158(%rbp),%rax
mov    %rax,-0x168(%rbp)
mov    -0x48(%rbp),%ecx
and    $0x8,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x159(%rbp)
je     17eb <fmtmsg+0x67b>
cmpq   $0x0,-0x30(%rbp)
setne  %al
mov    %al,-0x159(%rbp)
mov    -0x159(%rbp),%dl
lea    0x86d(%rip),%rax
lea    0x83f(%rip),%rcx
test   $0x1,%dl
cmovne %rcx,%rax
mov    %rax,-0x170(%rbp)
mov    -0x48(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1837 <fmtmsg+0x6c7>
cmpq   $0x0,-0x38(%rbp)
je     1837 <fmtmsg+0x6c7>
mov    -0x38(%rbp),%rax
mov    %rax,-0x178(%rbp)
jmp    184a <fmtmsg+0x6da>
lea    0x827(%rip),%rax
mov    %rax,-0x178(%rbp)
jmp    184a <fmtmsg+0x6da>
mov    -0x170(%rbp),%r10
mov    -0x168(%rbp),%r11
mov    -0x150(%rbp),%rbx
mov    -0x148(%rbp),%r9
mov    -0x130(%rbp),%r8
mov    -0x120(%rbp),%rcx
mov    -0x118(%rbp),%rdx
mov    -0x178(%rbp),%rax
mov    $0x2,%edi
lea    0x7c6(%rip),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1080 <dprintf@plt>
cmp    $0x1,%eax
jge    18be <fmtmsg+0x74e>
mov    0x2722(%rip),%rax
mov    (%rax),%eax
or     -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    18c3 <fmtmsg+0x753>
mov    -0x3c(%rbp),%eax
mov    0x272b(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2702(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
mov    0x2717(%rip),%rcx
mov    (%rcx),%ecx
mov    0x26ee(%rip),%rdx
or     (%rdx),%ecx
cmp    %ecx,%eax
jne    1900 <fmtmsg+0x790>
mov    0x26ad(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x198,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmtmsg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9,%r12
mov    %r8,%r14
mov    %rcx,0x20(%rsp)
mov    %edx,%ebx
mov    %rsi,%r13
mov    %rdi,%rbp
mov    0x2e28(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
lea    0xe69(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r15
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
lea    0xe5a(%rip),%rax
mov    %rax,0x40(%rsp)
lea    0xe54(%rip),%rax
mov    %rax,0x48(%rsp)
lea    0xe51(%rip),%rax
mov    %rax,0x50(%rsp)
lea    0xe4a(%rip),%rax
mov    %rax,0x58(%rsp)
lea    0xe45(%rip),%rax
mov    %rax,0x60(%rsp)
mov    0x2da6(%rip),%rax
cmp    %ebx,(%rax)
jne    11fc <fmtmsg+0x9c>
lea    0xe32(%rip),%rax
mov    %rax,0x8(%rsp)
jmp    124c <fmtmsg+0xec>
mov    0x2d85(%rip),%rax
cmp    %ebx,(%rax)
jne    1215 <fmtmsg+0xb5>
lea    0xe20(%rip),%rax
mov    %rax,0x8(%rsp)
jmp    124c <fmtmsg+0xec>
mov    0x2da4(%rip),%rax
cmp    %ebx,(%rax)
jne    122e <fmtmsg+0xce>
lea    0xe0f(%rip),%rax
mov    %rax,0x8(%rsp)
jmp    124c <fmtmsg+0xec>
mov    0x2d9b(%rip),%rax
cmp    %ebx,(%rax)
lea    0xe02(%rip),%rax
mov    0x8(%rsp),%rcx
cmove  %rax,%rcx
mov    %rcx,0x8(%rsp)
mov    0x2d75(%rip),%rax
test   %rbp,(%rax)
mov    %r14,0x38(%rsp)
mov    %r12,0x28(%rsp)
je     132c <fmtmsg+0x1cc>
mov    %rbp,0x18(%rsp)
mov    %ebx,0x14(%rsp)
mov    0x2d22(%rip),%rax
mov    (%rax),%esi
lea    0xdc8(%rip),%rdi
call   1080 <open@plt>
test   %eax,%eax
js     1331 <fmtmsg+0x1d1>
mov    %eax,%r12d
test   %r13,%r13
lea    0xdcc(%rip),%rax
mov    %r13,0x30(%rsp)
cmove  %rax,%r13
lea    0xd94(%rip),%rcx
cmove  %rax,%rcx
cmpl   $0x0,0x14(%rsp)
mov    0x8(%rsp),%r8
cmove  %rax,%r8
mov    0x20(%rsp),%r9
test   %r9,%r9
cmove  %rax,%r9
test   %r14,%r14
lea    0xd95(%rip),%r10
cmove  %rax,%r10
cmove  %rax,%r14
lea    0xd5e(%rip),%rbp
cmove  %rax,%rbp
mov    0x28(%rsp),%rsi
test   %rsi,%rsi
cmovne %rsi,%rax
lea    0xd5d(%rip),%rsi
mov    %r12d,%edi
mov    %r13,%rdx
push   %rax
push   %rbp
push   %r14
push   %r10
call   1070 <dprintf@plt>
add    $0x20,%rsp
xor    %r14d,%r14d
test   %eax,%eax
jg     131d <fmtmsg+0x1bd>
mov    0x2cde(%rip),%rax
mov    (%rax),%r14d
mov    %r12d,%edi
call   1060 <close@plt>
mov    0x30(%rsp),%r13
jmp    133b <fmtmsg+0x1db>
xor    %r14d,%r14d
jmp    1344 <fmtmsg+0x1e4>
mov    0x2cc0(%rip),%rax
mov    (%rax),%r14d
mov    0x14(%rsp),%ebx
mov    0x18(%rsp),%rbp
mov    0x2c95(%rip),%rax
test   %rbp,(%rax)
je     1472 <fmtmsg+0x312>
mov    %ebx,%ebp
test   %r15,%r15
je     13b1 <fmtmsg+0x251>
xor    %r12d,%r12d
cmpb   $0x0,(%r15)
je     13ac <fmtmsg+0x24c>
xor    %ebx,%ebx
lea    0xc9b(%rip),%rdi
nopl   (%rax)
mov    %r15,%rsi
call   1040 <_strcolcmp@plt>
test   %eax,%eax
je     1390 <fmtmsg+0x230>
mov    0x48(%rsp,%rbx,8),%rdi
add    $0x1,%rbx
test   %rdi,%rdi
jne    1370 <fmtmsg+0x210>
jmp    13b1 <fmtmsg+0x251>
nopl   0x0(%rax)
bts    %ebx,%r12d
mov    %r15,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
lea    0x1(%rax),%r15
test   %rax,%rax
jne    135e <fmtmsg+0x1fe>
jmp    13b7 <fmtmsg+0x257>
test   %r12d,%r12d
jne    13b7 <fmtmsg+0x257>
mov    $0xff,%r12d
test   %r13,%r13
setne  %cl
lea    0xca1(%rip),%rsi
test   %r12b,%cl
cmove  %rsi,%r13
lea    0xc6b(%rip),%rcx
cmove  %rsi,%rcx
test   $0x2,%r12b
mov    0x8(%rsp),%r8
cmove  %rsi,%r8
test   %ebp,%ebp
cmove  %rsi,%r8
test   $0x4,%r12b
mov    %rsi,%r9
mov    0x20(%rsp),%rax
cmovne %rax,%r9
test   %rax,%rax
cmove  %rsi,%r9
mov    %r12d,%eax
and    $0x8,%eax
shr    $0x3,%eax
mov    0x38(%rsp),%rbp
test   %rbp,%rbp
setne  %bl
lea    0xc4b(%rip),%r10
test   %al,%bl
cmove  %rsi,%r10
cmove  %rsi,%rbp
lea    0xc12(%rip),%rbx
cmove  %rsi,%rbx
test   $0x10,%r12b
mov    %rsi,%rax
mov    0x28(%rsp),%rdi
cmovne %rdi,%rax
test   %rdi,%rdi
cmove  %rsi,%rax
lea    0xc06(%rip),%rsi
mov    $0x2,%edi
mov    %r13,%rdx
push   %rax
push   %rbx
push   %rbp
push   %r10
call   1070 <dprintf@plt>
add    $0x20,%rsp
test   %eax,%eax
jg     1472 <fmtmsg+0x312>
mov    0x2b69(%rip),%rax
or     (%rax),%r14d
mov    0x2b7f(%rip),%rax
mov    0x2b58(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %r14d,%eax
not    %eax
test   %eax,%ecx
jne    1497 <fmtmsg+0x337>
mov    0x2b14(%rip),%rax
mov    (%rax),%r14d
mov    %r14d,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@MM_NULLSEV = global i8* null
@.str = [8 x i8] c"MSGVERB\00"
@.str.1 = [6 x i8] c"label\00"
@.str.2 = [9 x i8] c"severity\00"
@.str.3 = [5 x i8] c"text\00"
@.str.4 = [7 x i8] c"action\00"
@.str.5 = [4 x i8] c"tag\00"
@MM_HALT = global i32 0
@.str.6 = [7 x i8] c"HALT: \00"
@MM_ERROR = global i32 0
@.str.7 = [8 x i8] c"ERROR: \00"
@MM_WARNING = global i32 0
@.str.8 = [10 x i8] c"WARNING: \00"
@MM_INFO = global i32 0
@.str.9 = [7 x i8] c"INFO: \00"
@MM_CONSOLE = global i64 0
@.str.10 = [13 x i8] c"/dev/console\00"
@O_WRONLY = global i32 0
@MM_NOCON = global i32 0
@.str.11 = [18 x i8] c"%s%s%s%s%s%s%s%s\0A\00"
@.str.12 = [1 x i8] zeroinitializer
@.str.13 = [3 x i8] c": \00"
@.str.14 = [10 x i8] c"\0ATO FIX: \00"
@.str.15 = [2 x i8] c" \00"
@MM_PRINT = global i64 0
@MM_NOMSG = global i32 0
@MM_NOTOK = global i32 0
define i32 @fmtmsg(i64 %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca [6 x i8*]
%20 = alloca i32
store i64 %0, i64* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
store i32 0, i32* %13
store i32 0, i32* %16
%21 = load i8*, i8** @MM_NULLSEV
store i8* %21, i8** %17
%22 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %22, i8** %18
%23 = bitcast [6 x i8*]* %19 to i8*
%24 = bitcast i8* %23 to [6 x i8*]*
%25 = getelementptr inbounds [6 x i8*], [6 x i8*]* %24, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8** %25
%26 = getelementptr inbounds [6 x i8*], [6 x i8*]* %24, i32 0, i32 1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8** %26
%27 = getelementptr inbounds [6 x i8*], [6 x i8*]* %24, i32 0, i32 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8** %27
%28 = getelementptr inbounds [6 x i8*], [6 x i8*]* %24, i32 0, i32 3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8** %28
%29 = getelementptr inbounds [6 x i8*], [6 x i8*]* %24, i32 0, i32 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8** %29
%30 = load i32, i32* %9
%31 = load i32, i32* @MM_HALT
%32 = icmp eq i32 %30, %31
br i1 %32, label %33, label %34
33: ; preds = %6
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %17
br label %52
34: ; preds = %6
%35 = load i32, i32* %9
%36 = load i32, i32* @MM_ERROR
%37 = icmp eq i32 %35, %36
br i1 %37, label %38, label %39
38: ; preds = %34
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %17
br label %51
39: ; preds = %34
%40 = load i32, i32* %9
%41 = load i32, i32* @MM_WARNING
%42 = icmp eq i32 %40, %41
br i1 %42, label %43, label %44
43: ; preds = %39
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8** %17
br label %50
44: ; preds = %39
%45 = load i32, i32* %9
%46 = load i32, i32* @MM_INFO
%47 = icmp eq i32 %45, %46
br i1 %47, label %48, label %49
48: ; preds = %44
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8** %17
br label %49
49: ; preds = %48, %44
br label %50
50: ; preds = %49, %43
br label %51
51: ; preds = %50, %38
br label %52
52: ; preds = %51, %33
%53 = load i64, i64* %7
%54 = load i64, i64* @MM_CONSOLE
%55 = and i64 %53, %54
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %121
57: ; preds = %52
%58 = load i32, i32* @O_WRONLY
%59 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %58)
store i32 %59, i32* %15
%60 = load i32, i32* %15
%61 = icmp slt i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = load i32, i32* @MM_NOCON
store i32 %63, i32* %13
br label %120
64: ; preds = %57
%65 = load i32, i32* %15
%66 = load i8*, i8** %8
%67 = icmp ne i8* %66, null
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = load i8*, i8** %8
br label %71
70: ; preds = %64
br label %71
71: ; preds = %70, %68
%72 = phi i8* [ %69, %68 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %70 ]
%73 = load i8*, i8** %8
%74 = icmp ne i8* %73, null
%75 = zext i1 %74 to i64
%76 = select i1 %74, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%77 = load i32, i32* %9
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %71
%80 = load i8*, i8** %17
br label %82
81: ; preds = %71
br label %82
82: ; preds = %81, %79
%83 = phi i8* [ %80, %79 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %81 ]
%84 = load i8*, i8** %10
%85 = icmp ne i8* %84, null
br i1 %85, label %86, label %88
86: ; preds = %82
%87 = load i8*, i8** %10
br label %89
88: ; preds = %82
br label %89
89: ; preds = %88, %86
%90 = phi i8* [ %87, %86 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %88 ]
%91 = load i8*, i8** %11
%92 = icmp ne i8* %91, null
%93 = zext i1 %92 to i64
%94 = select i1 %92, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%95 = load i8*, i8** %11
%96 = icmp ne i8* %95, null
br i1 %96, label %97, label %99
97: ; preds = %89
%98 = load i8*, i8** %11
br label %100
99: ; preds = %89
br label %100
100: ; preds = %99, %97
%101 = phi i8* [ %98, %97 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %99 ]
%102 = load i8*, i8** %11
%103 = icmp ne i8* %102, null
%104 = zext i1 %103 to i64
%105 = select i1 %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%106 = load i8*, i8** %12
%107 = icmp ne i8* %106, null
br i1 %107, label %108, label %110
108: ; preds = %100
%109 = load i8*, i8** %12
br label %111
110: ; preds = %100
br label %111
111: ; preds = %110, %108
%112 = phi i8* [ %109, %108 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %110 ]
%113 = call i32 @dprintf(i32 %65, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %72, i8* %76, i8* %83, i8* %90, i8* %94, i8* %101, i8* %105, i8* %112)
%114 = icmp slt i32 %113, 1
br i1 %114, label %115, label %117
115: ; preds = %111
%116 = load i32, i32* @MM_NOCON
store i32 %116, i32* %13
br label %117
117: ; preds = %115, %111
%118 = load i32, i32* %15
%119 = call i32 @close(i32 %118)
br label %120
120: ; preds = %117, %62
br label %121
121: ; preds = %120, %52
%122 = load i64, i64* %7
%123 = load i64, i64* @MM_PRINT
%124 = and i64 %122, %123
%125 = icmp ne i64 %124, 0
br i1 %125, label %126, label %276
126: ; preds = %121
br label %127
127: ; preds = %178, %126
%128 = load i8*, i8** %18
%129 = icmp ne i8* %128, null
br i1 %129, label %130, label %136
130: ; preds = %127
%131 = load i8*, i8** %18
%132 = getelementptr inbounds i8, i8* %131, i64 0
%133 = load i8, i8* %132
%134 = sext i8 %133 to i32
%135 = icmp ne i32 %134, 0
br label %136
136: ; preds = %130, %127
%137 = phi i1 [ false, %127 ], [ %135, %130 ]
br i1 %137, label %138, label %179
138: ; preds = %136
store i32 0, i32* %14
br label %139
139: ; preds = %155, %138
%140 = load i32, i32* %14
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [6 x i8*], [6 x i8*]* %19, i64 0, i64 %141
%143 = load i8*, i8** %142
%144 = icmp ne i8* %143, null
br i1 %144, label %145, label %158
145: ; preds = %139
%146 = load i32, i32* %14
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [6 x i8*], [6 x i8*]* %19, i64 0, i64 %147
%149 = load i8*, i8** %148
%150 = load i8*, i8** %18
%151 = call i32 @_strcolcmp(i8* %149, i8* %150)
%152 = icmp ne i32 %151, 0
br i1 %152, label %154, label %153
153: ; preds = %145
br label %158
154: ; preds = %145
br label %155
155: ; preds = %154
%156 = load i32, i32* %14
%157 = add nsw i32 %156, 1
store i32 %157, i32* %14
br label %139
158: ; preds = %153, %139
%159 = load i32, i32* %14
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [6 x i8*], [6 x i8*]* %19, i64 0, i64 %160
%162 = load i8*, i8** %161
%163 = icmp eq i8* %162, null
br i1 %163, label %164, label %165
164: ; preds = %158
store i32 255, i32* %16
br label %179
165: ; preds = %158
%166 = load i32, i32* %14
%167 = shl i32 1, %166
%168 = load i32, i32* %16
%169 = or i32 %168, %167
store i32 %169, i32* %16
%170 = load i8*, i8** %18
%171 = call i8* @strchr(i8* %170, i8 signext 58)
store i8* %171, i8** %18
%172 = load i8*, i8** %18
%173 = icmp ne i8* %172, null
br i1 %173, label %174, label %177
174: ; preds = %165
%175 = load i8*, i8** %18
%176 = getelementptr inbounds i8, i8* %175, i32 1
store i8* %176, i8** %18
br label %177
177: ; preds = %174, %165
br label %178
178: ; preds = %177
br label %127
179: ; preds = %164, %136
%180 = load i32, i32* %16
%181 = icmp ne i32 %180, 0
br i1 %181, label %183, label %182
182: ; preds = %179
store i32 255, i32* %16
br label %183
183: ; preds = %182, %179
%184 = load i32, i32* %16
%185 = and i32 %184, 1
%186 = icmp ne i32 %185, 0
br i1 %186, label %187, label %192
187: ; preds = %183
%188 = load i8*, i8** %8
%189 = icmp ne i8* %188, null
br i1 %189, label %190, label %192
190: ; preds = %187
%191 = load i8*, i8** %8
br label %193
192: ; preds = %187, %183
br label %193
193: ; preds = %192, %190
%194 = phi i8* [ %191, %190 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %192 ]
%195 = load i32, i32* %16
%196 = and i32 %195, 1
%197 = icmp ne i32 %196, 0
br i1 %197, label %198, label %201
198: ; preds = %193
%199 = load i8*, i8** %8
%200 = icmp ne i8* %199, null
br label %201
201: ; preds = %198, %193
%202 = phi i1 [ false, %193 ], [ %200, %198 ]
%203 = zext i1 %202 to i64
%204 = select i1 %202, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%205 = load i32, i32* %16
%206 = and i32 %205, 2
%207 = icmp ne i32 %206, 0
br i1 %207, label %208, label %213
208: ; preds = %201
%209 = load i32, i32* %9
%210 = icmp ne i32 %209, 0
br i1 %210, label %211, label %213
211: ; preds = %208
%212 = load i8*, i8** %17
br label %214
213: ; preds = %208, %201
br label %214
214: ; preds = %213, %211
%215 = phi i8* [ %212, %211 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %213 ]
%216 = load i32, i32* %16
%217 = and i32 %216, 4
%218 = icmp ne i32 %217, 0
br i1 %218, label %219, label %224
219: ; preds = %214
%220 = load i8*, i8** %10
%221 = icmp ne i8* %220, null
br i1 %221, label %222, label %224
222: ; preds = %219
%223 = load i8*, i8** %10
br label %225
224: ; preds = %219, %214
br label %225
225: ; preds = %224, %222
%226 = phi i8* [ %223, %222 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %224 ]
%227 = load i32, i32* %16
%228 = and i32 %227, 8
%229 = icmp ne i32 %228, 0
br i1 %229, label %230, label %233
230: ; preds = %225
%231 = load i8*, i8** %11
%232 = icmp ne i8* %231, null
br label %233
233: ; preds = %230, %225
%234 = phi i1 [ false, %225 ], [ %232, %230 ]
%235 = zext i1 %234 to i64
%236 = select i1 %234, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%237 = load i32, i32* %16
%238 = and i32 %237, 8
%239 = icmp ne i32 %238, 0
br i1 %239, label %240, label %245
240: ; preds = %233
%241 = load i8*, i8** %11
%242 = icmp ne i8* %241, null
br i1 %242, label %243, label %245
243: ; preds = %240
%244 = load i8*, i8** %11
br label %246
245: ; preds = %240, %233
br label %246
246: ; preds = %245, %243
%247 = phi i8* [ %244, %243 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %245 ]
%248 = load i32, i32* %16
%249 = and i32 %248, 8
%250 = icmp ne i32 %249, 0
br i1 %250, label %251, label %254
251: ; preds = %246
%252 = load i8*, i8** %11
%253 = icmp ne i8* %252, null
br label %254
254: ; preds = %251, %246
%255 = phi i1 [ false, %246 ], [ %253, %251 ]
%256 = zext i1 %255 to i64
%257 = select i1 %255, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%258 = load i32, i32* %16
%259 = and i32 %258, 16
%260 = icmp ne i32 %259, 0
br i1 %260, label %261, label %266
261: ; preds = %254
%262 = load i8*, i8** %12
%263 = icmp ne i8* %262, null
br i1 %263, label %264, label %266
264: ; preds = %261
%265 = load i8*, i8** %12
br label %267
266: ; preds = %261, %254
br label %267
267: ; preds = %266, %264
%268 = phi i8* [ %265, %264 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), %266 ]
%269 = call i32 @dprintf(i32 2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %194, i8* %204, i8* %215, i8* %226, i8* %236, i8* %247, i8* %257, i8* %268)
%270 = icmp slt i32 %269, 1
br i1 %270, label %271, label %275
271: ; preds = %267
%272 = load i32, i32* @MM_NOMSG
%273 = load i32, i32* %13
%274 = or i32 %273, %272
store i32 %274, i32* %13
br label %275
275: ; preds = %271, %267
br label %276
276: ; preds = %275, %121
%277 = load i32, i32* %13
%278 = load i32, i32* @MM_NOCON
%279 = load i32, i32* @MM_NOMSG
%280 = or i32 %278, %279
%281 = and i32 %277, %280
%282 = load i32, i32* @MM_NOCON
%283 = load i32, i32* @MM_NOMSG
%284 = or i32 %282, %283
%285 = icmp eq i32 %281, %284
br i1 %285, label %286, label %288
286: ; preds = %276
%287 = load i32, i32* @MM_NOTOK
store i32 %287, i32* %13
br label %288
288: ; preds = %286, %276
%289 = load i32, i32* %13
ret i32 %289
}

LLVM IR (-O2):
@MM_NULLSEV = global i8* null
@.str = [8 x i8] c"MSGVERB\00"
@.str.1 = [6 x i8] c"label\00"
@.str.2 = [9 x i8] c"severity\00"
@.str.3 = [5 x i8] c"text\00"
@.str.4 = [7 x i8] c"action\00"
@.str.5 = [4 x i8] c"tag\00"
@MM_HALT = global i32 0
@.str.6 = [7 x i8] c"HALT: \00"
@MM_ERROR = global i32 0
@.str.7 = [8 x i8] c"ERROR: \00"
@MM_WARNING = global i32 0
@.str.8 = [10 x i8] c"WARNING: \00"
@MM_INFO = global i32 0
@.str.9 = [7 x i8] c"INFO: \00"
@MM_CONSOLE = global i64 0
@.str.10 = [13 x i8] c"/dev/console\00"
@O_WRONLY = global i32 0
@MM_NOCON = global i32 0
@.str.11 = [18 x i8] c"%s%s%s%s%s%s%s%s\0A\00"
@.str.12 = [1 x i8] zeroinitializer
@.str.13 = [3 x i8] c": \00"
@.str.14 = [10 x i8] c"\0ATO FIX: \00"
@.str.15 = [2 x i8] c" \00"
@MM_PRINT = global i64 0
@MM_NOMSG = global i32 0
@MM_NOTOK = global i32 0
define i32 @fmtmsg(i64 %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca [6 x i8*]
%8 = load i8*, i8** @MM_NULLSEV
%9 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = bitcast [6 x i8*]* %7 to i8*
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 4
%12 = bitcast i8** %11 to i8*
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %17
%18 = load i32, i32* @MM_HALT
%19 = icmp eq i32 %18, %2
br i1 %19, label %30, label %20
20: ; preds = %6
%21 = load i32, i32* @MM_ERROR
%22 = icmp eq i32 %21, %2
br i1 %22, label %30, label %23
23: ; preds = %20
%24 = load i32, i32* @MM_WARNING
%25 = icmp eq i32 %24, %2
br i1 %25, label %30, label %26
26: ; preds = %23
%27 = load i32, i32* @MM_INFO
%28 = icmp eq i32 %27, %2
%29 = select i1 %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %8
br label %30
30: ; preds = %26, %23, %20, %6
%31 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), %20 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), %23 ], [ %29, %26 ]
%32 = load i64, i64* @MM_CONSOLE
%33 = and i64 %32, %0
%34 = icmp eq i64 %33, 0
br i1 %34, label %60, label %35
35: ; preds = %30
%36 = load i32, i32* @O_WRONLY
%37 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %36)
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = load i32, i32* @MM_NOCON
br label %60
41: ; preds = %35
%42 = icmp eq i8* %1, null
%43 = select i1 %42, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i8* %1
%44 = select i1 %42, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0)
%45 = icmp eq i32 %2, 0
%46 = select i1 %45, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i8* %31
%47 = icmp eq i8* %3, null
%48 = select i1 %47, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i8* %3
%49 = icmp eq i8* %4, null
%50 = select i1 %49, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0)
%51 = select i1 %49, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i8* %4
%52 = select i1 %49, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0)
%53 = icmp eq i8* %5, null
%54 = select i1 %53, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i8* %5
%55 = tail call i32 @dprintf(i32 %37, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %43, i8* %44, i8* %46, i8* %48, i8* %50, i8* %51, i8* %52, i8* %54)
%56 = load i32, i32* @MM_NOCON
%57 = icmp sgt i32 %55, 0
%58 = select i1 %57, i32 0, i32 %56
%59 = tail call i32 @close(i32 %37)
br label %60
60: ; preds = %39, %41, %30
%61 = phi i32 [ %40, %39 ], [ %58, %41 ], [ 0, %30 ]
%62 = load i64, i64* @MM_PRINT
%63 = and i64 %62, %0
%64 = icmp eq i64 %63, 0
br i1 %64, label %127, label %65
65: ; preds = %60
%66 = icmp eq i8* %9, null
br i1 %66, label %91, label %67
67: ; preds = %65, %82
%68 = phi i8* [ %88, %82 ], [ %9, %65 ]
%69 = phi i32 [ %85, %82 ], [ 0, %65 ]
%70 = load i8, i8* %68
%71 = icmp eq i8 %70, 0
br i1 %71, label %89, label %72
72: ; preds = %67, %77
%73 = phi i64 [ %78, %77 ], [ 0, %67 ]
%74 = phi i8* [ %80, %77 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %67 ]
%75 = tail call i32 @_strcolcmp(i8* %74, i8* %68)
%76 = icmp eq i32 %75, 0
br i1 %76, label %82, label %77
77: ; preds = %72
%78 = add nuw i64 %73, 1
%79 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 %78
%80 = load i8*, i8** %79
%81 = icmp eq i8* %80, null
br i1 %81, label %92, label %72
82: ; preds = %72
%83 = trunc i64 %73 to i32
%84 = shl nuw i32 1, %83
%85 = or i32 %84, %69
%86 = tail call i8* @strchr(i8* %68, i8 signext 58)
%87 = icmp eq i8* %86, null
%88 = getelementptr inbounds i8, i8* %86, i64 1
br i1 %87, label %92, label %67
89: ; preds = %67
%90 = icmp eq i32 %69, 0
br i1 %90, label %91, label %92
91: ; preds = %65, %89
br label %92
92: ; preds = %82, %77, %91, %89
%93 = phi i32 [ 255, %91 ], [ %69, %89 ], [ 255, %77 ], [ %85, %82 ]
%94 = and i32 %93, 1
%95 = icmp ne i32 %94, 0
%96 = icmp ne i8* %1, null
%97 = and i1 %96, %95
%98 = select i1 %97, i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%99 = select i1 %97, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%100 = and i32 %93, 2
%101 = icmp ne i32 %100, 0
%102 = icmp ne i32 %2, 0
%103 = and i1 %102, %101
%104 = select i1 %103, i8* %31, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%105 = and i32 %93, 4
%106 = icmp ne i32 %105, 0
%107 = icmp ne i8* %3, null
%108 = and i1 %107, %106
%109 = select i1 %108, i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%110 = and i32 %93, 8
%111 = icmp ne i32 %110, 0
%112 = icmp ne i8* %4, null
%113 = and i1 %112, %111
%114 = select i1 %113, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%115 = select i1 %113, i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%116 = select i1 %113, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%117 = and i32 %93, 16
%118 = icmp ne i32 %117, 0
%119 = icmp ne i8* %5, null
%120 = and i1 %119, %118
%121 = select i1 %120, i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0)
%122 = tail call i32 @dprintf(i32 2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %98, i8* %99, i8* %104, i8* %109, i8* %114, i8* %115, i8* %116, i8* %121)
%123 = icmp slt i32 %122, 1
br i1 %123, label %124, label %127
124: ; preds = %92
%125 = load i32, i32* @MM_NOMSG
%126 = or i32 %125, %61
br label %127
127: ; preds = %92, %124, %60
%128 = phi i32 [ %126, %124 ], [ %61, %92 ], [ %61, %60 ]
%129 = load i32, i32* @MM_NOCON
%130 = load i32, i32* @MM_NOMSG
%131 = or i32 %130, %129
%132 = and i32 %131, %128
%133 = icmp eq i32 %132, %131
%134 = load i32, i32* @MM_NOTOK
%135 = select i1 %133, i32 %134, i32 %128
ret i32 %135
}