#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);
int strcasecmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strdup(char *);
int main(int argc, char *argv[]) {
  printf("coucou | coUAcou = %d\n",
         strcasecmp(strdup("coucou"), strdup("coUAou")));
  printf("coucou | COUCOU = %d\n",
         strcasecmp(strdup("coucou"), strdup("COUCOU")));
  printf("coucou | COCO = %d\n", strcasecmp(strdup("coucou"), strdup("COCO")));
  printf("COUCOU | coucou = %d\n",
         strcasecmp(strdup("COUCOU"), strdup("coucou")));
  printf("COCO | coco = %d\n", strcasecmp(strdup("COCO"), strdup("coco")));
  printf("COCOOO | coco = %d\n", strcasecmp(strdup("COCOOO"), strdup("coco")));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,-0x28(%rbp)
lea    0xec2(%rip),%rdi
call   1050 <strdup@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,-0x24(%rbp)
lea    0xeac(%rip),%rdi
call   1050 <strdup@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe64(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,-0x20(%rbp)
lea    0xe94(%rip),%rdi
call   1050 <strdup@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
mov    %eax,%esi
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
lea    0xe55(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,-0x1c(%rbp)
lea    0xe22(%rip),%rdi
call   1050 <strdup@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
mov    %eax,%esi
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe3d(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,-0x18(%rbp)
lea    0xe5b(%rip),%rdi
call   1050 <strdup@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
mov    %eax,%esi
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
lea    0xe50(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,-0x14(%rbp)
lea    0xe28(%rip),%rdi
call   1050 <strdup@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
mov    %eax,%esi
lea    0xe15(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed9(%rip),%rbx
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %eax,%ebp
lea    0xecf(%rip),%rdi
call   1050 <strdup@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
lea    0xe9c(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %eax,%ebp
lea    0xebf(%rip),%r14
mov    %r14,%rdi
call   1050 <strdup@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %eax,%ebp
lea    0xeaa(%rip),%r15
mov    %r15,%rdi
call   1050 <strdup@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
lea    0xe7e(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1050 <strdup@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
lea    0xe6e(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1050 <strdup@plt>
mov    %eax,%ebx
lea    0xe7e(%rip),%rbp
mov    %rbp,%rdi
call   1050 <strdup@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
lea    0xe54(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xe71(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1050 <strdup@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <strcasecmp@plt>
lea    0xe3e(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"coucou | coUAcou = %d\0A\00"
@.str.1 = [7 x i8] c"coucou\00"
@.str.2 = [7 x i8] c"coUAou\00"
@.str.3 = [22 x i8] c"coucou | COUCOU = %d\0A\00"
@.str.4 = [7 x i8] c"COUCOU\00"
@.str.5 = [20 x i8] c"coucou | COCO = %d\0A\00"
@.str.6 = [5 x i8] c"COCO\00"
@.str.7 = [22 x i8] c"COUCOU | coucou = %d\0A\00"
@.str.8 = [18 x i8] c"COCO | coco = %d\0A\00"
@.str.9 = [5 x i8] c"coco\00"
@.str.10 = [20 x i8] c"COCOOO | coco = %d\0A\00"
@.str.11 = [7 x i8] c"COCOOO\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @strcasecmp(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @strcasecmp(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 @strcasecmp(i32 %14, i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @strcasecmp(i32 %18, i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %20)
%22 = call i32 @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%24 = call i32 @strcasecmp(i32 %22, i32 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %24)
%26 = call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%27 = call i32 @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%28 = call i32 @strcasecmp(i32 %26, i32 %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"coucou | coUAcou = %d\0A\00"
@.str.1 = [7 x i8] c"coucou\00"
@.str.2 = [7 x i8] c"coUAou\00"
@.str.3 = [22 x i8] c"coucou | COUCOU = %d\0A\00"
@.str.4 = [7 x i8] c"COUCOU\00"
@.str.5 = [20 x i8] c"coucou | COCO = %d\0A\00"
@.str.6 = [5 x i8] c"COCO\00"
@.str.7 = [22 x i8] c"COUCOU | coucou = %d\0A\00"
@.str.8 = [18 x i8] c"COCO | coco = %d\0A\00"
@.str.9 = [5 x i8] c"coco\00"
@.str.10 = [20 x i8] c"COCOOO | coco = %d\0A\00"
@.str.11 = [7 x i8] c"COCOOO\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @strcasecmp(i32 %3, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @strcasecmp(i32 %7, i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = tail call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 @strcasecmp(i32 %11, i32 %12)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%15 = tail call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%16 = tail call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 @strcasecmp(i32 %15, i32 %16)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %17)
%19 = tail call i32 @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%20 = tail call i32 @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%21 = tail call i32 @strcasecmp(i32 %19, i32 %20)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %21)
%23 = tail call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%24 = tail call i32 @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%25 = tail call i32 @strcasecmp(i32 %23, i32 %24)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i32 %25)
ret i32 0
}