#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 *, ...);
char *showflags(int);
void debug_determinestyle(int dateonly, char *date, int flags, char *month,
                          int imonth, char *dayofmonth, int idayofmonth,
                          char *dayofweek, int idayofweek, char *modifieroffset,
                          char *modifierindex, char *specialday, char *year,
                          int iyear) {
  if (dateonly != 0) {
    printf("-------\ndate: |%s|\n", date);
    if (dateonly == 1)
      return;
  }
  printf("flags: %x - %s\n", flags, showflags(flags));
  if (modifieroffset[0] != '\0')
    printf("modifieroffset: |%s|\n", modifieroffset);
  if (modifierindex[0] != '\0')
    printf("modifierindex: |%s|\n", modifierindex);
  if (year[0] != '\0')
    printf("year: |%s| (%d)\n", year, iyear);
  if (month[0] != '\0')
    printf("month: |%s| (%d)\n", month, imonth);
  if (dayofmonth[0] != '\0')
    printf("dayofmonth: |%s| (%d)\n", dayofmonth, idayofmonth);
  if (dayofweek[0] != '\0')
    printf("dayofweek: |%s| (%d)\n", dayofweek, idayofweek);
  if (specialday[0] != '\0')
    printf("specialday: |%s|\n", specialday);
}


x86 assembly (clang, -O0):
<debug_determinestyle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     118b <debug_determinestyle+0x6b>
mov    -0x10(%rbp),%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    1186 <debug_determinestyle+0x66>
jmp    12a7 <debug_determinestyle+0x187>
jmp    118b <debug_determinestyle+0x6b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <showflags@plt>
mov    -0x34(%rbp),%esi
mov    %rax,%rdx
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11cf <debug_determinestyle+0xaf>
mov    0x28(%rbp),%rsi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11f1 <debug_determinestyle+0xd1>
mov    0x30(%rbp),%rsi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1216 <debug_determinestyle+0xf6>
mov    0x40(%rbp),%rsi
mov    0x48(%rbp),%edx
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     123b <debug_determinestyle+0x11b>
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1260 <debug_determinestyle+0x140>
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%edx
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1285 <debug_determinestyle+0x165>
mov    0x18(%rbp),%rsi
mov    0x20(%rbp),%edx
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12a7 <debug_determinestyle+0x187>
mov    0x38(%rbp),%rsi
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_determinestyle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x18(%rsp)
mov    %r8d,0x4(%rsp)
mov    %rcx,%r14
mov    %edx,%ebp
mov    0x98(%rsp),%eax
mov    %eax,(%rsp)
mov    0x90(%rsp),%r13
mov    0x88(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0x80(%rsp),%r15
mov    0x78(%rsp),%r12
mov    0x70(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0x68(%rsp),%rax
mov    %rax,0x20(%rsp)
mov    0x60(%rsp),%eax
mov    %eax,0x8(%rsp)
test   %edi,%edi
je     11a0 <debug_determinestyle+0x80>
mov    %edi,%ebx
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x1,%ebx
je     1282 <debug_determinestyle+0x162>
mov    %ebp,%edi
call   1040 <showflags@plt>
lea    0xe66(%rip),%rdi
mov    %ebp,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
cmpb   $0x0,(%r12)
je     11d2 <debug_determinestyle+0xb2>
lea    0xe5c(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
cmpb   $0x0,(%r15)
je     11e9 <debug_determinestyle+0xc9>
lea    0xe5b(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
cmpb   $0x0,0x0(%r13)
je     1204 <debug_determinestyle+0xe4>
lea    0xe58(%rip),%rdi
mov    %r13,%rsi
mov    (%rsp),%edx
xor    %eax,%eax
call   1030 <printf@plt>
cmpb   $0x0,(%r14)
je     121f <debug_determinestyle+0xff>
lea    0xe54(%rip),%rdi
mov    %r14,%rsi
mov    0x4(%rsp),%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%rsi
cmpb   $0x0,(%rsi)
je     123b <debug_determinestyle+0x11b>
lea    0xe30(%rip),%rdi
mov    0x8(%rsp),%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%rsi
cmpb   $0x0,(%rsi)
je     1257 <debug_determinestyle+0x137>
lea    0xe2b(%rip),%rdi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
cmpb   $0x0,(%rax)
je     1282 <debug_determinestyle+0x162>
lea    0xe25(%rip),%rdi
mov    0x10(%rsp),%rsi
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"-------\0Adate: |%s|\0A\00"
@.str.1 = [16 x i8] c"flags: %x - %s\0A\00"
@.str.2 = [22 x i8] c"modifieroffset: |%s|\0A\00"
@.str.3 = [21 x i8] c"modifierindex: |%s|\0A\00"
@.str.4 = [17 x i8] c"year: |%s| (%d)\0A\00"
@.str.5 = [18 x i8] c"month: |%s| (%d)\0A\00"
@.str.6 = [23 x i8] c"dayofmonth: |%s| (%d)\0A\00"
@.str.7 = [22 x i8] c"dayofweek: |%s| (%d)\0A\00"
@.str.8 = [18 x i8] c"specialday: |%s|\0A\00"
define void @debug_determinestyle(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5, i32 %6, i8* %7, i32 %8, i8* %9, i8* %10, i8* %11, i8* %12, i32 %13) {
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i8*
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i32
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i8*
%28 = alloca i32
store i32 %0, i32* %15
store i8* %1, i8** %16
store i32 %2, i32* %17
store i8* %3, i8** %18
store i32 %4, i32* %19
store i8* %5, i8** %20
store i32 %6, i32* %21
store i8* %7, i8** %22
store i32 %8, i32* %23
store i8* %9, i8** %24
store i8* %10, i8** %25
store i8* %11, i8** %26
store i8* %12, i8** %27
store i32 %13, i32* %28
%29 = load i32, i32* %15
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %38
31: ; preds = %14
%32 = load i8*, i8** %16
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %32)
%34 = load i32, i32* %15
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %37
36: ; preds = %31
br label %109
37: ; preds = %31
br label %38
38: ; preds = %37, %14
%39 = load i32, i32* %17
%40 = load i32, i32* %17
%41 = call i8* @showflags(i32 %40)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %39, i8* %41)
%43 = load i8*, i8** %24
%44 = getelementptr inbounds i8, i8* %43, i64 0
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %38
%49 = load i8*, i8** %24
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %49)
br label %51
51: ; preds = %48, %38
%52 = load i8*, i8** %25
%53 = getelementptr inbounds i8, i8* %52, i64 0
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %51
%58 = load i8*, i8** %25
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %58)
br label %60
60: ; preds = %57, %51
%61 = load i8*, i8** %27
%62 = getelementptr inbounds i8, i8* %61, i64 0
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %60
%67 = load i8*, i8** %27
%68 = load i32, i32* %28
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %67, i32 %68)
br label %70
70: ; preds = %66, %60
%71 = load i8*, i8** %18
%72 = getelementptr inbounds i8, i8* %71, i64 0
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %80
76: ; preds = %70
%77 = load i8*, i8** %18
%78 = load i32, i32* %19
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %77, i32 %78)
br label %80
80: ; preds = %76, %70
%81 = load i8*, i8** %20
%82 = getelementptr inbounds i8, i8* %81, i64 0
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %90
86: ; preds = %80
%87 = load i8*, i8** %20
%88 = load i32, i32* %21
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* %87, i32 %88)
br label %90
90: ; preds = %86, %80
%91 = load i8*, i8** %22
%92 = getelementptr inbounds i8, i8* %91, i64 0
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %100
96: ; preds = %90
%97 = load i8*, i8** %22
%98 = load i32, i32* %23
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %97, i32 %98)
br label %100
100: ; preds = %96, %90
%101 = load i8*, i8** %26
%102 = getelementptr inbounds i8, i8* %101, i64 0
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %100
%107 = load i8*, i8** %26
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* %107)
br label %109
109: ; preds = %36, %106, %100
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"-------\0Adate: |%s|\0A\00"
@.str.1 = [16 x i8] c"flags: %x - %s\0A\00"
@.str.2 = [22 x i8] c"modifieroffset: |%s|\0A\00"
@.str.3 = [21 x i8] c"modifierindex: |%s|\0A\00"
@.str.4 = [17 x i8] c"year: |%s| (%d)\0A\00"
@.str.5 = [18 x i8] c"month: |%s| (%d)\0A\00"
@.str.6 = [23 x i8] c"dayofmonth: |%s| (%d)\0A\00"
@.str.7 = [22 x i8] c"dayofweek: |%s| (%d)\0A\00"
@.str.8 = [18 x i8] c"specialday: |%s|\0A\00"
define void @debug_determinestyle(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5, i32 %6, i8* %7, i32 %8, i8* %9, i8* %10, i8* %11, i8* %12, i32 %13) {
%15 = icmp eq i32 %0, 0
br i1 %15, label %19, label %16
16: ; preds = %14
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %1)
%18 = icmp eq i32 %0, 1
br i1 %18, label %56, label %19
19: ; preds = %16, %14
%20 = tail call i8* @showflags(i32 %2)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %2, i8* %20)
%22 = load i8, i8* %9
%23 = icmp eq i8 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %19
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %9)
br label %26
26: ; preds = %24, %19
%27 = load i8, i8* %10
%28 = icmp eq i8 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %26
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %10)
br label %31
31: ; preds = %29, %26
%32 = load i8, i8* %12
%33 = icmp eq i8 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %12, i32 %13)
br label %36
36: ; preds = %34, %31
%37 = load i8, i8* %3
%38 = icmp eq i8 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %36
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %3, i32 %4)
br label %41
41: ; preds = %39, %36
%42 = load i8, i8* %5
%43 = icmp eq i8 %42, 0
br i1 %43, label %46, label %44
44: ; preds = %41
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* %5, i32 %6)
br label %46
46: ; preds = %44, %41
%47 = load i8, i8* %7
%48 = icmp eq i8 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %46
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %7, i32 %8)
br label %51
51: ; preds = %49, %46
%52 = load i8, i8* %11
%53 = icmp eq i8 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %51
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* %11)
br label %56
56: ; preds = %16, %54, %51
ret void
}