#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*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ die(int);
scalar_t__ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ strcpy(char *, char *);
void xxdline(FILE *fp, char *l, int nz) {
  static char z[(12 + (9 * 256 - 1) + 256 + 2) + 1];
  static int zero_seen = 0;
  if (!nz && zero_seen == 1)
    strcpy(z, l);
  if (nz || !zero_seen++) {
    if (nz) {
      if (nz < 0)
        zero_seen--;
      if (zero_seen == 2)
        if (fputs(z, fp) == EOF)
          die(3);
      if (zero_seen > 2)
        if (fputs("*\n", fp) == EOF)
          die(3);
    }
    if (nz >= 0 || zero_seen > 0)
      if (fputs(l, fp) == EOF)
        die(3);
    if (nz)
      zero_seen = 0;
  }
}


x86 assembly (clang, -O0):
<xxdline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116a <xxdline+0x3a>
cmpl   $0x1,0x390c(%rip)
jne    116a <xxdline+0x3a>
mov    -0x10(%rbp),%rsi
lea    0x2eeb(%rip),%rdi
call   1030 <strcpy@plt>
cmpl   $0x0,-0x14(%rbp)
jne    118e <xxdline+0x5e>
mov    0x38e6(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x38db(%rip)
cmp    $0x0,%eax
jne    128a <xxdline+0x15a>
cmpl   $0x0,-0x14(%rbp)
je     122e <xxdline+0xfe>
cmpl   $0x0,-0x14(%rbp)
jge    11b1 <xxdline+0x81>
mov    0x38b8(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x38af(%rip)
cmpl   $0x2,0x38a8(%rip)
jne    11ed <xxdline+0xbd>
mov    -0x8(%rbp),%rsi
lea    0x2e87(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e13(%rip),%rcx
cmp    (%rcx),%rax
jne    11e8 <xxdline+0xb8>
mov    $0x3,%edi
call   1050 <die@plt>
jmp    11ed <xxdline+0xbd>
cmpl   $0x2,0x386c(%rip)
jle    1229 <xxdline+0xf9>
mov    -0x8(%rbp),%rsi
lea    0xdfb(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2dd7(%rip),%rcx
cmp    (%rcx),%rax
jne    1224 <xxdline+0xf4>
mov    $0x3,%edi
call   1050 <die@plt>
jmp    1229 <xxdline+0xf9>
jmp    122e <xxdline+0xfe>
cmpl   $0x0,-0x14(%rbp)
jge    1245 <xxdline+0x115>
cmpl   $0x0,0x3821(%rip)
jle    1271 <xxdline+0x141>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
mov    0x2d8f(%rip),%rcx
cmp    (%rcx),%rax
jne    126c <xxdline+0x13c>
mov    $0x3,%edi
call   1050 <die@plt>
jmp    1271 <xxdline+0x141>
cmpl   $0x0,-0x14(%rbp)
je     1285 <xxdline+0x155>
movl   $0x0,0x37db(%rip)
jmp    128a <xxdline+0x15a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxdline>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r15
mov    %rdi,%r14
mov    0x391d(%rip),%eax
test   %edx,%edx
jne    1163 <xxdline+0x33>
cmp    $0x1,%eax
jne    1163 <xxdline+0x33>
lea    0x2efd(%rip),%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    0x38ff(%rip),%eax
jmp    11d9 <xxdline+0xa9>
test   %ebx,%ebx
je     11d9 <xxdline+0xa9>
jns    1172 <xxdline+0x42>
add    $0xffffffff,%eax
mov    %eax,0x38ee(%rip)
cmp    $0x2,%eax
jne    119c <xxdline+0x6c>
lea    0x2ed2(%rip),%rdi
mov    %r14,%rsi
call   1040 <fputs@plt>
mov    0x2e5b(%rip),%rcx
cmp    (%rcx),%rax
jne    119c <xxdline+0x6c>
mov    $0x3,%edi
call   1050 <die@plt>
cmpl   $0x3,0x38bd(%rip)
jl     11ca <xxdline+0x9a>
lea    0xe54(%rip),%rdi
mov    %r14,%rsi
call   1040 <fputs@plt>
mov    0x2e2d(%rip),%rcx
cmp    (%rcx),%rax
jne    11ca <xxdline+0x9a>
mov    $0x3,%edi
call   1050 <die@plt>
test   %ebx,%ebx
jns    11e6 <xxdline+0xb6>
cmpl   $0x0,0x388b(%rip)
jle    120b <xxdline+0xdb>
jmp    11e6 <xxdline+0xb6>
lea    0x1(%rax),%ecx
mov    %ecx,0x387e(%rip)
test   %eax,%eax
jne    1215 <xxdline+0xe5>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <fputs@plt>
mov    0x2df0(%rip),%rcx
cmp    (%rcx),%rax
jne    1207 <xxdline+0xd7>
mov    $0x3,%edi
call   1050 <die@plt>
test   %ebx,%ebx
je     1215 <xxdline+0xe5>
movl   $0x0,0x384b(%rip)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@xxdline.z = internal global [2574 x i8] zeroinitializer
@xxdline.zero_seen = internal global i32 0
@EOF = global i64 0
@.str = [3 x i8] c"*\0A\00"
define void @xxdline(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = load i32, i32* @xxdline.zero_seen
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i8*, i8** %5
%14 = call i32 @strcpy(i8* getelementptr inbounds ([2574 x i8], [2574 x i8]* @xxdline.z, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %9, %3
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = load i32, i32* @xxdline.zero_seen
%20 = add nsw i32 %19, 1
store i32 %20, i32* @xxdline.zero_seen
%21 = icmp ne i32 %19, 0
br i1 %21, label %74, label %22
22: ; preds = %18, %15
%23 = load i32, i32* %6
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %54
25: ; preds = %22
%26 = load i32, i32* %6
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i32, i32* @xxdline.zero_seen
%30 = add nsw i32 %29, -1
store i32 %30, i32* @xxdline.zero_seen
br label %31
31: ; preds = %28, %25
%32 = load i32, i32* @xxdline.zero_seen
%33 = icmp eq i32 %32, 2
br i1 %33, label %34, label %42
34: ; preds = %31
%35 = load i32*, i32** %4
%36 = call i64 @fputs(i8* getelementptr inbounds ([2574 x i8], [2574 x i8]* @xxdline.z, i64 0, i64 0), i32* %35)
%37 = load i64, i64* @EOF
%38 = icmp eq i64 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %34
%40 = call i32 @die(i32 3)
br label %41
41: ; preds = %39, %34
br label %42
42: ; preds = %41, %31
%43 = load i32, i32* @xxdline.zero_seen
%44 = icmp sgt i32 %43, 2
br i1 %44, label %45, label %53
45: ; preds = %42
%46 = load i32*, i32** %4
%47 = call i64 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %46)
%48 = load i64, i64* @EOF
%49 = icmp eq i64 %47, %48
br i1 %49, label %50, label %52
50: ; preds = %45
%51 = call i32 @die(i32 3)
br label %52
52: ; preds = %50, %45
br label %53
53: ; preds = %52, %42
br label %54
54: ; preds = %53, %22
%55 = load i32, i32* %6
%56 = icmp sge i32 %55, 0
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = load i32, i32* @xxdline.zero_seen
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %69
60: ; preds = %57, %54
%61 = load i8*, i8** %5
%62 = load i32*, i32** %4
%63 = call i64 @fputs(i8* %61, i32* %62)
%64 = load i64, i64* @EOF
%65 = icmp eq i64 %63, %64
br i1 %65, label %66, label %68
66: ; preds = %60
%67 = call i32 @die(i32 3)
br label %68
68: ; preds = %66, %60
br label %69
69: ; preds = %68, %57
%70 = load i32, i32* %6
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %73
72: ; preds = %69
store i32 0, i32* @xxdline.zero_seen
br label %73
73: ; preds = %72, %69
br label %74
74: ; preds = %73, %18
ret void
}

LLVM IR (-O2):
@xxdline.z = internal global [2574 x i8] zeroinitializer
@xxdline.zero_seen = internal unnamed_addr global i32 0
@EOF = global i64 0
@.str = [3 x i8] c"*\0A\00"
define void @xxdline(i32* nocapture %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = load i32, i32* @xxdline.zero_seen
%6 = icmp eq i32 %5, 1
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %9, label %8
8: ; preds = %3
br i1 %4, label %12, label %16
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* getelementptr inbounds ([2574 x i8], [2574 x i8]* @xxdline.z, i64 0, i64 0), i8* %1)
%11 = load i32, i32* @xxdline.zero_seen
br label %12
12: ; preds = %9, %8
%13 = phi i32 [ %11, %9 ], [ %5, %8 ]
%14 = add nsw i32 %13, 1
store i32 %14, i32* @xxdline.zero_seen
%15 = icmp eq i32 %13, 0
br i1 %15, label %43, label %51
16: ; preds = %8
%17 = icmp slt i32 %2, 0
br i1 %17, label %18, label %20
18: ; preds = %16
%19 = add nsw i32 %5, -1
store i32 %19, i32* @xxdline.zero_seen
br label %20
20: ; preds = %16, %18
%21 = phi i32 [ %19, %18 ], [ %5, %16 ]
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = tail call i64 @fputs(i8* getelementptr inbounds ([2574 x i8], [2574 x i8]* @xxdline.z, i64 0, i64 0), i32* %0)
%25 = load i64, i64* @EOF
%26 = icmp eq i64 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = tail call i32 @die(i32 3)
br label %29
29: ; preds = %23, %27, %20
%30 = load i32, i32* @xxdline.zero_seen
%31 = icmp sgt i32 %30, 2
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = tail call i64 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%34 = load i64, i64* @EOF
%35 = icmp eq i64 %33, %34
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = tail call i32 @die(i32 3)
br label %38
38: ; preds = %29, %36, %32
%39 = icmp sgt i32 %2, -1
%40 = load i32, i32* @xxdline.zero_seen
%41 = icmp sgt i32 %40, 0
%42 = select i1 %39, i1 true, i1 %41
br i1 %42, label %43, label %50
43: ; preds = %12, %38
%44 = tail call i64 @fputs(i8* %1, i32* %0)
%45 = load i64, i64* @EOF
%46 = icmp eq i64 %44, %45
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = tail call i32 @die(i32 3)
br label %49
49: ; preds = %43, %47
br i1 %4, label %51, label %50
50: ; preds = %38, %49
store i32 0, i32* @xxdline.zero_seen
br label %51
51: ; preds = %49, %50, %12
ret void
}