#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 */
char *pipe2string(char *);
scalar_t__ strcmp(char *, char *);
void set_default_dates(char **begin_date_string, char **begin_time_string,
                       char **end_date_string, char **end_time_string) {
  char *sys_string;
  if (!**begin_date_string || strcmp(*begin_date_string, "begin_date") == 0) {
    sys_string = "now.sh ymd -30";
    *begin_date_string = pipe2string(sys_string);
  }
  if (!**begin_time_string || strcmp(*begin_time_string, "begin_time") == 0) {
    *begin_time_string = "0000";
  }
  if (!**end_date_string || strcmp(*end_date_string, "end_date") == 0) {
    sys_string = "now.sh ymd";
    *end_date_string = pipe2string(sys_string);
  }
  if (!**end_time_string || strcmp(*end_time_string, "end_time") == 0) {
    *end_time_string = "2359";
  }
}


x86 assembly (clang, -O0):
<set_default_dates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
je     1165 <set_default_dates+0x45>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1183 <set_default_dates+0x63>
lea    0xe9f(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <pipe2string@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
je     11b0 <set_default_dates+0x90>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe79(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11be <set_default_dates+0x9e>
mov    -0x10(%rbp),%rax
lea    0xe6a(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
je     11eb <set_default_dates+0xcb>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe4e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1209 <set_default_dates+0xe9>
lea    0xe41(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <pipe2string@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
je     1236 <set_default_dates+0x116>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xe17(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1244 <set_default_dates+0x124>
mov    -0x20(%rbp),%rax
lea    0xe06(%rip),%rcx
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_default_dates>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    (%rdi),%rdi
cmpb   $0x0,(%rdi)
je     114d <set_default_dates+0x2d>
lea    0xebd(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    115c <set_default_dates+0x3c>
lea    0xeb7(%rip),%rdi
call   1040 <pipe2string@plt>
mov    %rax,(%rbx)
mov    (%r12),%rdi
cmpb   $0x0,(%rdi)
je     1176 <set_default_dates+0x56>
lea    0xeae(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1181 <set_default_dates+0x61>
lea    0xea8(%rip),%rax
mov    %rax,(%r12)
mov    (%r15),%rdi
cmpb   $0x0,(%rdi)
je     119a <set_default_dates+0x7a>
lea    0xe9a(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11a9 <set_default_dates+0x89>
lea    0xe92(%rip),%rdi
call   1040 <pipe2string@plt>
mov    %rax,(%r15)
mov    (%r14),%rdi
cmpb   $0x0,(%rdi)
je     11c2 <set_default_dates+0xa2>
lea    0xe86(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11cc <set_default_dates+0xac>
lea    0xe7e(%rip),%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"begin_date\00"
@.str.1 = [15 x i8] c"now.sh ymd -30\00"
@.str.2 = [11 x i8] c"begin_time\00"
@.str.3 = [5 x i8] c"0000\00"
@.str.4 = [9 x i8] c"end_date\00"
@.str.5 = [11 x i8] c"now.sh ymd\00"
@.str.6 = [9 x i8] c"end_time\00"
@.str.7 = [5 x i8] c"2359\00"
define void @set_default_dates(i8** %0, i8** %1, i8** %2, i8** %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i8*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%10 = load i8**, i8*** %5
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %4
%15 = load i8**, i8*** %5
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %14, %4
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %9
%20 = load i8*, i8** %9
%21 = call i8* @pipe2string(i8* %20)
%22 = load i8**, i8*** %5
store i8* %21, i8** %22
br label %23
23: ; preds = %19, %14
%24 = load i8**, i8*** %6
%25 = load i8*, i8** %24
%26 = load i8, i8* %25
%27 = icmp ne i8 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %23
%29 = load i8**, i8*** %6
%30 = load i8*, i8** %29
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %28, %23
%34 = load i8**, i8*** %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %34
br label %35
35: ; preds = %33, %28
%36 = load i8**, i8*** %7
%37 = load i8*, i8** %36
%38 = load i8, i8* %37
%39 = icmp ne i8 %38, 0
br i1 %39, label %40, label %45
40: ; preds = %35
%41 = load i8**, i8*** %7
%42 = load i8*, i8** %41
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %40, %35
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8** %9
%46 = load i8*, i8** %9
%47 = call i8* @pipe2string(i8* %46)
%48 = load i8**, i8*** %7
store i8* %47, i8** %48
br label %49
49: ; preds = %45, %40
%50 = load i8**, i8*** %8
%51 = load i8*, i8** %50
%52 = load i8, i8* %51
%53 = icmp ne i8 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %49
%55 = load i8**, i8*** %8
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %54, %49
%60 = load i8**, i8*** %8
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %60
br label %61
61: ; preds = %59, %54
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"begin_date\00"
@.str.1 = [15 x i8] c"now.sh ymd -30\00"
@.str.2 = [11 x i8] c"begin_time\00"
@.str.3 = [5 x i8] c"0000\00"
@.str.4 = [9 x i8] c"end_date\00"
@.str.5 = [11 x i8] c"now.sh ymd\00"
@.str.6 = [9 x i8] c"end_time\00"
@.str.7 = [5 x i8] c"2359\00"
define void @set_default_dates(i8** nocapture %0, i8** nocapture %1, i8** nocapture %2, i8** nocapture %3) {
%5 = load i8*, i8** %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8, %4
%12 = tail call i8* @pipe2string(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i8* %12, i8** %0
br label %13
13: ; preds = %11, %8
%14 = load i8*, i8** %1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17, %13
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %1
br label %21
21: ; preds = %20, %17
%22 = load i8*, i8** %2
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %21
%26 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25, %21
%29 = tail call i8* @pipe2string(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
store i8* %29, i8** %2
br label %30
30: ; preds = %28, %25
%31 = load i8*, i8** %3
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %30
%35 = tail call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %34, %30
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %38
38: ; preds = %37, %34
ret void
}