#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*/ write(int, char *, int);
void print_names(int i, int ac, char **av) {
  int j;
  j = 0;
  if (ac > 4) {
    if (i > 3)
      write(1, "\n==> ", 5);
    else
      write(1, "==> ", 4);
    while (av[i][j]) {
      write(1, &av[i][j], 1);
      j++;
    }
    write(1, " <==\n", 5);
  }
}


x86 assembly (clang, -O0):
<print_names>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x8(%rbp)
jle    11d0 <print_names+0xc0>
cmpl   $0x3,-0x4(%rbp)
jle    1158 <print_names+0x48>
mov    $0x1,%edi
lea    0xeb7(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
jmp    116e <print_names+0x5e>
mov    $0x1,%edi
lea    0xe9d(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
jmp    1173 <print_names+0x63>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     11ba <print_names+0xaa>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1173 <print_names+0x63>
mov    $0x1,%edi
lea    0xe40(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_names>:
cmp    $0x5,%esi
jl     1136 <print_names+0x26>
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %edi,%ebp
cmp    $0x4,%edi
jl     1137 <print_names+0x27>
lea    0xed6(%rip),%rsi
mov    $0x1,%edi
mov    $0x5,%edx
jmp    1148 <print_names+0x38>
ret
lea    0xec3(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <write@plt>
movslq %ebp,%rbp
mov    (%r14,%rbp,8),%rsi
cmpb   $0x0,(%rsi)
je     1181 <print_names+0x71>
mov    $0x1,%ebx
xchg   %ax,%ax
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    (%r14,%rbp,8),%rax
lea    (%rax,%rbx,1),%rsi
cmpb   $0x0,(%rax,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1160 <print_names+0x50>
lea    0xe7e(%rip),%rsi
mov    $0x1,%edi
mov    $0x5,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\0A==> \00"
@.str.1 = [5 x i8] c"==> \00"
@.str.2 = [6 x i8] c" <==\0A\00"
define void @print_names(i32 %0, i32 %1, i8** nocapture %2) {
%4 = icmp sgt i32 %1, 4
br i1 %4, label %5, label %28
5: ; preds = %3
%6 = icmp sgt i32 %0, 3
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
br label %11
9: ; preds = %5
%10 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
br label %11
11: ; preds = %9, %7
%12 = sext i32 %0 to i64
%13 = getelementptr inbounds i8*, i8** %2, i64 %12
%14 = load i8*, i8** %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %26, label %17
17: ; preds = %11, %17
%18 = phi i64 [ %21, %17 ], [ 0, %11 ]
%19 = phi i8* [ %23, %17 ], [ %14, %11 ]
%20 = tail call i32 @write(i32 1, i8* %19, i32 1)
%21 = add nuw i64 %18, 1
%22 = load i8*, i8** %13
%23 = getelementptr inbounds i8, i8* %22, i64 %21
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %17
26: ; preds = %17, %11
%27 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
br label %28
28: ; preds = %26, %3
ret void
}