#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 tm_wday;
  int tm_mon;
  int tm_mday;
  int tm_hour;
  int tm_min;
  int tm_year;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *,
                            int, int, int, int);
const char *mod_time_time(const struct tm *tm) {
  static char buf[32];
  static const char *dow[] = {"sun", "mon", "tue", "wed", "thu", "fri", "sat"};
  static const char *mon[] = {"jan", "feb", "mar", "apr", "may", "jun",
                              "jul", "aug", "sep", "oct", "nov", "dec"};
  assert(tm->tm_wday < 7 && tm->tm_mon < 12 && tm->tm_mday < 32 &&
         tm->tm_hour < 60 && tm->tm_min < 60 && tm->tm_year < 3000);
  snprintf(buf, sizeof buf, "%s %s %02d %d %02d:%02d", dow[tm->tm_wday],
           mon[tm->tm_mon], tm->tm_mday, tm->tm_year + 1900, tm->tm_hour,
           tm->tm_min);
  return buf;
}


x86 assembly (clang, -O0):
<mod_time_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x7,(%rcx)
mov    %al,-0x9(%rbp)
jge    119b <mod_time_time+0x7b>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0xc,0x4(%rcx)
mov    %al,-0x9(%rbp)
jge    119b <mod_time_time+0x7b>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x20,0x8(%rcx)
mov    %al,-0x9(%rbp)
jge    119b <mod_time_time+0x7b>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x3c,0xc(%rcx)
mov    %al,-0x9(%rbp)
jge    119b <mod_time_time+0x7b>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x3c,0x10(%rcx)
mov    %al,-0x9(%rbp)
jge    119b <mod_time_time+0x7b>
mov    -0x8(%rbp),%rax
cmpl   $0xbb8,0x14(%rax)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
lea    0x2e8a(%rip),%rax
mov    (%rax,%rcx,8),%rcx
mov    -0x8(%rbp),%rax
movslq 0x4(%rax),%rdx
lea    0x2eb7(%rip),%rax
mov    (%rax,%rdx,8),%r8
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%r11d
add    $0x76c,%r11d
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r10d
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
lea    0x2ef6(%rip),%rdi
mov    $0x20,%esi
lea    0xe46(%rip),%rdx
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <snprintf@plt>
lea    0x2ed1(%rip),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_time_time>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
cmpl   $0x6,(%rbx)
jg     1153 <mod_time_time+0x33>
cmpl   $0xb,0x4(%rbx)
jg     1153 <mod_time_time+0x33>
cmpl   $0x1f,0x8(%rbx)
jg     1153 <mod_time_time+0x33>
cmpl   $0x3b,0xc(%rbx)
jg     1153 <mod_time_time+0x33>
cmpl   $0x3b,0x10(%rbx)
jg     1153 <mod_time_time+0x33>
xor    %edi,%edi
cmpl   $0xbb8,0x14(%rbx)
setl   %dil
call   1040 <assert@plt>
movslq (%rbx),%rax
lea    0xe9e(%rip),%rdx
movslq (%rdx,%rax,4),%rcx
add    %rdx,%rcx
movslq 0x4(%rbx),%rax
lea    0xea8(%rip),%rdx
movslq (%rdx,%rax,4),%r8
mov    $0x76c,%eax
add    0x14(%rbx),%eax
add    %rdx,%r8
mov    0x8(%rbx),%r9d
mov    0xc(%rbx),%r10d
mov    0x10(%rbx),%ebx
sub    $0x8,%rsp
lea    0x2ea7(%rip),%r14
lea    0xef8(%rip),%rdx
mov    %r14,%rdi
mov    $0x20,%esi
push   %rbx
push   %r10
push   %rax
call   1030 <snprintf@plt>
add    $0x20,%rsp
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@mod_time_time.buf = internal global [32 x i8] zeroinitializer
@mod_time_time.dow = internal global [7 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0)]
@.str = [4 x i8] c"sun\00"
@.str.1 = [4 x i8] c"mon\00"
@.str.2 = [4 x i8] c"tue\00"
@.str.3 = [4 x i8] c"wed\00"
@.str.4 = [4 x i8] c"thu\00"
@.str.5 = [4 x i8] c"fri\00"
@.str.6 = [4 x i8] c"sat\00"
@mod_time_time.mon = internal global [12 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0)]
@.str.7 = [4 x i8] c"jan\00"
@.str.8 = [4 x i8] c"feb\00"
@.str.9 = [4 x i8] c"mar\00"
@.str.10 = [4 x i8] c"apr\00"
@.str.11 = [4 x i8] c"may\00"
@.str.12 = [4 x i8] c"jun\00"
@.str.13 = [4 x i8] c"jul\00"
@.str.14 = [4 x i8] c"aug\00"
@.str.15 = [4 x i8] c"sep\00"
@.str.16 = [4 x i8] c"oct\00"
@.str.17 = [4 x i8] c"nov\00"
@.str.18 = [4 x i8] c"dec\00"
@.str.19 = [24 x i8] c"%s %s %02d %d %02d:%02d\00"
define i8* @mod_time_time(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 7
br i1 %6, label %7, label %32
7: ; preds = %1
%8 = load %struct.tm*, %struct.tm** %2
%9 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, 12
br i1 %11, label %12, label %32
12: ; preds = %7
%13 = load %struct.tm*, %struct.tm** %2
%14 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 2
%15 = load i32, i32* %14
%16 = icmp slt i32 %15, 32
br i1 %16, label %17, label %32
17: ; preds = %12
%18 = load %struct.tm*, %struct.tm** %2
%19 = getelementptr inbounds %struct.tm, %struct.tm* %18, i32 0, i32 3
%20 = load i32, i32* %19
%21 = icmp slt i32 %20, 60
br i1 %21, label %22, label %32
22: ; preds = %17
%23 = load %struct.tm*, %struct.tm** %2
%24 = getelementptr inbounds %struct.tm, %struct.tm* %23, i32 0, i32 4
%25 = load i32, i32* %24
%26 = icmp slt i32 %25, 60
br i1 %26, label %27, label %32
27: ; preds = %22
%28 = load %struct.tm*, %struct.tm** %2
%29 = getelementptr inbounds %struct.tm, %struct.tm* %28, i32 0, i32 5
%30 = load i32, i32* %29
%31 = icmp slt i32 %30, 3000
br label %32
32: ; preds = %27, %22, %17, %12, %7, %1
%33 = phi i1 [ false, %22 ], [ false, %17 ], [ false, %12 ], [ false, %7 ], [ false, %1 ], [ %31, %27 ]
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = load %struct.tm*, %struct.tm** %2
%37 = getelementptr inbounds %struct.tm, %struct.tm* %36, i32 0, i32 0
%38 = load i32, i32* %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [7 x i8*], [7 x i8*]* @mod_time_time.dow, i64 0, i64 %39
%41 = load i8*, i8** %40
%42 = load %struct.tm*, %struct.tm** %2
%43 = getelementptr inbounds %struct.tm, %struct.tm* %42, i32 0, i32 1
%44 = load i32, i32* %43
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [12 x i8*], [12 x i8*]* @mod_time_time.mon, i64 0, i64 %45
%47 = load i8*, i8** %46
%48 = load %struct.tm*, %struct.tm** %2
%49 = getelementptr inbounds %struct.tm, %struct.tm* %48, i32 0, i32 2
%50 = load i32, i32* %49
%51 = load %struct.tm*, %struct.tm** %2
%52 = getelementptr inbounds %struct.tm, %struct.tm* %51, i32 0, i32 5
%53 = load i32, i32* %52
%54 = add nsw i32 %53, 1900
%55 = load %struct.tm*, %struct.tm** %2
%56 = getelementptr inbounds %struct.tm, %struct.tm* %55, i32 0, i32 3
%57 = load i32, i32* %56
%58 = load %struct.tm*, %struct.tm** %2
%59 = getelementptr inbounds %struct.tm, %struct.tm* %58, i32 0, i32 4
%60 = load i32, i32* %59
%61 = call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mod_time_time.buf, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0), i8* %41, i8* %47, i32 %50, i32 %54, i32 %57, i32 %60)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mod_time_time.buf, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@mod_time_time.buf = internal global [32 x i8] zeroinitializer
@reltable.mod_time_time = internal unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([7 x i32]* @reltable.mod_time_time to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([7 x i32]* @reltable.mod_time_time to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([7 x i32]* @reltable.mod_time_time to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([7 x i32]* @reltable.mod_time_time to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([7 x i32]* @reltable.mod_time_time to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([7 x i32]* @reltable.mod_time_time to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([7 x i32]* @reltable.mod_time_time to i64)) to i32)]
@.str = [4 x i8] c"sun\00"
@.str.1 = [4 x i8] c"mon\00"
@.str.2 = [4 x i8] c"tue\00"
@.str.3 = [4 x i8] c"wed\00"
@.str.4 = [4 x i8] c"thu\00"
@.str.5 = [4 x i8] c"fri\00"
@.str.6 = [4 x i8] c"sat\00"
@reltable.mod_time_time.20 = internal unnamed_addr constant [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.12 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.13 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.14 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.15 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.16 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.17 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.18 to i64), i64 ptrtoint ([12 x i32]* @reltable.mod_time_time.20 to i64)) to i32)]
@.str.7 = [4 x i8] c"jan\00"
@.str.8 = [4 x i8] c"feb\00"
@.str.9 = [4 x i8] c"mar\00"
@.str.10 = [4 x i8] c"apr\00"
@.str.11 = [4 x i8] c"may\00"
@.str.12 = [4 x i8] c"jun\00"
@.str.13 = [4 x i8] c"jul\00"
@.str.14 = [4 x i8] c"aug\00"
@.str.15 = [4 x i8] c"sep\00"
@.str.16 = [4 x i8] c"oct\00"
@.str.17 = [4 x i8] c"nov\00"
@.str.18 = [4 x i8] c"dec\00"
@.str.19 = [24 x i8] c"%s %s %02d %d %02d:%02d\00"
define i8* @mod_time_time(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 7
br i1 %4, label %5, label %26
5: ; preds = %1
%6 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = icmp slt i32 %7, 12
br i1 %8, label %9, label %26
9: ; preds = %5
%10 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%11 = load i32, i32* %10
%12 = icmp slt i32 %11, 32
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 3
%15 = load i32, i32* %14
%16 = icmp slt i32 %15, 60
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 4
%19 = load i32, i32* %18
%20 = icmp slt i32 %19, 60
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 5
%23 = load i32, i32* %22
%24 = icmp slt i32 %23, 3000
%25 = zext i1 %24 to i32
br label %26
26: ; preds = %21, %17, %13, %9, %5, %1
%27 = phi i32 [ 0, %17 ], [ 0, %13 ], [ 0, %9 ], [ 0, %5 ], [ 0, %1 ], [ %25, %21 ]
%28 = tail call i32 @assert(i32 %27)
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = shl i64 %30, 2
%32 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.mod_time_time to i8*), i64 %31)
%33 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%34 = load i32, i32* %33
%35 = sext i32 %34 to i64
%36 = shl i64 %35, 2
%37 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.mod_time_time.20 to i8*), i64 %36)
%38 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%39 = load i32, i32* %38
%40 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 5
%41 = load i32, i32* %40
%42 = add nsw i32 %41, 1900
%43 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 3
%44 = load i32, i32* %43
%45 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 4
%46 = load i32, i32* %45
%47 = tail call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mod_time_time.buf, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0), i8* %32, i8* %37, i32 %39, i32 %42, i32 %44, i32 %46)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mod_time_time.buf, i64 0, i64 0)
}