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


x86 assembly (clang, -O0):
<print_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a4 <print_config+0x74>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x5f,-0x10(%rbp)
jne    1183 <print_config+0x53>
movl   $0x2f,-0x10(%rbp)
jmp    118e <print_config+0x5e>
mov    -0x10(%rbp),%edi
call   1050 <tolower@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <print_config+0x22>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_config>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xeb0(%rip),%rdi
call   1050 <printf@plt>
test   %ebp,%ebp
jle    1188 <print_config+0x48>
mov    %ebp,%ebp
xor    %ebx,%ebx
jmp    116e <print_config+0x2e>
nop
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
je     1188 <print_config+0x48>
movsbl (%r14,%rbx,1),%eax
mov    $0x2f,%edi
cmp    $0x5f,%eax
je     1160 <print_config+0x20>
mov    %eax,%edi
call   1060 <tolower@plt>
mov    %eax,%edi
jmp    1160 <print_config+0x20>
lea    0xe90(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <puts@plt>

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

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