#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*/ printf(char *, size_t, size_t, size_t, ...);
void printwc3(const char *filepath, size_t *cols) {
  if (filepath == NULL) {
    (void)printf("%d"
                 " "
                 "%d"
                 " "
                 "%d\n",
                 cols[0], cols[1], cols[2]);
  } else {
    (void)printf("%d"
                 " "
                 "%d"
                 " "
                 "%d"
                 " "
                 "%s\n",
                 cols[0], cols[1], cols[2], filepath);
  }
}


x86 assembly (clang, -O0):
<printwc3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1155 <printwc3+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117e <printwc3+0x6e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x8(%rbp),%r8
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printwc3>:
mov    %rsi,%rax
mov    (%rsi),%rsi
mov    0x8(%rax),%rdx
mov    0x10(%rax),%rcx
test   %rdi,%rdi
je     1134 <printwc3+0x24>
mov    %rdi,%r8
lea    0xedd(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [13 x i8] c"%d %d %d %s\0A\00"
define void @printwc3(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i64*, i64** %4
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
%14 = load i64*, i64** %4
%15 = getelementptr inbounds i64, i64* %14, i64 2
%16 = load i64, i64* %15
%17 = call i32 (i8*, i64, i64, i64, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %10, i64 %13, i64 %16)
br label %30
18: ; preds = %2
%19 = load i64*, i64** %4
%20 = getelementptr inbounds i64, i64* %19, i64 0
%21 = load i64, i64* %20
%22 = load i64*, i64** %4
%23 = getelementptr inbounds i64, i64* %22, i64 1
%24 = load i64, i64* %23
%25 = load i64*, i64** %4
%26 = getelementptr inbounds i64, i64* %25, i64 2
%27 = load i64, i64* %26
%28 = load i8*, i8** %3
%29 = call i32 (i8*, i64, i64, i64, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 %21, i64 %24, i64 %27, i8* %28)
br label %30
30: ; preds = %18, %7
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [13 x i8] c"%d %d %d %s\0A\00"
define void @printwc3(i8* %0, i64* nocapture %1) {
%3 = icmp eq i8* %0, null
%4 = load i64, i64* %1
%5 = getelementptr inbounds i64, i64* %1, i64 1
%6 = load i64, i64* %5
%7 = getelementptr inbounds i64, i64* %1, i64 2
%8 = load i64, i64* %7
br i1 %3, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (i8*, i64, i64, i64, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %6, i64 %8)
br label %13
11: ; preds = %2
%12 = tail call i32 (i8*, i64, i64, i64, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 %4, i64 %6, i64 %8, i8* %0)
br label %13
13: ; preds = %11, %9
ret void
}