#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 */
typedef int /*<<< orphan*/ tmp;
typedef int /*<<< orphan*/ time_t;
struct tm {
  int /*<<< orphan*/ tm_mday;
};

/* Variables and functions */
scalar_t__ difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ *strptime(char *, char *, struct tm *);
int main(int argc, char *argv[]) {
  char *datein, *datefin;
  struct tm mytime;
  time_t datetimein, datetimefin;
  char tmp[32];
  if (argc != 3) {
    fprintf(stderr, "%d vs 3\n", argc);
    fprintf(stderr, "Usage: %s <datein> <datefin>\n", argv[0]);
    return 1;
  }
  datein = argv[1];
  datefin = argv[2];
  sprintf(tmp, "%s 00:00:00", datefin);
  if (strptime(tmp, "%Y/%m/%d %H:%M:%S", &mytime) == NULL) {
    fprintf(stderr, "invalid time '%s'\n", datefin);
    return 1;
  }
  datetimefin = mktime(&mytime);
  sprintf(tmp, "%s 00:00:00", datein);
  if (strptime(tmp, "%Y/%m/%d %H:%M:%S", &mytime) == NULL) {
    fprintf(stderr, "invalid time '%s'\n", datein);
    return 1;
  }
  datetimein = mktime(&mytime);
  while (difftime(datetimefin, datetimein) > 0) {
    datetimein = mktime(&mytime);
    strftime(tmp, sizeof(tmp), "%Y_%m_%d", &mytime);
    fprintf(stdout, "%s\n", tmp);
    mytime.tm_mday++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11c4 <main+0x64>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe6d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe58(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1310 <main+0x1b0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xe3c(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x50(%rbp),%rdi
lea    0xe38(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1080 <strptime@plt>
cmp    $0x0,%rax
jne    1235 <main+0xd5>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xe23(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1310 <main+0x1b0>
lea    -0x28(%rbp),%rdi
call   1050 <mktime@plt>
mov    %eax,-0x30(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xdd7(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x50(%rbp),%rdi
lea    0xdd3(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1080 <strptime@plt>
cmp    $0x0,%rax
jne    129a <main+0x13a>
mov    0x2d66(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xdbe(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1310 <main+0x1b0>
lea    -0x28(%rbp),%rdi
call   1050 <mktime@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1030 <difftime@plt>
cmp    $0x0,%rax
jle    1309 <main+0x1a9>
lea    -0x28(%rbp),%rdi
call   1050 <mktime@plt>
mov    %eax,-0x2c(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x20,%esi
lea    0xd81(%rip),%rdx
lea    -0x28(%rbp),%rcx
call   1060 <strftime@plt>
mov    0x2cf1(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rdx
lea    0xd6d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12a6 <main+0x146>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    127f <main+0x11f>
mov    0x8(%rbx),%r14
mov    0x10(%rbx),%rbx
lea    0xe9e(%rip),%rsi
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rdx
call   1070 <sprintf@plt>
lea    0xe93(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbp,%rdi
call   1080 <strptime@plt>
test   %rax,%rax
je     12a8 <main+0x148>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <mktime@plt>
mov    %eax,%r15d
lea    0xe5a(%rip),%rsi
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rdx
call   1070 <sprintf@plt>
lea    0xe4f(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
call   1080 <strptime@plt>
test   %rax,%rax
je     12bd <main+0x15d>
lea    0x8(%rsp),%rdi
call   1050 <mktime@plt>
mov    %r15d,%edi
mov    %eax,%esi
call   1030 <difftime@plt>
test   %rax,%rax
jle    12ed <main+0x18d>
lea    0x8(%rsp),%r13
lea    0x10(%rsp),%rbp
lea    0xe3b(%rip),%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1050 <mktime@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
mov    $0x20,%esi
lea    0xe0e(%rip),%rdx
mov    %r13,%rcx
call   1060 <strftime@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
mov    %r12,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
addl   $0x1,0x8(%rsp)
mov    %r15d,%edi
mov    %r14d,%esi
call   1030 <difftime@plt>
test   %rax,%rax
jg     1230 <main+0xd0>
jmp    12dc <main+0x17c>
mov    %edi,%edx
mov    0x2d58(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xd6e(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xd63(%rip),%rsi
jmp    12d0 <main+0x170>
mov    0x2d31(%rip),%rax
mov    (%rax),%edi
lea    0xd8d(%rip),%rsi
mov    %rbx,%rdx
jmp    12d0 <main+0x170>
mov    0x2d1c(%rip),%rax
mov    (%rax),%edi
lea    0xd78(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
jmp    12dc <main+0x17c>

LLVM IR (-O0):
%struct.tm = type { i32 }
@stderr = global i32 0
@.str = [9 x i8] c"%d vs 3\0A\00"
@.str.1 = [30 x i8] c"Usage: %s <datein> <datefin>\0A\00"
@.str.2 = [12 x i8] c"%s 00:00:00\00"
@.str.3 = [18 x i8] c"%Y/%m/%d %H:%M:%S\00"
@.str.4 = [19 x i8] c"invalid time '%s'\0A\00"
@.str.5 = [9 x i8] c"%Y_%m_%d\00"
@stdout = global i32 0
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %struct.tm
%9 = alloca i32
%10 = alloca i32
%11 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %23
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i32, i32* %4
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @stderr
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %21)
store i32 1, i32* %3
br label %70
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
store i8* %26, i8** %6
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
store i8* %29, i8** %7
%30 = getelementptr inbounds [32 x i8], [32 x i8]* %11, i64 0, i64 0
%31 = load i8*, i8** %7
%32 = call i32 @sprintf(i8* %30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %31)
%33 = getelementptr inbounds [32 x i8], [32 x i8]* %11, i64 0, i64 0
%34 = call i32* @strptime(i8* %33, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %8)
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %40
36: ; preds = %23
%37 = load i32, i32* @stderr
%38 = load i8*, i8** %7
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %38)
store i32 1, i32* %3
br label %70
40: ; preds = %23
%41 = call i32 @mktime(%struct.tm* %8)
store i32 %41, i32* %10
%42 = getelementptr inbounds [32 x i8], [32 x i8]* %11, i64 0, i64 0
%43 = load i8*, i8** %6
%44 = call i32 @sprintf(i8* %42, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %43)
%45 = getelementptr inbounds [32 x i8], [32 x i8]* %11, i64 0, i64 0
%46 = call i32* @strptime(i8* %45, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %8)
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %52
48: ; preds = %40
%49 = load i32, i32* @stderr
%50 = load i8*, i8** %6
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %50)
store i32 1, i32* %3
br label %70
52: ; preds = %40
%53 = call i32 @mktime(%struct.tm* %8)
store i32 %53, i32* %9
br label %54
54: ; preds = %59, %52
%55 = load i32, i32* %10
%56 = load i32, i32* %9
%57 = call i64 @difftime(i32 %55, i32 %56)
%58 = icmp sgt i64 %57, 0
br i1 %58, label %59, label %69
59: ; preds = %54
%60 = call i32 @mktime(%struct.tm* %8)
store i32 %60, i32* %9
%61 = getelementptr inbounds [32 x i8], [32 x i8]* %11, i64 0, i64 0
%62 = call i32 @strftime(i8* %61, i32 32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %struct.tm* %8)
%63 = load i32, i32* @stdout
%64 = getelementptr inbounds [32 x i8], [32 x i8]* %11, i64 0, i64 0
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %64)
%66 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 0
%67 = load i32, i32* %66
%68 = add nsw i32 %67, 1
store i32 %68, i32* %66
br label %54
69: ; preds = %54
store i32 0, i32* %3
br label %70
70: ; preds = %69, %48, %36, %14
%71 = load i32, i32* %3
ret i32 %71
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@stderr = global i32 0
@.str = [9 x i8] c"%d vs 3\0A\00"
@.str.1 = [30 x i8] c"Usage: %s <datein> <datefin>\0A\00"
@.str.2 = [12 x i8] c"%s 00:00:00\00"
@.str.3 = [18 x i8] c"%Y/%m/%d %H:%M:%S\00"
@.str.4 = [19 x i8] c"invalid time '%s'\0A\00"
@.str.5 = [9 x i8] c"%Y_%m_%d\00"
@stdout = global i32 0
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.tm
%4 = alloca [32 x i8]
%5 = bitcast %struct.tm* %3 to i8*
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %1
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %48
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = call i32* @strptime(i8* %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %3)
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %14
%23 = load i32, i32* @stderr
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %18)
br label %48
25: ; preds = %14
%26 = call i32 @mktime(%struct.tm* %3)
%27 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%28 = call i32* @strptime(i8* %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %3)
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %16)
br label %48
33: ; preds = %25
%34 = call i32 @mktime(%struct.tm* %3)
%35 = call i64 @difftime(i32 %26, i32 %34)
%36 = icmp sgt i64 %35, 0
br i1 %36, label %37, label %48
37: ; preds = %33
%38 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
br label %39
39: ; preds = %37, %39
%40 = call i32 @mktime(%struct.tm* %3)
%41 = call i32 @strftime(i8* %6, i32 32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %struct.tm* %3)
%42 = load i32, i32* @stdout
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%44 = load i32, i32* %38
%45 = add nsw i32 %44, 1
store i32 %45, i32* %38
%46 = call i64 @difftime(i32 %26, i32 %40)
%47 = icmp sgt i64 %46, 0
br i1 %47, label %39, label %48
48: ; preds = %39, %33, %30, %22, %8
%49 = phi i32 [ 1, %8 ], [ 1, %22 ], [ 1, %30 ], [ 0, %33 ], [ 0, %39 ]
ret i32 %49
}