#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*/ cal_tzolkin(int, char *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int i = 0, num, haab_day, haab_year;
  char haab_mon[10];
  scanf("%d", &num);
  printf("%d\n", num);
  while (i++ < num) {
    scanf("%d. %s %d", &haab_day, haab_mon, &haab_year);
    cal_tzolkin(haab_day, haab_mon, haab_year);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xebe(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    -0xc(%rbp),%eax
jge    11a9 <main+0x79>
lea    -0x1e(%rbp),%rdx
lea    0xe7e(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rcx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x10(%rbp),%edi
lea    -0x1e(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <cal_tzolkin@plt>
jmp    1167 <main+0x37>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0xec8(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11ac <main+0x7c>
lea    0xe97(%rip),%r14
lea    0x10(%rsp),%r15
lea    0x16(%rsp),%rbx
lea    0xc(%rsp),%r12
xor    %ebp,%ebp
xchg   %ax,%ax
add    $0x1,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%edx
mov    %rbx,%rsi
call   1040 <cal_tzolkin@plt>
cmp    0x8(%rsp),%ebp
jl     1180 <main+0x50>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [10 x i8] c"%d. %s %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [10 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %15, %0
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %22
15: ; preds = %10
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32* %4, i8* %16, i32* %5)
%18 = load i32, i32* %4
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%20 = load i32, i32* %5
%21 = call i32 @cal_tzolkin(i32 %18, i8* %19, i32 %20)
br label %10
22: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [10 x i8] c"%d. %s %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i8]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %0, %14
%15 = phi i32 [ %16, %14 ], [ 0, %0 ]
%16 = add nuw nsw i32 %15, 1
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32* %2, i8* %8, i32* %3)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = call i32 @cal_tzolkin(i32 %18, i8* %8, i32 %19)
%21 = load i32, i32* %1
%22 = icmp slt i32 %16, %21
br i1 %22, label %14, label %23
23: ; preds = %14, %0
ret i32 0
}