#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 dircmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ to_lower(char *, char *);
int dircmp_incase(char *s1, char *s2) {
  char _s1[strlen(s1) + 1];
  char _s2[strlen(s2) + 1];
  to_lower(s1, _s1);
  to_lower(s2, _s2);
  return dircmp(_s1, _s2);
}


x86 assembly (clang, -O0):
<dircmp_incase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rsi
add    $0x1,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <to_lower@plt>
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   1040 <to_lower@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <dircmp@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dircmp_incase>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %rsp,%r12
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    %r14,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <to_lower@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <to_lower@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <dircmp@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dircmp_incase(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %5
%13 = alloca i8, i64 %11
store i64 %11, i64* %6
%14 = load i8*, i8** %4
%15 = call i32 @strlen(i8* %14)
%16 = add nsw i32 %15, 1
%17 = zext i32 %16 to i64
%18 = alloca i8, i64 %17
store i64 %17, i64* %7
%19 = load i8*, i8** %3
%20 = call i32 @to_lower(i8* %19, i8* %13)
%21 = load i8*, i8** %4
%22 = call i32 @to_lower(i8* %21, i8* %18)
%23 = call i32 @dircmp(i8* %13, i8* %18)
%24 = load i8*, i8** %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @dircmp_incase(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = tail call i32 @strlen(i8* %1)
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
%11 = call i32 @to_lower(i8* %0, i8* %6)
%12 = call i32 @to_lower(i8* %1, i8* %10)
%13 = call i32 @dircmp(i8* %6, i8* %10)
ret i32 %13
}