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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_reminders(char date[365][12], char message[365][69],
                     int *reminders) {
  printf("\n-+- Date\t  Reminder\n");
  for (int i = 0; i < *reminders; i += 1) {
    printf("-!- %s -%s\n", date[i], message[i]);
  }
}


x86 assembly (clang, -O0):
<print_reminders>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1182 <print_reminders+0x72>
mov    -0x8(%rbp),%rsi
movslq -0x1c(%rbp),%rax
imul   $0xc,%rax,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
movslq -0x1c(%rbp),%rax
imul   $0x45,%rax,%rax
add    %rax,%rdx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1139 <print_reminders+0x29>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_reminders>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,(%r14)
jle    1174 <print_reminders+0x54>
lea    0xeb5(%rip),%r12
xor    %ebx,%ebx
nopl   (%rax)
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
movslq (%r14),%rax
add    $0xc,%r13
add    $0x45,%r15
cmp    %rax,%rbx
jl     1150 <print_reminders+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0A-+- Date\09 Reminder\0A\00"
@.str.1 = [12 x i8] c"-!- %s -%s\0A\00"
define void @print_reminders([12 x i8]* %0, [69 x i8]* %1, i32* %2) {
%4 = alloca [12 x i8]*
%5 = alloca [69 x i8]*
%6 = alloca i32*
%7 = alloca i32
store [12 x i8]* %0, [12 x i8]** %4
store [69 x i8]* %1, [69 x i8]** %5
store i32* %2, i32** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %9
9: ; preds = %26, %3
%10 = load i32, i32* %7
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %29
14: ; preds = %9
%15 = load [12 x i8]*, [12 x i8]** %4
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [12 x i8], [12 x i8]* %15, i64 %17
%19 = getelementptr inbounds [12 x i8], [12 x i8]* %18, i64 0, i64 0
%20 = load [69 x i8]*, [69 x i8]** %5
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [69 x i8], [69 x i8]* %20, i64 %22
%24 = getelementptr inbounds [69 x i8], [69 x i8]* %23, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* %24)
br label %26
26: ; preds = %14
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
br label %9
29: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"-!- %s -%s\0A\00"
@str = [21 x i8] c"\0A-+- Date\09 Reminder\00"
define void @print_reminders([12 x i8]* %0, [69 x i8]* %1, i32* nocapture %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %8, %3
ret void
8: ; preds = %3, %8
%9 = phi i64 [ %13, %8 ], [ 0, %3 ]
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %0, i64 %9, i64 0
%11 = getelementptr inbounds [69 x i8], [69 x i8]* %1, i64 %9, i64 0
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %13, %15
br i1 %16, label %8, label %7
}