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

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ memset(struct tm *, int /*<<< orphan*/, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ strptime(char *, char *, struct tm *);
int main(int argc, char **argv) {
  struct tm tm;
  char buf[255];
  memset(&tm, 0, sizeof(tm));
  strptime("11:14", "%R", &tm);
  strftime(buf, sizeof(buf), "%H:%M", &tm);
  puts(buf);
  puts(!strcmp(buf, "11:14") ? "OK" : "FAILED");
  memset(&tm, 0, sizeof(tm));
  strptime("09:41:53", "%T", &tm);
  strftime(buf, sizeof(buf), "%H:%M:%S", &tm);
  puts(buf);
  puts(!strcmp(buf, "09:41:53") ? "OK" : "FAILED");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0xe80(%rip),%rdi
lea    0xe7f(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1070 <strptime@plt>
lea    -0x120(%rbp),%rdi
mov    $0xff,%esi
lea    0xe66(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1060 <strftime@plt>
lea    -0x120(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x120(%rbp),%rdi
lea    0xe3a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
setne  %cl
xor    $0xff,%cl
lea    0xe37(%rip),%rdi
lea    0xe2d(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdi
call   1030 <puts@plt>
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0xe14(%rip),%rdi
lea    0xe16(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1070 <strptime@plt>
lea    -0x120(%rbp),%rdi
mov    $0xff,%esi
lea    0xdfd(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1060 <strftime@plt>
lea    -0x120(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x120(%rbp),%rdi
lea    0xdce(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
setne  %cl
xor    $0xff,%cl
lea    0xdb2(%rip),%rdi
lea    0xda8(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdi
call   1030 <puts@plt>
mov    0x2d66(%rip),%rax
mov    (%rax),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x118,%rsp
lea    0x8(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0xe97(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    %r15,%rdx
call   1060 <strptime@plt>
lea    0xe8a(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r15,%rcx
call   1050 <strftime@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    $0x313a3131,%eax
xor    0x10(%rsp),%eax
movzwl 0x14(%rsp),%ecx
xor    $0x34,%ecx
or     %eax,%ecx
lea    0xe59(%rip),%r12
lea    0xe55(%rip),%rbx
mov    %rbx,%rdi
cmove  %r12,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0xe3a(%rip),%rdi
lea    0xe3c(%rip),%rsi
mov    %r15,%rdx
call   1060 <strptime@plt>
lea    0xe30(%rip),%rdx
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r15,%rcx
call   1050 <strftime@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
movabs $0x33353a31343a3930,%rax
3a 35 33
xor    0x10(%rsp),%rax
movzbl 0x18(%rsp),%ecx
or     %rax,%rcx
cmove  %r12,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [6 x i8] c"11:14\00"
@.str.1 = [3 x i8] c"%R\00"
@.str.2 = [6 x i8] c"%H:%M\00"
@.str.3 = [3 x i8] c"OK\00"
@.str.4 = [7 x i8] c"FAILED\00"
@.str.5 = [9 x i8] c"09:41:53\00"
@.str.6 = [3 x i8] c"%T\00"
@.str.7 = [9 x i8] c"%H:%M:%S\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.tm
%7 = alloca [255 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @memset(%struct.tm* %6, i32 0, i32 4)
%9 = call i32 @strptime(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %6)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%11 = call i32 @strftime(i8* %10, i32 255, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %struct.tm* %6)
%12 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%13 = call i32 @puts(i8* %12)
%14 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i64
%19 = select i1 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%20 = call i32 @puts(i8* %19)
%21 = call i32 @memset(%struct.tm* %6, i32 0, i32 4)
%22 = call i32 @strptime(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %struct.tm* %6)
%23 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%24 = call i32 @strftime(i8* %23, i32 255, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), %struct.tm* %6)
%25 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%26 = call i32 @puts(i8* %25)
%27 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
%30 = xor i1 %29, true
%31 = zext i1 %30 to i64
%32 = select i1 %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%33 = call i32 @puts(i8* %32)
%34 = load i32, i32* @EXIT_SUCCESS
ret i32 %34
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [6 x i8] c"11:14\00"
@.str.1 = [3 x i8] c"%R\00"
@.str.2 = [6 x i8] c"%H:%M\00"
@.str.3 = [3 x i8] c"OK\00"
@.str.4 = [7 x i8] c"FAILED\00"
@.str.5 = [9 x i8] c"09:41:53\00"
@.str.6 = [3 x i8] c"%T\00"
@.str.7 = [9 x i8] c"%H:%M:%S\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.tm
%4 = alloca [255 x i8]
%5 = bitcast %struct.tm* %3 to i8*
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%7 = call i32 @memset(%struct.tm* %3, i32 0, i32 4)
%8 = call i32 @strptime(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %3)
%9 = call i32 @strftime(i8* %6, i32 255, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %struct.tm* %3)
%10 = call i32 @puts(i8* %6)
%11 = call i32 @bcmp(i8* dereferenceable(6) %6, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%14 = call i32 @puts(i8* dereferenceable(1) %13)
%15 = call i32 @memset(%struct.tm* %3, i32 0, i32 4)
%16 = call i32 @strptime(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %struct.tm* %3)
%17 = call i32 @strftime(i8* %6, i32 255, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), %struct.tm* %3)
%18 = call i32 @puts(i8* %6)
%19 = call i32 @bcmp(i8* dereferenceable(9) %6, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i64 9)
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%22 = call i32 @puts(i8* dereferenceable(1) %21)
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}