#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 */
struct tm {
  int dummy;
};

/* Variables and functions */
char *getHumanDate(char *, int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ strptime(char *, char *, struct tm *);
char *getYMDDate(char *pointer, int isCouncil) {
  char *humandate = getHumanDate(pointer, isCouncil);
  struct tm internaldate;
  static char ymddate[20] = {0};
  strptime(humandate, "%d %B %Y", &internaldate);
  strftime(ymddate, 20, "%Y%m%d", &internaldate);
  return ymddate;
}


x86 assembly (clang, -O0):
<getYMDDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <getHumanDate@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xea6(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <strptime@plt>
lea    0x2ee6(%rip),%rdi
mov    $0x14,%esi
lea    0xe93(%rip),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <strftime@plt>
lea    0x2eca(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getYMDDate>:
push   %r14
push   %rbx
push   %rax
call   1030 <getHumanDate@plt>
lea    0xec0(%rip),%rsi
mov    %rsp,%r14
mov    %rax,%rdi
mov    %r14,%rdx
call   1050 <strptime@plt>
lea    0x2efb(%rip),%rbx
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %r14,%rcx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@getYMDDate.ymddate = internal global [20 x i8] zeroinitializer
@.str = [9 x i8] c"%d %B %Y\00"
@.str.1 = [7 x i8] c"%Y%m%d\00"
define i8* @getYMDDate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.tm
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @getHumanDate(i8* %7, i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @strptime(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%12 = call i32 @strftime(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @getYMDDate.ymddate, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %6)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @getYMDDate.ymddate, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@getYMDDate.ymddate = internal global [20 x i8] zeroinitializer
@.str = [9 x i8] c"%d %B %Y\00"
@.str.1 = [7 x i8] c"%Y%m%d\00"
define i8* @getYMDDate(i8* %0, i32 %1) {
%3 = alloca %struct.tm
%4 = tail call i8* @getHumanDate(i8* %0, i32 %1)
%5 = bitcast %struct.tm* %3 to i8*
%6 = call i32 @strptime(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
%7 = call i32 @strftime(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @getYMDDate.ymddate, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %3)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @getYMDDate.ymddate, i64 0, i64 0)
}