#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 *, char *);
void printCommand(char **args) {
  if (args[0] != NULL) {
    printf("\033[32;1m"
           "%s "
           "\033[0m",
           args[0]);
    int i = 1;
    while (args[i] != NULL) {
      printf("%s ", args[i++]);
    }
  }
}


x86 assembly (clang, -O0):
<printCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1183 <printCommand+0x73>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     117e <printCommand+0x6e>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    1144 <printCommand+0x34>
jmp    1183 <printCommand+0x73>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCommand>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1154 <printCommand+0x44>
mov    %rdi,%rbx
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%rsi
test   %rsi,%rsi
je     1154 <printCommand+0x44>
add    $0x10,%rbx
lea    0xed0(%rip),%r14
nop
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1140 <printCommand+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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