#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char);
void iwc_print_counter(unsigned long long *lines, unsigned long long *words,
                       unsigned long long *bytes, char eol) {
  char printed = 0;
  if (lines != NULL) {
    printf(" %7llu", *lines);
    printed = 1;
  }
  if (words != NULL) {
    printf(" %7llu", *words);
    printed = 1;
  }
  if (bytes != NULL) {
    printf(" %7llu", *bytes);
    printed = 1;
  }
  if (printed) {
    printf("%c", eol);
    fflush(NULL);
  }
}


x86 assembly (clang, -O0):
<iwc_print_counter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movb   $0x0,-0x1a(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1162 <iwc_print_counter+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
lea    0xeaa(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movb   $0x1,-0x1a(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1187 <iwc_print_counter+0x67>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
lea    0xe85(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movb   $0x1,-0x1a(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11ac <iwc_print_counter+0x8c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
lea    0xe60(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movb   $0x1,-0x1a(%rbp)
cmpb   $0x0,-0x1a(%rbp)
je     11cf <iwc_print_counter+0xaf>
lea    0xe4a(%rip),%rdi
movsbl -0x19(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iwc_print_counter>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%rbp
test   %rdi,%rdi
je     1148 <iwc_print_counter+0x28>
movsbl 0x0(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
test   %rbx,%rbx
je     1163 <iwc_print_counter+0x43>
movsbl (%rbx),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
test   %r15,%r15
jne    1168 <iwc_print_counter+0x48>
jmp    1178 <iwc_print_counter+0x58>
test   %r15,%r15
je     1199 <iwc_print_counter+0x79>
movsbl (%r15),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
movsbl %r14b,%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fflush@plt>
test   %rbp,%rbp
jne    1178 <iwc_print_counter+0x58>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c" %7llu\00"
@.str.1 = [3 x i8] c"%c\00"
define void @iwc_print_counter(i64* %0, i64* %1, i64* %2, i8 signext %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i8
%9 = alloca i8
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i8 %3, i8* %8
store i8 0, i8* %9
%10 = load i64*, i64** %5
%11 = icmp ne i64* %10, null
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i64*, i64** %5
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i8
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %15)
store i8 1, i8* %9
br label %17
17: ; preds = %12, %4
%18 = load i64*, i64** %6
%19 = icmp ne i64* %18, null
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i64*, i64** %6
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i8
%24 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %23)
store i8 1, i8* %9
br label %25
25: ; preds = %20, %17
%26 = load i64*, i64** %7
%27 = icmp ne i64* %26, null
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load i64*, i64** %7
%30 = load i64, i64* %29
%31 = trunc i64 %30 to i8
%32 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %31)
store i8 1, i8* %9
br label %33
33: ; preds = %28, %25
%34 = load i8, i8* %9
%35 = icmp ne i8 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i8, i8* %8
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %37)
%39 = call i32 @fflush(i32* null)
br label %40
40: ; preds = %36, %33
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c" %7llu\00"
@.str.1 = [3 x i8] c"%c\00"
define void @iwc_print_counter(i64* %0, i64* %1, i64* %2, i8 signext %3) {
%5 = icmp eq i64* %0, null
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = load i64, i64* %0
%8 = trunc i64 %7 to i8
%9 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %8)
br label %10
10: ; preds = %6, %4
%11 = icmp eq i64* %1, null
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = icmp eq i64* %2, null
br i1 %13, label %23, label %19
14: ; preds = %10
%15 = load i64, i64* %1
%16 = trunc i64 %15 to i8
%17 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %16)
%18 = icmp eq i64* %2, null
br i1 %18, label %24, label %19
19: ; preds = %14, %12
%20 = load i64, i64* %2
%21 = trunc i64 %20 to i8
%22 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %21)
br label %24
23: ; preds = %12
br i1 %5, label %27, label %24
24: ; preds = %14, %19, %23
%25 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %3)
%26 = tail call i32 @fflush(i32* null)
br label %27
27: ; preds = %24, %23
ret void
}