#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 *, ...);
int /*<<< orphan*/ putchar(int);
int tolower(int);
void print_dep(const char *m, int slen, const char *dir) {
  int c, prev_c = '/', i;
  printf("    $(wildcard %s/", dir);
  for (i = 0; i < slen; i++) {
    c = m[i];
    if (c == '_')
      c = '/';
    else
      c = tolower(c);
    if (c != '/' || prev_c != '/')
      putchar(c);
    prev_c = c;
  }
  printf(".h) \\\n");
}


x86 assembly (clang, -O0):
<print_dep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x2f,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11cf <print_dep+0x9f>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x5f,-0x1c(%rbp)
jne    1194 <print_dep+0x64>
movl   $0x2f,-0x1c(%rbp)
jmp    119f <print_dep+0x6f>
mov    -0x1c(%rbp),%edi
call   1050 <tolower@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x2f,-0x1c(%rbp)
jne    11b3 <print_dep+0x83>
cmpl   $0x2f,-0x20(%rbp)
je     11bb <print_dep+0x8b>
mov    -0x1c(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1163 <print_dep+0x33>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dep>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xeac(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
jle    11a9 <print_dep+0x69>
mov    %ebp,%r15d
mov    $0x2f,%ebp
xor    %ebx,%ebx
jmp    1184 <print_dep+0x44>
xchg   %ax,%ax
mov    %r12d,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
mov    %r12d,%ebp
cmp    %rbx,%r15
je     11a9 <print_dep+0x69>
movsbl (%r14,%rbx,1),%edi
mov    $0x2f,%r12d
cmp    $0x5f,%edi
je     119c <print_dep+0x5c>
call   1060 <tolower@plt>
mov    %eax,%r12d
cmp    $0x2f,%ebp
jne    1170 <print_dep+0x30>
cmp    $0x2f,%r12d
je     1178 <print_dep+0x38>
jmp    1170 <print_dep+0x30>
lea    0xe63(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c" $(wildcard %s/\00"
@str = [6 x i8] c".h) \\\00"
define void @print_dep(i8* nocapture %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %27
6: ; preds = %3
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %24
%9 = phi i64 [ 0, %6 ], [ %25, %24 ]
%10 = phi i32 [ 47, %6 ], [ %18, %24 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 95
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = sext i8 %12 to i32
%16 = tail call i32 @tolower(i32 %15)
br label %17
17: ; preds = %8, %14
%18 = phi i32 [ %16, %14 ], [ 47, %8 ]
%19 = icmp ne i32 %18, 47
%20 = icmp ne i32 %10, 47
%21 = or i1 %20, %19
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = tail call i32 @putchar(i32 %18)
br label %24
24: ; preds = %17, %22
%25 = add nuw nsw i64 %9, 1
%26 = icmp eq i64 %25, %7
br i1 %26, label %27, label %8
27: ; preds = %24, %3
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}