#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 */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ strptime(char const *, char *, struct tm *);
int main(void) {
  struct tm stm;
  const char *src_str = "2015/06/01 12:00:00";
  char dest_str[64];
  strptime(src_str, "%Y/%m/%d %H:%M:%S", &stm);
  strftime(dest_str, 64, "%Y年%m月%d日 %H時%M分%S秒", &stm);
  printf("%s\n", dest_str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebf(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <strptime@plt>
lea    -0x50(%rbp),%rdi
mov    $0x40,%esi
lea    0xeb8(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <strftime@plt>
lea    -0x50(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
lea    0xec2(%rip),%rdi
lea    0xecf(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdx
call   1050 <strptime@plt>
lea    0xecd(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r14,%rcx
call   1040 <strftime@plt>
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [20 x i8] c"2015/06/01 12:00:00\00"
@.str.1 = [18 x i8] c"%Y/%m/%d %H:%M:%S\00"
@.str.2 = [32 x i8] c"%Y\E5\B9\B4%m\E6\9C\88%d\E6\97\A5 %H\E6\99\82%M\E5\88\86%S\E7\A7\92\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = alloca i8*
%4 = alloca [64 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strptime(i8* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %2)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%8 = call i32 @strftime(i8* %7, i32 64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), %struct.tm* %2)
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [20 x i8] c"2015/06/01 12:00:00\00"
@.str.1 = [18 x i8] c"%Y/%m/%d %H:%M:%S\00"
@.str.2 = [32 x i8] c"%Y\E5\B9\B4%m\E6\9C\88%d\E6\97\A5 %H\E6\99\82%M\E5\88\86%S\E7\A7\92\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca %struct.tm
%2 = alloca [64 x i8]
%3 = bitcast %struct.tm* %1 to i8*
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = call i32 @strptime(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %1)
%6 = call i32 @strftime(i8* %4, i32 64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), %struct.tm* %1)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %4)
ret i32 0
}