#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 ssize_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcmp(char *, char *, int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, int, char *, ...);
int snprintf(char *, int, char *, int, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int ulz_snprintf(char *, int, char *, ...);
int main() {
  char buf[128], buf2[128];
  ssize_t ret;
  {
    ret = ulz_snprintf(buf, sizeof(buf), "[%.4d] foo bar %s\n", 13, "baz");
    {
      if (!(ret == 19))
        printf("line %d: test failed. %s. want %d\n", 22, "ret == 19",
               (int)ret);
    };
    if (!(19 == -1)) {
      {
        if (!(!strcmp(buf, "[0013] foo bar baz\n")))
          printf("line %d: test failed. %s <%s\n", 22,
                 "!strcmp(buf, \"[0013] foo bar baz\\n\")",
                 "[%.4d] foo bar %s\n");
      };
      ret = snprintf(buf2, sizeof(buf), "[%.4d] foo bar %s\n", 13, "baz");
      {
        if (!(!strcmp(buf, buf2)))
          printf("line %d: test failed. %s <%s\n", 22, "!strcmp(buf, buf2)",
                 "[%.4d] foo bar %s\n");
      };
    }
  };
  ret = ulz_snprintf(NULL, 0, "[%.4d] foo bar %s\n", 13, "baz");
  {
    if (!(ret == 19))
      printf("line %d: test failed. %s <%s\n", 25, "ret == 19", "");
  };
  {
    ret =
        ulz_snprintf(buf, sizeof(buf), "[%d] foo bar %s%%%zu,%lld\n", 13, "baz",
                     (size_t)0xFFFFFFFFFFFFFFFFL, 0xFFFFFFFFFFFFFFFFLL);
    {
      if (!(ret == 41))
        printf("line %d: test failed. %s. want %d\n", 27, "ret == 41",
               (int)ret);
    };
    if (!(41 == -1)) {
      {
        if (!(!strcmp(buf, "[13] foo bar baz%18446744073709551615,-1\n")))
          printf(
              "line %d: test failed. %s <%s\n", 27,
              "!strcmp(buf, \"[13] foo bar baz%18446744073709551615,-1\\n\")",
              "[%d] foo bar %s%%%zu,%lld\n");
      };
      ret = snprintf(buf2, sizeof(buf), "[%d] foo bar %s%%%zu,%lld\n", 13,
                     "baz", (size_t)0xFFFFFFFFFFFFFFFFL, 0xFFFFFFFFFFFFFFFFLL);
      {
        if (!(!strcmp(buf, buf2)))
          printf("line %d: test failed. %s <%s\n", 27, "!strcmp(buf, buf2)",
                 "[%d] foo bar %s%%%zu,%lld\n");
      };
    }
  };
  {
    ret =
        ulz_snprintf(buf, sizeof(buf), "[%d] foo bar %s%%%zu,%lld\n%", 13,
                     "baz", (size_t)0xFFFFFFFFFFFFFFFFL, 0xFFFFFFFFFFFFFFFFLL);
    {
      if (!(ret == -1))
        printf("line %d: test failed. %s. want %d\n", 29, "ret == -1",
               (int)ret);
    };
    if (!(-1 == -1)) {
      {
        if (!(!strcmp(buf, "")))
          printf("line %d: test failed. %s <%s\n", 29, "!strcmp(buf, \"\")",
                 "[%d] foo bar %s%%%zu,%lld\n%");
      };
      ret = snprintf(buf2, sizeof(buf), "[%d] foo bar %s%%%zu,%lld\n%", 13,
                     "baz", (size_t)0xFFFFFFFFFFFFFFFFL, 0xFFFFFFFFFFFFFFFFLL);
      {
        if (!(!strcmp(buf, buf2)))
          printf("line %d: test failed. %s <%s\n", 29, "!strcmp(buf, buf2)",
                 "[%d] foo bar %s%%%zu,%lld\n%");
      };
    }
  };
  ret = ulz_snprintf(NULL, 0, "[%.4d] foo bar %s\n", 13, "baz");
  assert(ret == 19);
  ret = ulz_snprintf(buf, 4, "%d", 1337);
  assert(ret == 3);
  assert(!strcmp(buf, "133"));
  memcpy(buf, "AAAAAA", 6 + 1);
  ret = snprintf(buf, 4, "%d", 1337);
  assert(ret == 4);
  assert(!memcmp(buf, "133", 4));
  ret = ulz_snprintf(NULL, 0, "%d", 1337);
  assert(ret == 4);
  ret = ulz_snprintf(buf, sizeof(buf), "%p", buf);
  ret = ulz_snprintf(NULL, 0, "%x", 0xa);
  assert(ret == 1);
  ret = ulz_snprintf(NULL, 0, "%X", 0xa);
  assert(ret == 1);
  ret = ulz_snprintf(buf, 10, "%x", 0xa);
  assert(ret == 1);
  assert(!strcmp(buf, "a"));
  ret = ulz_snprintf(buf, 10, "%X", 0xa);
  assert(ret == 1);
  assert(!strcmp(buf, "A"));
  ret = ulz_snprintf(NULL, 0, "%.2x", 0xa);
  assert(ret == 2);
  ret = ulz_snprintf(NULL, 0, "%.2X", 0xa);
  assert(ret == 2);
  ret = ulz_snprintf(buf, 10, "%.2x", 0xa);
  assert(ret == 2);
  assert(!strcmp(buf, "0a"));
  ret = ulz_snprintf(buf, 10, "%.2X", 0xa);
  assert(ret == 2);
  assert(!strcmp(buf, "0A"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x80,%esi
lea    0xe6b(%rip),%rdx
mov    $0xd,%ecx
lea    0xe72(%rip),%r8
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x13,-0x114(%rbp)
je     11db <main+0x6b>
mov    -0x114(%rbp),%ecx
lea    0xe4f(%rip),%rdi
mov    $0x16,%esi
lea    0xe66(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xe5b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     1218 <main+0xa8>
lea    0xe5a(%rip),%rdi
mov    $0x16,%esi
lea    0xe6c(%rip),%rdx
lea    0xdef(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x80,%esi
lea    0xdd5(%rip),%rdx
mov    $0xd,%ecx
lea    0xddc(%rip),%r8
mov    $0x0,%al
call   1040 <snprintf@plt>
mov    %eax,-0x114(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     1281 <main+0x111>
lea    0xdf1(%rip),%rdi
mov    $0x16,%esi
lea    0xe28(%rip),%rdx
lea    0xd86(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xd72(%rip),%rdx
mov    $0xd,%ecx
lea    0xd79(%rip),%r8
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x13,-0x114(%rbp)
je     12d5 <main+0x165>
lea    0xd9d(%rip),%rdi
mov    $0x19,%esi
lea    0xd73(%rip),%rdx
lea    0xe2e(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x80,%esi
lea    0xdc6(%rip),%rdx
mov    $0xd,%ecx
lea    0xd1f(%rip),%r8
mov    $0xffffffffffffffff,%r9
movq   $0xffffffffffffffff,(%rsp)
ff
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x29,-0x114(%rbp)
je     133d <main+0x1cd>
mov    -0x114(%rbp),%ecx
lea    0xced(%rip),%rdi
mov    $0x1b,%esi
lea    0xd93(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xd88(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     137a <main+0x20a>
lea    0xcf8(%rip),%rdi
mov    $0x1b,%esi
lea    0xd91(%rip),%rdx
lea    0xd3b(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x80,%esi
lea    0xd21(%rip),%rdx
mov    $0xd,%ecx
lea    0xc7a(%rip),%r8
mov    $0xffffffffffffffff,%r9
movq   $0xffffffffffffffff,(%rsp)
ff
mov    $0x0,%al
call   1040 <snprintf@plt>
mov    %eax,-0x114(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     13f2 <main+0x282>
lea    0xc80(%rip),%rdi
mov    $0x1b,%esi
lea    0xcb7(%rip),%rdx
lea    0xcc3(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x80,%esi
lea    0xd33(%rip),%rdx
mov    $0xd,%ecx
lea    0xc02(%rip),%r8
mov    $0xffffffffffffffff,%r9
movq   $0xffffffffffffffff,(%rsp)
ff
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0xffffffff,-0x114(%rbp)
je     145a <main+0x2ea>
mov    -0x114(%rbp),%ecx
lea    0xbd0(%rip),%rdi
mov    $0x1d,%esi
lea    0xd01(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xb99(%rip),%rdx
mov    $0xd,%ecx
lea    0xba0(%rip),%r8
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x13,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0x4,%esi
lea    0xcb7(%rip),%rdx
mov    $0x539,%ecx
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x3,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
lea    0xc86(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
lea    0xc65(%rip),%rsi
mov    $0x7,%edx
call   1080 <memcpy@plt>
lea    -0x90(%rbp),%rdi
mov    $0x4,%esi
lea    0xc41(%rip),%rdx
mov    $0x539,%ecx
mov    $0x0,%al
call   1040 <snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x4,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
lea    0xc10(%rip),%rsi
mov    $0x4,%edx
call   1050 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xbe4(%rip),%rdx
mov    $0x539,%ecx
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x4,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
lea    -0x90(%rbp),%rcx
mov    $0x80,%esi
lea    0xbb2(%rip),%rdx
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xb9b(%rip),%rdx
mov    $0xa,%ecx
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x1,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xb6b(%rip),%rdx
mov    $0xa,%ecx
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x1,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xa,%ecx
lea    0xb2f(%rip),%rdx
mov    %ecx,%esi
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x1,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
lea    0xb0f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xa,%ecx
lea    0xad7(%rip),%rdx
mov    %ecx,%esi
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x1,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
lea    0xab7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xa85(%rip),%rdx
mov    $0xa,%ecx
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x2,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xa57(%rip),%rdx
mov    $0xa,%ecx
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x2,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xa,%ecx
lea    0xa19(%rip),%rdx
mov    %ecx,%esi
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x2,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
lea    0x9f2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xa,%ecx
lea    0x9c3(%rip),%rdx
mov    %ecx,%esi
mov    $0x0,%al
call   1090 <ulz_snprintf@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x2,-0x114(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x90(%rbp),%rdi
lea    0x99a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x110,%rsp
lea    0xe7d(%rip),%rdx
lea    0xe89(%rip),%r8
lea    0x10(%rsp),%rdi
mov    $0x80,%esi
mov    $0xd,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
cmp    $0x13,%eax
je     11c1 <main+0x51>
lea    0xe6b(%rip),%rdi
lea    0xe87(%rip),%rdx
mov    $0x16,%esi
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe7c(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    $0x14,%edx
call   1050 <memcmp@plt>
test   %eax,%eax
je     11fc <main+0x8c>
lea    0xe76(%rip),%rdi
lea    0xe8d(%rip),%rdx
lea    0xe10(%rip),%rcx
mov    $0x16,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdfd(%rip),%rdx
lea    0xe09(%rip),%r8
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    $0xd,%ecx
xor    %eax,%eax
call   1040 <snprintf@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1258 <main+0xe8>
lea    0xe1a(%rip),%rdi
lea    0xe56(%rip),%rdx
lea    0xdb4(%rip),%rcx
mov    $0x16,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xda1(%rip),%rdx
lea    0xdad(%rip),%r8
xor    %edi,%edi
xor    %esi,%esi
mov    $0xd,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
cmp    $0x13,%eax
je     129c <main+0x12c>
lea    0xdd6(%rip),%rdi
lea    0xdb1(%rip),%rdx
lea    0xe6c(%rip),%rcx
mov    $0x19,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movq   $0xffffffffffffffff,(%rsp)
ff
lea    0xe03(%rip),%rdx
lea    0xd61(%rip),%r8
lea    0x10(%rsp),%rdi
mov    $0x80,%esi
mov    $0xd,%ecx
mov    $0xffffffffffffffff,%r9
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
cmp    $0x29,%eax
je     12f0 <main+0x180>
lea    0xd3c(%rip),%rdi
lea    0xde7(%rip),%rdx
mov    $0x1b,%esi
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xddc(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    $0x2a,%edx
call   1050 <memcmp@plt>
test   %eax,%eax
je     132b <main+0x1bb>
lea    0xd47(%rip),%rdi
lea    0xde5(%rip),%rdx
lea    0xd8f(%rip),%rcx
mov    $0x1b,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movq   $0xffffffffffffffff,(%rsp)
ff
lea    0xd74(%rip),%rdx
lea    0xcd2(%rip),%r8
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    $0xd,%ecx
mov    $0xffffffffffffffff,%r9
xor    %eax,%eax
call   1040 <snprintf@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1396 <main+0x226>
lea    0xcdc(%rip),%rdi
lea    0xd18(%rip),%rdx
lea    0xd24(%rip),%rcx
mov    $0x1b,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movq   $0xffffffffffffffff,(%rsp)
ff
lea    0xd93(%rip),%rdx
lea    0xc67(%rip),%r8
lea    0x10(%rsp),%rdi
mov    $0x80,%esi
mov    $0xd,%ecx
mov    $0xffffffffffffffff,%r9
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
cmp    $0xffffffff,%eax
je     13ea <main+0x27a>
lea    0xc42(%rip),%rdi
lea    0xd78(%rip),%rdx
mov    $0x1d,%esi
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc0f(%rip),%rdx
lea    0xc1b(%rip),%r8
xor    %edi,%edi
xor    %esi,%esi
mov    $0xd,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x13,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xd41(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
mov    $0x539,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xd13(%rip),%r15
mov    $0x4,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <memcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xcf3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1080 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
mov    $0x539,%ecx
xor    %eax,%eax
call   1040 <snprintf@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1050 <memcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0x539,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xc83(%rip),%rdx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %rbx,%rcx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
lea    0xc6d(%rip),%r15
xor    %edi,%edi
xor    %esi,%esi
mov    %r15,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xc48(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %r15,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xc09(%rip),%rsi
mov    $0x2,%edx
mov    %rbx,%rdi
call   1050 <memcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %r14,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xbc6(%rip),%rsi
mov    $0x2,%edx
mov    %rbx,%rdi
call   1050 <memcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xb97(%rip),%r15
xor    %edi,%edi
xor    %esi,%esi
mov    %r15,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xb74(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %r15,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xb2c(%rip),%rsi
mov    $0x3,%edx
mov    %rbx,%rdi
call   1050 <memcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %r14,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1090 <ulz_snprintf@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xae9(%rip),%rsi
mov    $0x3,%edx
mov    %rbx,%rdi
call   1050 <memcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"[%.4d] foo bar %s\0A\00"
@.str.1 = [4 x i8] c"baz\00"
@.str.2 = [35 x i8] c"line %d: test failed. %s. want %d\0A\00"
@.str.3 = [10 x i8] c"ret == 19\00"
@.str.4 = [20 x i8] c"[0013] foo bar baz\0A\00"
@.str.5 = [30 x i8] c"line %d: test failed. %s <%s\0A\00"
@.str.6 = [37 x i8] c"!strcmp(buf, \22[0013] foo bar baz\\n\22)\00"
@.str.7 = [19 x i8] c"!strcmp(buf, buf2)\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [27 x i8] c"[%d] foo bar %s%%%zu,%lld\0A\00"
@.str.10 = [10 x i8] c"ret == 41\00"
@.str.11 = [42 x i8] c"[13] foo bar baz%18446744073709551615,-1\0A\00"
@.str.12 = [59 x i8] c"!strcmp(buf, \22[13] foo bar baz%18446744073709551615,-1\\n\22)\00"
@.str.13 = [28 x i8] c"[%d] foo bar %s%%%zu,%lld\0A%\00"
@.str.14 = [10 x i8] c"ret == -1\00"
@.str.15 = [3 x i8] c"%d\00"
@.str.16 = [4 x i8] c"133\00"
@.str.17 = [7 x i8] c"AAAAAA\00"
@.str.18 = [3 x i8] c"%p\00"
@.str.19 = [3 x i8] c"%x\00"
@.str.20 = [3 x i8] c"%X\00"
@.str.21 = [2 x i8] c"a\00"
@.str.22 = [2 x i8] c"A\00"
@.str.23 = [5 x i8] c"%.2x\00"
@.str.24 = [5 x i8] c"%.2X\00"
@.str.25 = [3 x i8] c"0a\00"
@.str.26 = [3 x i8] c"0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca [128 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %5, i32 128, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 19
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = load i32, i32* %4
%11 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %0
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %12
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%20 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %19, i32 128, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %20, i32* %4
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%23 = call i32 @strcmp(i8* %21, i8* %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %18
%26 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %25, %18
%28 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %28, i32* %4
%29 = load i32, i32* %4
%30 = icmp eq i32 %29, 19
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
br label %33
33: ; preds = %31, %27
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%35 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %34, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 -1, i64 -1)
store i32 %35, i32* %4
%36 = load i32, i32* %4
%37 = icmp eq i32 %36, 41
br i1 %37, label %41, label %38
38: ; preds = %33
%39 = load i32, i32* %4
%40 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %38, %33
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
br label %47
47: ; preds = %45, %41
%48 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%49 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %48, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 -1, i64 -1)
store i32 %49, i32* %4
%50 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%51 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%52 = call i32 @strcmp(i8* %50, i8* %51)
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %47
%55 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
br label %56
56: ; preds = %54, %47
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%58 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %57, i32 128, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 -1, i64 -1)
store i32 %58, i32* %4
%59 = load i32, i32* %4
%60 = icmp eq i32 %59, -1
br i1 %60, label %64, label %61
61: ; preds = %56
%62 = load i32, i32* %4
%63 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i32 %62)
br label %64
64: ; preds = %61, %56
%65 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %65, i32* %4
%66 = load i32, i32* %4
%67 = icmp eq i32 %66, 19
%68 = zext i1 %67 to i32
%69 = call i32 @assert(i32 %68)
%70 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%71 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %70, i32 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 1337)
store i32 %71, i32* %4
%72 = load i32, i32* %4
%73 = icmp eq i32 %72, 3
%74 = zext i1 %73 to i32
%75 = call i32 @assert(i32 %74)
%76 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%77 = call i32 @strcmp(i8* %76, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%78 = icmp ne i32 %77, 0
%79 = xor i1 %78, true
%80 = zext i1 %79 to i32
%81 = call i32 @assert(i32 %80)
%82 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%83 = call i32 @memcpy(i8* %82, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i32 7)
%84 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%85 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %84, i32 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 1337)
store i32 %85, i32* %4
%86 = load i32, i32* %4
%87 = icmp eq i32 %86, 4
%88 = zext i1 %87 to i32
%89 = call i32 @assert(i32 %88)
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%91 = call i32 @memcmp(i8* %90, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 4)
%92 = icmp ne i32 %91, 0
%93 = xor i1 %92, true
%94 = zext i1 %93 to i32
%95 = call i32 @assert(i32 %94)
%96 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 1337)
store i32 %96, i32* %4
%97 = load i32, i32* %4
%98 = icmp eq i32 %97, 4
%99 = zext i1 %98 to i32
%100 = call i32 @assert(i32 %99)
%101 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%102 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%103 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %101, i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* %102)
store i32 %103, i32* %4
%104 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i32 10)
store i32 %104, i32* %4
%105 = load i32, i32* %4
%106 = icmp eq i32 %105, 1
%107 = zext i1 %106 to i32
%108 = call i32 @assert(i32 %107)
%109 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i32 10)
store i32 %109, i32* %4
%110 = load i32, i32* %4
%111 = icmp eq i32 %110, 1
%112 = zext i1 %111 to i32
%113 = call i32 @assert(i32 %112)
%114 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%115 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %114, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i32 10)
store i32 %115, i32* %4
%116 = load i32, i32* %4
%117 = icmp eq i32 %116, 1
%118 = zext i1 %117 to i32
%119 = call i32 @assert(i32 %118)
%120 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%121 = call i32 @strcmp(i8* %120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
%122 = icmp ne i32 %121, 0
%123 = xor i1 %122, true
%124 = zext i1 %123 to i32
%125 = call i32 @assert(i32 %124)
%126 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%127 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %126, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i32 10)
store i32 %127, i32* %4
%128 = load i32, i32* %4
%129 = icmp eq i32 %128, 1
%130 = zext i1 %129 to i32
%131 = call i32 @assert(i32 %130)
%132 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%133 = call i32 @strcmp(i8* %132, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0))
%134 = icmp ne i32 %133, 0
%135 = xor i1 %134, true
%136 = zext i1 %135 to i32
%137 = call i32 @assert(i32 %136)
%138 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 10)
store i32 %138, i32* %4
%139 = load i32, i32* %4
%140 = icmp eq i32 %139, 2
%141 = zext i1 %140 to i32
%142 = call i32 @assert(i32 %141)
%143 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i32 10)
store i32 %143, i32* %4
%144 = load i32, i32* %4
%145 = icmp eq i32 %144, 2
%146 = zext i1 %145 to i32
%147 = call i32 @assert(i32 %146)
%148 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%149 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %148, i32 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 10)
store i32 %149, i32* %4
%150 = load i32, i32* %4
%151 = icmp eq i32 %150, 2
%152 = zext i1 %151 to i32
%153 = call i32 @assert(i32 %152)
%154 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%155 = call i32 @strcmp(i8* %154, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0))
%156 = icmp ne i32 %155, 0
%157 = xor i1 %156, true
%158 = zext i1 %157 to i32
%159 = call i32 @assert(i32 %158)
%160 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%161 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %160, i32 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i32 10)
store i32 %161, i32* %4
%162 = load i32, i32* %4
%163 = icmp eq i32 %162, 2
%164 = zext i1 %163 to i32
%165 = call i32 @assert(i32 %164)
%166 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%167 = call i32 @strcmp(i8* %166, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0))
%168 = icmp ne i32 %167, 0
%169 = xor i1 %168, true
%170 = zext i1 %169 to i32
%171 = call i32 @assert(i32 %170)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"[%.4d] foo bar %s\0A\00"
@.str.1 = [4 x i8] c"baz\00"
@.str.2 = [35 x i8] c"line %d: test failed. %s. want %d\0A\00"
@.str.3 = [10 x i8] c"ret == 19\00"
@.str.4 = [20 x i8] c"[0013] foo bar baz\0A\00"
@.str.5 = [30 x i8] c"line %d: test failed. %s <%s\0A\00"
@.str.6 = [37 x i8] c"!strcmp(buf, \22[0013] foo bar baz\\n\22)\00"
@.str.7 = [19 x i8] c"!strcmp(buf, buf2)\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [27 x i8] c"[%d] foo bar %s%%%zu,%lld\0A\00"
@.str.10 = [10 x i8] c"ret == 41\00"
@.str.11 = [42 x i8] c"[13] foo bar baz%18446744073709551615,-1\0A\00"
@.str.12 = [59 x i8] c"!strcmp(buf, \22[13] foo bar baz%18446744073709551615,-1\\n\22)\00"
@.str.13 = [28 x i8] c"[%d] foo bar %s%%%zu,%lld\0A%\00"
@.str.14 = [10 x i8] c"ret == -1\00"
@.str.15 = [3 x i8] c"%d\00"
@.str.16 = [4 x i8] c"133\00"
@.str.17 = [7 x i8] c"AAAAAA\00"
@.str.18 = [3 x i8] c"%p\00"
@.str.19 = [3 x i8] c"%x\00"
@.str.20 = [3 x i8] c"%X\00"
@.str.21 = [2 x i8] c"a\00"
@.str.22 = [2 x i8] c"A\00"
@.str.23 = [5 x i8] c"%.2x\00"
@.str.24 = [5 x i8] c"%.2X\00"
@.str.25 = [3 x i8] c"0a\00"
@.str.26 = [3 x i8] c"0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 19
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %5)
br label %9
9: ; preds = %7, %0
%10 = call i32 bitcast (i32 (i8*, i8*, i32)* @memcmp to i32 (i8*, i8*, i64)*)(i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i64 20)
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @strcmp(i8* %3, i8* %4)
%17 = icmp eq i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i32 %21, 19
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
%26 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 -1, i64 -1)
%27 = icmp eq i32 %26, 41
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %26)
br label %30
30: ; preds = %28, %25
%31 = call i32 bitcast (i32 (i8*, i8*, i32)* @memcmp to i32 (i8*, i8*, i64)*)(i8* %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i64 42)
%32 = icmp eq i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
%36 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 -1, i64 -1)
%37 = call i32 @strcmp(i8* %3, i8* %4)
%38 = icmp eq i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %35
%40 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
br label %41
41: ; preds = %39, %35
%42 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 -1, i64 -1)
%43 = icmp eq i32 %42, -1
br i1 %43, label %46, label %44
44: ; preds = %41
%45 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i32 %42)
br label %46
46: ; preds = %44, %41
%47 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%48 = icmp eq i32 %47, 19
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %3, i32 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 1337)
%52 = icmp eq i32 %51, 3
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = call i32 bitcast (i32 (i8*, i8*, i32)* @memcmp to i32 (i8*, i8*, i64)*)(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i64 4)
%56 = icmp eq i32 %55, 0
%57 = zext i1 %56 to i32
%58 = call i32 @assert(i32 %57)
%59 = call i32 @memcpy(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i32 7)
%60 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %3, i32 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 1337)
%61 = icmp eq i32 %60, 4
%62 = zext i1 %61 to i32
%63 = call i32 @assert(i32 %62)
%64 = call i32 @memcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 4)
%65 = icmp eq i32 %64, 0
%66 = zext i1 %65 to i32
%67 = call i32 @assert(i32 %66)
%68 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 1337)
%69 = icmp eq i32 %68, 4
%70 = zext i1 %69 to i32
%71 = call i32 @assert(i32 %70)
%72 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* %3)
%73 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i32 10)
%74 = icmp eq i32 %73, 1
%75 = zext i1 %74 to i32
%76 = call i32 @assert(i32 %75)
%77 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i32 10)
%78 = icmp eq i32 %77, 1
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %3, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i32 10)
%82 = icmp eq i32 %81, 1
%83 = zext i1 %82 to i32
%84 = call i32 @assert(i32 %83)
%85 = call i32 bitcast (i32 (i8*, i8*, i32)* @memcmp to i32 (i8*, i8*, i64)*)(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0), i64 2)
%86 = icmp eq i32 %85, 0
%87 = zext i1 %86 to i32
%88 = call i32 @assert(i32 %87)
%89 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %3, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i32 10)
%90 = icmp eq i32 %89, 1
%91 = zext i1 %90 to i32
%92 = call i32 @assert(i32 %91)
%93 = call i32 bitcast (i32 (i8*, i8*, i32)* @memcmp to i32 (i8*, i8*, i64)*)(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0), i64 2)
%94 = icmp eq i32 %93, 0
%95 = zext i1 %94 to i32
%96 = call i32 @assert(i32 %95)
%97 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 10)
%98 = icmp eq i32 %97, 2
%99 = zext i1 %98 to i32
%100 = call i32 @assert(i32 %99)
%101 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i32 10)
%102 = icmp eq i32 %101, 2
%103 = zext i1 %102 to i32
%104 = call i32 @assert(i32 %103)
%105 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %3, i32 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 10)
%106 = icmp eq i32 %105, 2
%107 = zext i1 %106 to i32
%108 = call i32 @assert(i32 %107)
%109 = call i32 bitcast (i32 (i8*, i8*, i32)* @memcmp to i32 (i8*, i8*, i64)*)(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i64 3)
%110 = icmp eq i32 %109, 0
%111 = zext i1 %110 to i32
%112 = call i32 @assert(i32 %111)
%113 = call i32 (i8*, i32, i8*, ...) @ulz_snprintf(i8* %3, i32 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i32 10)
%114 = icmp eq i32 %113, 2
%115 = zext i1 %114 to i32
%116 = call i32 @assert(i32 %115)
%117 = call i32 bitcast (i32 (i8*, i8*, i32)* @memcmp to i32 (i8*, i8*, i64)*)(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0), i64 3)
%118 = icmp eq i32 %117, 0
%119 = zext i1 %118 to i32
%120 = call i32 @assert(i32 %119)
ret i32 0
}