#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*/ periods;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main() {
  typedef struct {
    int day;
    int hh_on;
    int mm_on;
    int hh_off;
    int mm_off;
  } period;
  period periods[] = {
      {5729, 11, 00, 14, 59},
      {5729, 15, 15, 16, 59},
  };
  printf("Hello, world\n");
  int count = sizeof(periods) / sizeof(periods[0]);
  int i = 0;
  for (i = 0; i < count; ++i) {
    period p = periods[i];
    int day = p.day;
    int hh_on = p.hh_on;
    int mm_on = p.mm_on;
    int hh_off = p.hh_off;
    int mm_off = p.mm_off;
    printf("Day: %i hh:mm on %02i:%02i, hh:mm off %02i:%02i\n", day, hh_on,
           mm_on, hh_off, mm_off);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    11db <main+0xbb>
movslq -0x38(%rbp),%rcx
lea    -0x30(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%rcx
mov    %rcx,-0x50(%rbp)
mov    0x8(%rax),%rcx
mov    %rcx,-0x48(%rbp)
mov    0x10(%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x50(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%r8d
mov    -0x64(%rbp),%r9d
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1160 <main+0x40>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1661,%esi
mov    $0xb,%edx
xor    %ecx,%ecx
mov    $0xe,%r8d
mov    $0x3b,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1661,%esi
mov    $0xf,%edx
mov    $0xf,%ecx
mov    $0x10,%r8d
mov    $0x3b,%r9d
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.period = type { i32, i32, i32, i32, i32 }
@__const.main.periods = [2 x %struct.period] [%struct.period { i32 5729, i32 11, i32 0, i32 14, i32 59 }, %struct.period { i32 5729, i32 15, i32 15, i32 16, i32 59 }]
@.str = [14 x i8] c"Hello, world\0A\00"
@.str.1 = [49 x i8] c"Day: %i hh:mm on %02i:%02i, hh:mm off %02i:%02i\0A\00"
define void @main() {
%1 = alloca [2 x %struct.period]
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.period
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = bitcast [2 x %struct.period]* %1 to i8*
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %12
12: ; preds = %38, %0
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %41
16: ; preds = %12
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [2 x %struct.period], [2 x %struct.period]* %1, i64 0, i64 %18
%20 = bitcast %struct.period* %4 to i8*
%21 = bitcast %struct.period* %19 to i8*
%22 = getelementptr inbounds %struct.period, %struct.period* %4, i32 0, i32 0
%23 = load i32, i32* %22
store i32 %23, i32* %5
%24 = getelementptr inbounds %struct.period, %struct.period* %4, i32 0, i32 1
%25 = load i32, i32* %24
store i32 %25, i32* %6
%26 = getelementptr inbounds %struct.period, %struct.period* %4, i32 0, i32 2
%27 = load i32, i32* %26
store i32 %27, i32* %7
%28 = getelementptr inbounds %struct.period, %struct.period* %4, i32 0, i32 3
%29 = load i32, i32* %28
store i32 %29, i32* %8
%30 = getelementptr inbounds %struct.period, %struct.period* %4, i32 0, i32 4
%31 = load i32, i32* %30
store i32 %31, i32* %9
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = load i32, i32* %8
%36 = load i32, i32* %9
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 %32, i32 %33, i32 %34, i32 %35, i32 %36)
br label %38
38: ; preds = %16
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %12
41: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str.1 = [49 x i8] c"Day: %i hh:mm on %02i:%02i, hh:mm off %02i:%02i\0A\00"
@str = [13 x i8] c"Hello, world\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 5729, i32 11, i32 0, i32 14, i32 59)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 5729, i32 15, i32 15, i32 16, i32 59)
ret void
}