#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*/ LC_ALL;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int strcmp(char *, char *);
int strcoll(char *, char *);
int main(void) {
  setlocale(LC_ALL, "");
  printf("Result of strcmp(\"\\\"\", \"/\") is %d\n", strcmp("\"", "/"));
  printf("Result of strcoll(\"\\\"\", \"/\") is %d\n", strcoll("\"", "/"));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1060 <setlocale@plt>
lea    0xea8(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
lea    0xe82(%rip),%rsi
call   1050 <strcoll@plt>
mov    %eax,%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xef9(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xea3(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <strcoll@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [35 x i8] c"Result of strcmp(\22\\\22\22, \22/\22) is %d\0A\00"
@.str.2 = [2 x i8] c"\22\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [36 x i8] c"Result of strcoll(\22\\\22\22, \22/\22) is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LC_ALL
%3 = call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @strcoll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [35 x i8] c"Result of strcmp(\22\\\22\22, \22/\22) is %d\0A\00"
@.str.2 = [2 x i8] c"\22\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [36 x i8] c"Result of strcoll(\22\\\22\22, \22/\22) is %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 -1)
%4 = tail call i32 @strcoll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}