#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*/ fillMonth(int **, int, int);
int /*<<< orphan*/ printMonth(int **);
int /*<<< orphan*/ printf(char *);
int main() {
  int month[6][7];
  printf("     August 2013\n");
  fillMonth(month, 4, 31);
  printMonth(month);
  printf("     January 2014\n");
  fillMonth(month, 6, 31);
  printMonth(month);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1f,%edx
call   1040 <fillMonth@plt>
lea    -0xb0(%rbp),%rdi
call   1050 <printMonth@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x6,%esi
mov    $0x1f,%edx
call   1040 <fillMonth@plt>
lea    -0xb0(%rbp),%rdi
call   1050 <printMonth@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xb0,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1f,%edx
call   1040 <fillMonth@plt>
mov    %rbx,%rdi
call   1050 <printMonth@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1f,%edx
call   1040 <fillMonth@plt>
mov    %rbx,%rdi
call   1050 <printMonth@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c" August 2013\0A\00"
@.str.1 = [19 x i8] c" January 2014\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x [7 x i32]]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 0
%5 = bitcast [7 x i32]* %4 to i32**
%6 = call i32 @fillMonth(i32** %5, i32 4, i32 31)
%7 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 0
%8 = bitcast [7 x i32]* %7 to i32**
%9 = call i32 @printMonth(i32** %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 0
%12 = bitcast [7 x i32]* %11 to i32**
%13 = call i32 @fillMonth(i32** %12, i32 6, i32 31)
%14 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 0
%15 = bitcast [7 x i32]* %14 to i32**
%16 = call i32 @printMonth(i32** %15)
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c" August 2013\00"
@str.2 = [18 x i8] c" January 2014\00"
define i32 @main() {
%1 = alloca [6 x [7 x i32]]
%2 = bitcast [6 x [7 x i32]]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = bitcast [6 x [7 x i32]]* %1 to i32**
%5 = call i32 @fillMonth(i32** %4, i32 4, i32 31)
%6 = call i32 @printMonth(i32** %4)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
%8 = call i32 @fillMonth(i32** %4, i32 6, i32 31)
%9 = call i32 @printMonth(i32** %4)
ret i32 0
}