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

/* Variables and functions */
void CheckTime(struct tm *timeptr) {
  if (timeptr->tm_sec < 0)
    timeptr->tm_sec = 0;
  if (timeptr->tm_min < 0)
    timeptr->tm_min = 0;
  if (timeptr->tm_hour < 0)
    timeptr->tm_hour = 0;
  if (timeptr->tm_wday < 0)
    timeptr->tm_wday = 0;
  if (timeptr->tm_mon < 0)
    timeptr->tm_mon = 0;
  if (timeptr->tm_sec > 59)
    timeptr->tm_sec = 59;
  if (timeptr->tm_min > 59)
    timeptr->tm_min = 59;
  if (timeptr->tm_hour > 23)
    timeptr->tm_hour = 23;
  if (timeptr->tm_wday > 6)
    timeptr->tm_wday = 6;
  if (timeptr->tm_mday < 1)
    timeptr->tm_mday = 1;
  else if (timeptr->tm_mday > 31)
    timeptr->tm_mday = 31;
  if (timeptr->tm_mon > 11)
    timeptr->tm_mon = 11;
  if (timeptr->tm_year < 0)
    timeptr->tm_year = 0;
}


x86 assembly (clang, -O0):
<CheckTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jge    111f <CheckTime+0x1f>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jge    1138 <CheckTime+0x38>
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x8(%rax)
jge    1151 <CheckTime+0x51>
mov    -0x8(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0xc(%rax)
jge    116a <CheckTime+0x6a>
mov    -0x8(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x10(%rax)
jge    1183 <CheckTime+0x83>
mov    -0x8(%rbp),%rax
movl   $0x0,0x10(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x3b,(%rax)
jle    119a <CheckTime+0x9a>
mov    -0x8(%rbp),%rax
movl   $0x3b,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x3b,0x4(%rax)
jle    11b3 <CheckTime+0xb3>
mov    -0x8(%rbp),%rax
movl   $0x3b,0x4(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x17,0x8(%rax)
jle    11cc <CheckTime+0xcc>
mov    -0x8(%rbp),%rax
movl   $0x17,0x8(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x6,0xc(%rax)
jle    11e5 <CheckTime+0xe5>
mov    -0x8(%rbp),%rax
movl   $0x6,0xc(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x1,0x14(%rax)
jge    1203 <CheckTime+0x103>
mov    -0x8(%rbp),%rax
movl   $0x1,0x14(%rax)
jmp    1221 <CheckTime+0x121>
mov    -0x8(%rbp),%rax
cmpl   $0x1f,0x14(%rax)
jle    121c <CheckTime+0x11c>
mov    -0x8(%rbp),%rax
movl   $0x1f,0x14(%rax)
jmp    1221 <CheckTime+0x121>
mov    -0x8(%rbp),%rax
cmpl   $0xb,0x10(%rax)
jle    123a <CheckTime+0x13a>
mov    -0x8(%rbp),%rax
movl   $0xb,0x10(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x18(%rax)
jge    1255 <CheckTime+0x155>
mov    -0x8(%rbp),%rax
movq   $0x0,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckTime>:
mov    (%rdi),%r8d
test   %r8d,%r8d
jns    1111 <CheckTime+0x11>
movl   $0x0,(%rdi)
xor    %r8d,%r8d
mov    0x4(%rdi),%edx
test   %edx,%edx
jns    1121 <CheckTime+0x21>
movl   $0x0,0x4(%rdi)
xor    %edx,%edx
mov    0x8(%rdi),%esi
test   %esi,%esi
jns    1131 <CheckTime+0x31>
movl   $0x0,0x8(%rdi)
xor    %esi,%esi
mov    0xc(%rdi),%eax
test   %eax,%eax
jns    1141 <CheckTime+0x41>
movl   $0x0,0xc(%rdi)
xor    %eax,%eax
mov    0x10(%rdi),%ecx
test   %ecx,%ecx
js     1182 <CheckTime+0x82>
cmp    $0x3c,%r8d
jae    1191 <CheckTime+0x91>
cmp    $0x3c,%edx
jae    119c <CheckTime+0x9c>
cmp    $0x18,%esi
jae    11a8 <CheckTime+0xa8>
cmp    $0x7,%eax
jb     1164 <CheckTime+0x64>
movl   $0x6,0xc(%rdi)
mov    0x14(%rdi),%edx
test   %edx,%edx
jle    11b6 <CheckTime+0xb6>
mov    $0x1f,%eax
cmp    $0x20,%edx
jae    11bb <CheckTime+0xbb>
cmp    $0xc,%ecx
jae    11c3 <CheckTime+0xc3>
cmpq   $0x0,0x18(%rdi)
js     11d1 <CheckTime+0xd1>
ret
movl   $0x0,0x10(%rdi)
xor    %ecx,%ecx
cmp    $0x3c,%r8d
jb     114e <CheckTime+0x4e>
movl   $0x3b,(%rdi)
cmp    $0x3c,%edx
jb     1153 <CheckTime+0x53>
movl   $0x3b,0x4(%rdi)
cmp    $0x18,%esi
jb     1158 <CheckTime+0x58>
movl   $0x17,0x8(%rdi)
cmp    $0x7,%eax
jae    115d <CheckTime+0x5d>
jmp    1164 <CheckTime+0x64>
mov    $0x1,%eax
mov    %eax,0x14(%rdi)
cmp    $0xc,%ecx
jb     117a <CheckTime+0x7a>
movl   $0xb,0x10(%rdi)
cmpq   $0x0,0x18(%rdi)
jns    1181 <CheckTime+0x81>
movq   $0x0,0x18(%rdi)
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i64 }
define void @CheckTime(%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, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load %struct.tm*, %struct.tm** %2
%9 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 0
store i32 0, i32* %9
br label %10
10: ; preds = %7, %1
%11 = load %struct.tm*, %struct.tm** %2
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load %struct.tm*, %struct.tm** %2
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 1
store i32 0, i32* %17
br label %18
18: ; preds = %15, %10
%19 = load %struct.tm*, %struct.tm** %2
%20 = getelementptr inbounds %struct.tm, %struct.tm* %19, i32 0, i32 2
%21 = load i32, i32* %20
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load %struct.tm*, %struct.tm** %2
%25 = getelementptr inbounds %struct.tm, %struct.tm* %24, i32 0, i32 2
store i32 0, i32* %25
br label %26
26: ; preds = %23, %18
%27 = load %struct.tm*, %struct.tm** %2
%28 = getelementptr inbounds %struct.tm, %struct.tm* %27, i32 0, i32 3
%29 = load i32, i32* %28
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %26
%32 = load %struct.tm*, %struct.tm** %2
%33 = getelementptr inbounds %struct.tm, %struct.tm* %32, i32 0, i32 3
store i32 0, i32* %33
br label %34
34: ; preds = %31, %26
%35 = load %struct.tm*, %struct.tm** %2
%36 = getelementptr inbounds %struct.tm, %struct.tm* %35, i32 0, i32 4
%37 = load i32, i32* %36
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %34
%40 = load %struct.tm*, %struct.tm** %2
%41 = getelementptr inbounds %struct.tm, %struct.tm* %40, i32 0, i32 4
store i32 0, i32* %41
br label %42
42: ; preds = %39, %34
%43 = load %struct.tm*, %struct.tm** %2
%44 = getelementptr inbounds %struct.tm, %struct.tm* %43, i32 0, i32 0
%45 = load i32, i32* %44
%46 = icmp sgt i32 %45, 59
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = load %struct.tm*, %struct.tm** %2
%49 = getelementptr inbounds %struct.tm, %struct.tm* %48, i32 0, i32 0
store i32 59, i32* %49
br label %50
50: ; preds = %47, %42
%51 = load %struct.tm*, %struct.tm** %2
%52 = getelementptr inbounds %struct.tm, %struct.tm* %51, i32 0, i32 1
%53 = load i32, i32* %52
%54 = icmp sgt i32 %53, 59
br i1 %54, label %55, label %58
55: ; preds = %50
%56 = load %struct.tm*, %struct.tm** %2
%57 = getelementptr inbounds %struct.tm, %struct.tm* %56, i32 0, i32 1
store i32 59, i32* %57
br label %58
58: ; preds = %55, %50
%59 = load %struct.tm*, %struct.tm** %2
%60 = getelementptr inbounds %struct.tm, %struct.tm* %59, i32 0, i32 2
%61 = load i32, i32* %60
%62 = icmp sgt i32 %61, 23
br i1 %62, label %63, label %66
63: ; preds = %58
%64 = load %struct.tm*, %struct.tm** %2
%65 = getelementptr inbounds %struct.tm, %struct.tm* %64, i32 0, i32 2
store i32 23, i32* %65
br label %66
66: ; preds = %63, %58
%67 = load %struct.tm*, %struct.tm** %2
%68 = getelementptr inbounds %struct.tm, %struct.tm* %67, i32 0, i32 3
%69 = load i32, i32* %68
%70 = icmp sgt i32 %69, 6
br i1 %70, label %71, label %74
71: ; preds = %66
%72 = load %struct.tm*, %struct.tm** %2
%73 = getelementptr inbounds %struct.tm, %struct.tm* %72, i32 0, i32 3
store i32 6, i32* %73
br label %74
74: ; preds = %71, %66
%75 = load %struct.tm*, %struct.tm** %2
%76 = getelementptr inbounds %struct.tm, %struct.tm* %75, i32 0, i32 5
%77 = load i32, i32* %76
%78 = icmp slt i32 %77, 1
br i1 %78, label %79, label %82
79: ; preds = %74
%80 = load %struct.tm*, %struct.tm** %2
%81 = getelementptr inbounds %struct.tm, %struct.tm* %80, i32 0, i32 5
store i32 1, i32* %81
br label %91
82: ; preds = %74
%83 = load %struct.tm*, %struct.tm** %2
%84 = getelementptr inbounds %struct.tm, %struct.tm* %83, i32 0, i32 5
%85 = load i32, i32* %84
%86 = icmp sgt i32 %85, 31
br i1 %86, label %87, label %90
87: ; preds = %82
%88 = load %struct.tm*, %struct.tm** %2
%89 = getelementptr inbounds %struct.tm, %struct.tm* %88, i32 0, i32 5
store i32 31, i32* %89
br label %90
90: ; preds = %87, %82
br label %91
91: ; preds = %90, %79
%92 = load %struct.tm*, %struct.tm** %2
%93 = getelementptr inbounds %struct.tm, %struct.tm* %92, i32 0, i32 4
%94 = load i32, i32* %93
%95 = icmp sgt i32 %94, 11
br i1 %95, label %96, label %99
96: ; preds = %91
%97 = load %struct.tm*, %struct.tm** %2
%98 = getelementptr inbounds %struct.tm, %struct.tm* %97, i32 0, i32 4
store i32 11, i32* %98
br label %99
99: ; preds = %96, %91
%100 = load %struct.tm*, %struct.tm** %2
%101 = getelementptr inbounds %struct.tm, %struct.tm* %100, i32 0, i32 6
%102 = load i64, i64* %101
%103 = icmp slt i64 %102, 0
br i1 %103, label %104, label %107
104: ; preds = %99
%105 = load %struct.tm*, %struct.tm** %2
%106 = getelementptr inbounds %struct.tm, %struct.tm* %105, i32 0, i32 6
store i64 0, i64* %106
br label %107
107: ; preds = %104, %99
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i64 }
define void @CheckTime(%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, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 0, i32* %2
br label %6
6: ; preds = %5, %1
%7 = phi i32 [ 0, %5 ], [ %3, %1 ]
%8 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6
store i32 0, i32* %8
br label %12
12: ; preds = %11, %6
%13 = phi i32 [ 0, %11 ], [ %9, %6 ]
%14 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%15 = load i32, i32* %14
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %14
br label %18
18: ; preds = %17, %12
%19 = phi i32 [ 0, %17 ], [ %15, %12 ]
%20 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 3
%21 = load i32, i32* %20
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 0, i32* %20
br label %24
24: ; preds = %23, %18
%25 = phi i32 [ 0, %23 ], [ %21, %18 ]
%26 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 4
%27 = load i32, i32* %26
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %24
store i32 0, i32* %26
br label %30
30: ; preds = %29, %24
%31 = phi i32 [ 0, %29 ], [ %27, %24 ]
%32 = icmp ugt i32 %7, 59
br i1 %32, label %33, label %34
33: ; preds = %30
store i32 59, i32* %2
br label %34
34: ; preds = %33, %30
%35 = icmp ugt i32 %13, 59
br i1 %35, label %36, label %37
36: ; preds = %34
store i32 59, i32* %8
br label %37
37: ; preds = %36, %34
%38 = icmp ugt i32 %19, 23
br i1 %38, label %39, label %40
39: ; preds = %37
store i32 23, i32* %14
br label %40
40: ; preds = %39, %37
%41 = icmp ugt i32 %25, 6
br i1 %41, label %42, label %43
42: ; preds = %40
store i32 6, i32* %20
br label %43
43: ; preds = %42, %40
%44 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 5
%45 = load i32, i32* %44
%46 = icmp slt i32 %45, 1
br i1 %46, label %49, label %47
47: ; preds = %43
%48 = icmp ugt i32 %45, 31
br i1 %48, label %49, label %51
49: ; preds = %47, %43
%50 = phi i32 [ 1, %43 ], [ 31, %47 ]
store i32 %50, i32* %44
br label %51
51: ; preds = %49, %47
%52 = icmp ugt i32 %31, 11
br i1 %52, label %53, label %54
53: ; preds = %51
store i32 11, i32* %26
br label %54
54: ; preds = %53, %51
%55 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 6
%56 = load i64, i64* %55
%57 = icmp slt i64 %56, 0
br i1 %57, label %58, label %59
58: ; preds = %54
store i64 0, i64* %55
br label %59
59: ; preds = %58, %54
ret void
}