#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*/ column(char *, int, char *);
int count_columns(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int strlen(char *);
void append_exclude_dir_maybe(char *find_string_buffer, char *exclude_dir) {
  int str_len;
  char exclude_this[128];
  int number_of_columns = count_columns(exclude_dir);
  while (number_of_columns--) {
    column(exclude_this, number_of_columns, exclude_dir);
    str_len = strlen(find_string_buffer);
    sprintf(find_string_buffer + str_len, " | grep -v '/%s/'", exclude_this);
  }
}


x86 assembly (clang, -O0):
<append_exclude_dir_maybe>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <count_columns@plt>
mov    %eax,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xa4(%rbp)
cmp    $0x0,%eax
je     11c1 <append_exclude_dir_maybe+0x81>
lea    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1050 <column@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
lea    -0xa0(%rbp),%rdx
lea    0xe49(%rip),%rsi
call   1060 <sprintf@plt>
jmp    1162 <append_exclude_dir_maybe+0x22>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_exclude_dir_maybe>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <count_columns@plt>
test   %eax,%eax
je     119b <append_exclude_dir_maybe+0x5b>
mov    %eax,%ebp
add    $0xffffffff,%ebp
mov    %rsp,%r15
lea    0xe90(%rip),%r12
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1050 <column@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1060 <sprintf@plt>
add    $0xffffffff,%ebp
jb     1170 <append_exclude_dir_maybe+0x30>
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c" | grep -v '/%s/'\00"
define void @append_exclude_dir_maybe(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [128 x i8]
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @count_columns(i8* %8)
store i32 %9, i32* %7
br label %10
10: ; preds = %14, %2
%11 = load i32, i32* %7
%12 = add nsw i32 %11, -1
store i32 %12, i32* %7
%13 = icmp ne i32 %11, 0
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%16 = load i32, i32* %7
%17 = load i8*, i8** %4
%18 = call i32 @column(i8* %15, i32 %16, i8* %17)
%19 = load i8*, i8** %3
%20 = call i32 @strlen(i8* %19)
store i32 %20, i32* %5
%21 = load i8*, i8** %3
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%26 = call i32 @sprintf(i8* %24, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %25)
br label %10
27: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c" | grep -v '/%s/'\00"
define void @append_exclude_dir_maybe(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @count_columns(i8* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %9, %7 ], [ %5, %2 ]
%9 = add nsw i32 %8, -1
%10 = call i32 @column(i8* %4, i32 %9, i8* %1)
%11 = call i32 @strlen(i8* %0)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = call i32 @sprintf(i8* dereferenceable(1) %13, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%15 = icmp eq i32 %9, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %2
ret void
}