#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 */
scalar_t__ strcmp(char *, char *);
int ExtractDayOfWeek(const char *RawDate) {
  int Temp;
  char RawDOW[4];
  RawDOW[0] = RawDate[0];
  RawDOW[1] = RawDate[1];
  RawDOW[2] = RawDate[2];
  RawDOW[3] = 0;
  if (strcmp(RawDOW, "Sun") == 0) {
    Temp = 1;
  };
  if (strcmp(RawDOW, "Mon") == 0) {
    Temp = 2;
  };
  if (strcmp(RawDOW, "Tue") == 0) {
    Temp = 3;
  };
  if (strcmp(RawDOW, "Wed") == 0) {
    Temp = 4;
  };
  if (strcmp(RawDOW, "Thu") == 0) {
    Temp = 5;
  };
  if (strcmp(RawDOW, "Fri") == 0) {
    Temp = 6;
  };
  if (strcmp(RawDOW, "Sat") == 0) {
    Temp = 7;
  };
  return Temp;
}


x86 assembly (clang, -O0):
<ExtractDayOfWeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xf(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0xe(%rbp)
movb   $0x0,-0xd(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115e <ExtractDayOfWeek+0x4e>
movl   $0x1,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    117f <ExtractDayOfWeek+0x6f>
movl   $0x2,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11a0 <ExtractDayOfWeek+0x90>
movl   $0x3,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11c1 <ExtractDayOfWeek+0xb1>
movl   $0x4,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11e2 <ExtractDayOfWeek+0xd2>
movl   $0x5,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xe27(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1203 <ExtractDayOfWeek+0xf3>
movl   $0x6,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xe0a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1224 <ExtractDayOfWeek+0x114>
movl   $0x7,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExtractDayOfWeek>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%al
mov    %al,0xc(%rsp)
mov    0x1(%rdi),%al
mov    %al,0xd(%rsp)
mov    0x2(%rdi),%al
mov    %al,0xe(%rsp)
movb   $0x0,0xf(%rsp)
lea    0xec8(%rip),%rsi
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcmp@plt>
lea    0xeb8(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
cmp    $0x1,%rax
mov    $0x1,%ebp
adc    $0x0,%ebp
lea    0xea1(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
mov    $0x3,%ebx
cmovne %ebp,%ebx
lea    0xe8b(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
mov    $0x4,%ebp
cmovne %ebx,%ebp
lea    0xe75(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
mov    $0x5,%ebx
cmovne %ebp,%ebx
lea    0xe5f(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
mov    $0x6,%ebp
cmovne %ebx,%ebp
lea    0xe49(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
mov    $0x7,%eax
cmovne %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Sun\00"
@.str.1 = [4 x i8] c"Mon\00"
@.str.2 = [4 x i8] c"Tue\00"
@.str.3 = [4 x i8] c"Wed\00"
@.str.4 = [4 x i8] c"Thu\00"
@.str.5 = [4 x i8] c"Fri\00"
@.str.6 = [4 x i8] c"Sat\00"
define i32 @ExtractDayOfWeek(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [4 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
store i8 %11, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 %15, i8* %16
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
store i8 0, i8* %17
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %1
store i32 1, i32* %3
br label %22
22: ; preds = %21, %1
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 2, i32* %3
br label %27
27: ; preds = %26, %22
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 3, i32* %3
br label %32
32: ; preds = %31, %27
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 4, i32* %3
br label %37
37: ; preds = %36, %32
%38 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 5, i32* %3
br label %42
42: ; preds = %41, %37
%43 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 6, i32* %3
br label %47
47: ; preds = %46, %42
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47
store i32 7, i32* %3
br label %52
52: ; preds = %51, %47
%53 = load i32, i32* %3
ret i32 %53
}

LLVM IR (-O2):
@.str = [4 x i8] c"Sun\00"
@.str.1 = [4 x i8] c"Mon\00"
@.str.2 = [4 x i8] c"Tue\00"
@.str.3 = [4 x i8] c"Wed\00"
@.str.4 = [4 x i8] c"Thu\00"
@.str.5 = [4 x i8] c"Fri\00"
@.str.6 = [4 x i8] c"Sat\00"
define i32 @ExtractDayOfWeek(i8* nocapture %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = load i8, i8* %0
store i8 %4, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
store i8 %9, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 0, i8* %11
%12 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i32 2, i32 1
%16 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
%18 = select i1 %17, i32 3, i32 %15
%19 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
%21 = select i1 %20, i32 4, i32 %18
%22 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
%24 = select i1 %23, i32 5, i32 %21
%25 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i32 6, i32 %24
%28 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
%30 = select i1 %29, i32 7, i32 %27
ret i32 %30
}