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


x86 assembly (clang, -O0):
<printwc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114d <printwc2+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116e <printwc2+0x5e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x8(%rbp),%rcx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printwc2>:
mov    %rsi,%rax
mov    (%rsi),%rsi
mov    0x8(%rax),%rdx
test   %rdi,%rdi
je     1130 <printwc2+0x20>
mov    %rdi,%rcx
lea    0xede(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [10 x i8] c"%d %d %s\0A\00"
define void @printwc2(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 %15
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 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %10, i64 %13)
br label %24
15: ; preds = %2
%16 = load i64*, i64** %4
%17 = getelementptr inbounds i64, i64* %16, i64 0
%18 = load i64, i64* %17
%19 = load i64*, i64** %4
%20 = getelementptr inbounds i64, i64* %19, i64 1
%21 = load i64, i64* %20
%22 = load i8*, i8** %3
%23 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %18, i64 %21, i8* %22)
br label %24
24: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [10 x i8] c"%d %d %s\0A\00"
define void @printwc2(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
br i1 %3, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %6)
br label %11
9: ; preds = %2
%10 = tail call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %4, i64 %6, i8* %0)
br label %11
11: ; preds = %9, %7
ret void
}