#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 plant {
  int dummy;
};
struct date_list {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/
add_direct_sown_plant_dates_to_list(struct plant *, struct date_list **, int);
int /*<<< orphan*/ add_harvest_dates_to_list(struct plant *,
                                             struct date_list **);
int /*<<< orphan*/ add_indoor_plant_dates_to_list(struct plant *,
                                                  struct date_list **, int);
int /*<<< orphan*/ calculate_plant_dates(struct plant *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ make_icalendar(struct date_list *);
struct plant *parse_and_create_plant(int /*<<< orphan*/ *);
int /*<<< orphan*/ print_action_dates(struct plant *);
int /*<<< orphan*/ print_by_month_calendar(struct date_list *);
unsigned int printf(char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  FILE *fp;
  struct plant *new_plant;
  struct date_list *sprouting_list_head = NULL;
  struct date_list *action_list_head = NULL;
  struct date_list *harvest_list_head = NULL;
  unsigned int chars_printed;
  unsigned int calendar_bitmask = 0;
  int i;
  int use_ical = 0;
  if (argc < 2) {
    printf("Help: plant <file> [output type] [options]...\n");
    printf("Where [output type] can be:\n");
    printf("  p for a by-plant calendar\n");
    printf("  m for a by-month calendar\n");
    printf("  h for a harvest calendar\n");
    printf("  s for a seed sprouting calendar\n");
    printf("Where [options] can be:\n");
    printf("  i to use ical format instead of plain text\n");
    return -1;
  }
  fp = fopen(argv[1], "r");
  if (!fp) {
    printf("Bad file.\n");
    return -1;
  }
  for (i = 2; i < (2 + 4) && i < argc; i++) {
    if (!strcmp(argv[i], "p") || !strcmp(argv[i], "-p"))
      calendar_bitmask |= (1 << 0);
    if (!strcmp(argv[i], "m") || !strcmp(argv[i], "-m"))
      calendar_bitmask |= (1 << 1);
    if (!strcmp(argv[i], "h") || !strcmp(argv[i], "-h"))
      calendar_bitmask |= (1 << 2);
    if (!strcmp(argv[i], "s") || !strcmp(argv[i], "-s"))
      calendar_bitmask |= (1 << 3);
    if (!strcmp(argv[i], "i") || !strcmp(argv[i], "-i"))
      use_ical = 1;
  }
  while (1) {
    new_plant = parse_and_create_plant(fp);
    if (!new_plant)
      break;
    calculate_plant_dates(new_plant);
    if (calendar_bitmask & (1 << 0)) {
      printf("\n");
      print_action_dates(new_plant);
      printf("\n");
    }
    if (calendar_bitmask & (1 << 1)) {
      if (!add_indoor_plant_dates_to_list(new_plant, &action_list_head, 1))
        return -1;
      if (!add_direct_sown_plant_dates_to_list(new_plant, &action_list_head, 1))
        return -1;
    }
    if (calendar_bitmask & (1 << 3)) {
      if (!add_indoor_plant_dates_to_list(new_plant, &sprouting_list_head, 0))
        return -1;
      if (!add_direct_sown_plant_dates_to_list(new_plant, &sprouting_list_head,
                                               0))
        return -1;
    }
    if (calendar_bitmask & (1 << 2)) {
      if (!add_harvest_dates_to_list(new_plant, &harvest_list_head))
        return -1;
    }
  }
  if (calendar_bitmask & (1 << 1)) {
    if (use_ical)
      make_icalendar(action_list_head);
    else {
      chars_printed = printf("\n\nGarden Action Items Calendar\n");
      for (; chars_printed > 3; chars_printed--)
        putchar('*');
      printf("\n");
      print_by_month_calendar(action_list_head);
    }
  }
  if (calendar_bitmask & (1 << 3)) {
    if (use_ical)
      make_icalendar(sprouting_list_head);
    else {
      chars_printed = printf("\n\nSeed Sprouting Calendar\n");
      for (; chars_printed > 3; chars_printed--)
        putchar('*');
      printf("\n");
      print_by_month_calendar(sprouting_list_head);
    }
  }
  if (calendar_bitmask & (1 << 2)) {
    if (use_ical)
      make_icalendar(harvest_list_head);
    else {
      chars_printed = printf("\n\nHarvest Calendar\n");
      for (; chars_printed > 3; chars_printed--)
        putchar('*');
      printf("\n");
      print_by_month_calendar(harvest_list_head);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1272 <main+0xb2>
lea    0xdf3(%rip),%rdi
call   1040 <printf@plt>
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
lea    0xe38(%rip),%rdi
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1718 <main+0x558>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8b(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12ad <main+0xed>
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1718 <main+0x558>
movl   $0x2,-0x44(%rbp)
xor    %eax,%eax
cmpl   $0x6,-0x44(%rbp)
mov    %al,-0x49(%rbp)
jge    12cf <main+0x10f>
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%al
test   $0x1,%al
jne    12df <main+0x11f>
jmp    1467 <main+0x2a7>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe28(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
je     1321 <main+0x161>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe06(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    132a <main+0x16a>
mov    -0x40(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xde0(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
je     136c <main+0x1ac>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdbe(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    1375 <main+0x1b5>
mov    -0x40(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd98(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
je     13b7 <main+0x1f7>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd76(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    13c0 <main+0x200>
mov    -0x40(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd50(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
je     1402 <main+0x242>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd2e(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    140b <main+0x24b>
mov    -0x40(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd08(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
je     144d <main+0x28d>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xce6(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    1454 <main+0x294>
movl   $0x1,-0x48(%rbp)
jmp    1459 <main+0x299>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12b4 <main+0xf4>
jmp    146c <main+0x2ac>
mov    -0x18(%rbp),%rdi
call   10e0 <parse_and_create_plant@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1489 <main+0x2c9>
jmp    15bb <main+0x3fb>
mov    -0x20(%rbp),%rdi
call   1060 <calculate_plant_dates@plt>
mov    -0x40(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     14c2 <main+0x302>
lea    0xb85(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1070 <print_action_dates@plt>
lea    0xb70(%rip),%rdi
call   1040 <printf@plt>
mov    -0x40(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1524 <main+0x364>
mov    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   10a0 <add_indoor_plant_dates_to_list@plt>
cmp    $0x0,%eax
jne    14f8 <main+0x338>
movl   $0xffffffff,-0x4(%rbp)
jmp    1718 <main+0x558>
mov    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   10b0 <add_direct_sown_plant_dates_to_list@plt>
cmp    $0x0,%eax
jne    151f <main+0x35f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1718 <main+0x558>
jmp    1524 <main+0x364>
mov    -0x40(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1580 <main+0x3c0>
mov    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   10a0 <add_indoor_plant_dates_to_list@plt>
cmp    $0x0,%eax
jne    1557 <main+0x397>
movl   $0xffffffff,-0x4(%rbp)
jmp    1718 <main+0x558>
mov    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   10b0 <add_direct_sown_plant_dates_to_list@plt>
cmp    $0x0,%eax
jne    157b <main+0x3bb>
movl   $0xffffffff,-0x4(%rbp)
jmp    1718 <main+0x558>
jmp    1580 <main+0x3c0>
mov    -0x40(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     15b6 <main+0x3f6>
mov    -0x20(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1080 <add_harvest_dates_to_list@plt>
cmp    $0x0,%eax
jne    15b1 <main+0x3f1>
movl   $0xffffffff,-0x4(%rbp)
jmp    1718 <main+0x558>
jmp    15b6 <main+0x3f6>
jmp    146c <main+0x2ac>
mov    -0x40(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     162d <main+0x46d>
cmpl   $0x0,-0x48(%rbp)
je     15e2 <main+0x422>
mov    -0x30(%rbp),%rdi
call   10c0 <make_icalendar@plt>
jmp    1628 <main+0x468>
lea    0xb3f(%rip),%rdi
call   1040 <printf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jbe    1613 <main+0x453>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    15f1 <main+0x431>
lea    0xa13(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1050 <print_by_month_calendar@plt>
jmp    162d <main+0x46d>
mov    -0x40(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     169f <main+0x4df>
cmpl   $0x0,-0x48(%rbp)
je     1654 <main+0x494>
mov    -0x28(%rbp),%rdi
call   10c0 <make_icalendar@plt>
jmp    169a <main+0x4da>
lea    0xaed(%rip),%rdi
call   1040 <printf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jbe    1685 <main+0x4c5>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    1663 <main+0x4a3>
lea    0x9a1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <print_by_month_calendar@plt>
jmp    169f <main+0x4df>
mov    -0x40(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1711 <main+0x551>
cmpl   $0x0,-0x48(%rbp)
je     16c6 <main+0x506>
mov    -0x38(%rbp),%rdi
call   10c0 <make_icalendar@plt>
jmp    170c <main+0x54c>
lea    0xa96(%rip),%rdi
call   1040 <printf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jbe    16f7 <main+0x537>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    16d5 <main+0x515>
lea    0x92f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1050 <print_by_month_calendar@plt>
jmp    1711 <main+0x551>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
cmp    $0x1,%edi
jg     125e <main+0x8e>
lea    0xe63(%rip),%rdi
call   1040 <puts@plt>
lea    0xe85(%rip),%rdi
call   1040 <puts@plt>
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
lea    0xeda(%rip),%rdi
call   1040 <puts@plt>
lea    0xee6(%rip),%rdi
jmp    14a7 <main+0x2d7>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xeb7(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     14a0 <main+0x2d0>
xor    %r12d,%r12d
movl   $0x0,0x4(%rsp)
cmp    $0x3,%ebp
jb     13b1 <main+0x1e1>
add    $0xfffffffd,%ebp
cmp    $0x3,%ebp
mov    $0x3,%r13d
cmovb  %ebp,%r13d
add    $0x1,%r13
xor    %ebp,%ebp
lea    0xd5b(%rip),%r14
movl   $0x0,0x4(%rsp)
xor    %r12d,%r12d
jmp    12d5 <main+0x105>
nop
movl   $0x1,0x4(%rsp)
add    $0x1,%rbp
cmp    %rbp,%r13
je     13b1 <main+0x1e1>
mov    0x10(%rbx,%rbp,8),%r15
mov    %r15,%rdi
lea    0xd1d(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     1300 <main+0x130>
mov    %r15,%rdi
lea    0xd09(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
jne    1304 <main+0x134>
or     $0x1,%r12d
mov    %r15,%rdi
lea    0xcf6(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     132a <main+0x15a>
mov    %r15,%rdi
lea    0xce2(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
jne    132e <main+0x15e>
or     $0x2,%r12d
mov    %r15,%rdi
lea    0xccf(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     1354 <main+0x184>
mov    %r15,%rdi
lea    0xcbb(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
jne    1358 <main+0x188>
or     $0x4,%r12d
mov    %r15,%rdi
lea    0xca8(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     137e <main+0x1ae>
mov    %r15,%rdi
lea    0xc94(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
jne    1382 <main+0x1b2>
or     $0x8,%r12d
mov    %r15,%rdi
mov    %r14,%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     12c0 <main+0xf0>
mov    %r15,%rdi
lea    0xc6d(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
jne    12c8 <main+0xf8>
jmp    12c0 <main+0xf0>
mov    0x20(%rsp),%rdi
call   10f0 <parse_and_create_plant@plt>
test   %rax,%rax
je     14c2 <main+0x2f2>
mov    %rax,%rbp
mov    %r12d,%r14d
and    $0x2,%r14d
lea    0x18(%rsp),%r15
lea    0x10(%rsp),%r13
jmp    13f6 <main+0x226>
nopw   0x0(%rax,%rax,1)
mov    0x20(%rsp),%rdi
call   10f0 <parse_and_create_plant@plt>
mov    %rax,%rbp
test   %rax,%rax
je     14c9 <main+0x2f9>
mov    %rbp,%rdi
call   1070 <calculate_plant_dates@plt>
test   $0x1,%r12b
je     1420 <main+0x250>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbp,%rdi
call   1080 <print_action_dates@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
je     1452 <main+0x282>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x1,%edx
call   10b0 <add_indoor_plant_dates_to_list@plt>
mov    $0xffffffff,%ebx
test   %eax,%eax
je     14b1 <main+0x2e1>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x1,%edx
call   10c0 <add_direct_sown_plant_dates_to_list@plt>
test   %eax,%eax
je     14b1 <main+0x2e1>
test   $0x8,%r12b
je     147f <main+0x2af>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   10b0 <add_indoor_plant_dates_to_list@plt>
mov    $0xffffffff,%ebx
test   %eax,%eax
je     14b1 <main+0x2e1>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   10c0 <add_direct_sown_plant_dates_to_list@plt>
test   %eax,%eax
je     14b1 <main+0x2e1>
test   $0x4,%r12b
je     13e0 <main+0x210>
mov    %rbp,%rdi
lea    0x8(%rsp),%rsi
call   1090 <add_harvest_dates_to_list@plt>
test   %eax,%eax
jne    13e0 <main+0x210>
jmp    14ac <main+0x2dc>
lea    0xbb7(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12d,%r14d
and    $0x2,%r14d
mov    0x4(%rsp),%ebp
test   %r14d,%r14d
je     14e0 <main+0x310>
test   %ebp,%ebp
je     14fd <main+0x32d>
mov    0x10(%rsp),%rdi
call   10d0 <make_icalendar@plt>
test   $0x8,%r12b
je     1586 <main+0x3b6>
test   %ebp,%ebp
je     153e <main+0x36e>
mov    0x18(%rsp),%rdi
call   10d0 <make_icalendar@plt>
jmp    1586 <main+0x3b6>
lea    0xb0b(%rip),%rdi
call   1050 <printf@plt>
cmp    $0x4,%eax
jb     1522 <main+0x352>
mov    %eax,%ebx
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     1510 <main+0x340>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%rdi
call   1060 <print_by_month_calendar@plt>
test   $0x8,%r12b
jne    14ea <main+0x31a>
jmp    1586 <main+0x3b6>
lea    0xaea(%rip),%rdi
call   1050 <printf@plt>
cmp    $0x4,%eax
jb     1572 <main+0x3a2>
mov    %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     1560 <main+0x390>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%rdi
call   1060 <print_by_month_calendar@plt>
xor    %ebx,%ebx
test   $0x4,%r12b
je     14b1 <main+0x2e1>
test   %ebp,%ebp
je     15a5 <main+0x3d5>
mov    0x8(%rsp),%rdi
call   10d0 <make_icalendar@plt>
jmp    14b1 <main+0x2e1>
lea    0xa9e(%rip),%rdi
call   1050 <printf@plt>
cmp    $0x4,%eax
jb     15d2 <main+0x402>
mov    %eax,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x3,%ebp
ja     15c0 <main+0x3f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%rdi
call   1060 <print_by_month_calendar@plt>
jmp    14b1 <main+0x2e1>

LLVM IR (-O0):
%struct.plant = type { i32 }
%struct.date_list = type { i32 }
@.str = [47 x i8] c"Help: plant <file> [output type] [options]...\0A\00"
@.str.1 = [29 x i8] c"Where [output type] can be:\0A\00"
@.str.2 = [29 x i8] c" p for a by-plant calendar\0A\00"
@.str.3 = [29 x i8] c" m for a by-month calendar\0A\00"
@.str.4 = [28 x i8] c" h for a harvest calendar\0A\00"
@.str.5 = [35 x i8] c" s for a seed sprouting calendar\0A\00"
@.str.6 = [25 x i8] c"Where [options] can be:\0A\00"
@.str.7 = [46 x i8] c" i to use ical format instead of plain text\0A\00"
@.str.8 = [2 x i8] c"r\00"
@.str.9 = [11 x i8] c"Bad file.\0A\00"
@.str.10 = [2 x i8] c"p\00"
@.str.11 = [3 x i8] c"-p\00"
@.str.12 = [2 x i8] c"m\00"
@.str.13 = [3 x i8] c"-m\00"
@.str.14 = [2 x i8] c"h\00"
@.str.15 = [3 x i8] c"-h\00"
@.str.16 = [2 x i8] c"s\00"
@.str.17 = [3 x i8] c"-s\00"
@.str.18 = [2 x i8] c"i\00"
@.str.19 = [3 x i8] c"-i\00"
@.str.20 = [2 x i8] c"\0A\00"
@.str.21 = [32 x i8] c"\0A\0AGarden Action Items Calendar\0A\00"
@.str.22 = [27 x i8] c"\0A\0ASeed Sprouting Calendar\0A\00"
@.str.23 = [20 x i8] c"\0A\0AHarvest Calendar\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca %struct.plant*
%8 = alloca %struct.date_list*
%9 = alloca %struct.date_list*
%10 = alloca %struct.date_list*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.date_list* null, %struct.date_list** %8
store %struct.date_list* null, %struct.date_list** %9
store %struct.date_list* null, %struct.date_list** %10
store i32 0, i32* %12
store i32 0, i32* %14
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %26
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %3
br label %277
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %30, i32** %6
%31 = load i32*, i32** %6
%32 = icmp ne i32* %31, null
br i1 %32, label %35, label %33
33: ; preds = %26
%34 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
store i32 -1, i32* %3
br label %277
35: ; preds = %26
store i32 2, i32* %13
br label %36
36: ; preds = %139, %35
%37 = load i32, i32* %13
%38 = icmp slt i32 %37, 6
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = load i32, i32* %13
%41 = load i32, i32* %4
%42 = icmp slt i32 %40, %41
br label %43
43: ; preds = %39, %36
%44 = phi i1 [ false, %36 ], [ %42, %39 ]
br i1 %44, label %45, label %142
45: ; preds = %43
%46 = load i8**, i8*** %5
%47 = load i32, i32* %13
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %46, i64 %48
%50 = load i8*, i8** %49
%51 = call i32 @strcmp(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %61
53: ; preds = %45
%54 = load i8**, i8*** %5
%55 = load i32, i32* %13
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8*, i8** %54, i64 %56
%58 = load i8*, i8** %57
%59 = call i32 @strcmp(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%60 = icmp ne i32 %59, 0
br i1 %60, label %64, label %61
61: ; preds = %53, %45
%62 = load i32, i32* %12
%63 = or i32 %62, 1
store i32 %63, i32* %12
br label %64
64: ; preds = %61, %53
%65 = load i8**, i8*** %5
%66 = load i32, i32* %13
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %65, i64 %67
%69 = load i8*, i8** %68
%70 = call i32 @strcmp(i8* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %80
72: ; preds = %64
%73 = load i8**, i8*** %5
%74 = load i32, i32* %13
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
%77 = load i8*, i8** %76
%78 = call i32 @strcmp(i8* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%79 = icmp ne i32 %78, 0
br i1 %79, label %83, label %80
80: ; preds = %72, %64
%81 = load i32, i32* %12
%82 = or i32 %81, 2
store i32 %82, i32* %12
br label %83
83: ; preds = %80, %72
%84 = load i8**, i8*** %5
%85 = load i32, i32* %13
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8*, i8** %84, i64 %86
%88 = load i8*, i8** %87
%89 = call i32 @strcmp(i8* %88, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %99
91: ; preds = %83
%92 = load i8**, i8*** %5
%93 = load i32, i32* %13
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8*, i8** %92, i64 %94
%96 = load i8*, i8** %95
%97 = call i32 @strcmp(i8* %96, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%98 = icmp ne i32 %97, 0
br i1 %98, label %102, label %99
99: ; preds = %91, %83
%100 = load i32, i32* %12
%101 = or i32 %100, 4
store i32 %101, i32* %12
br label %102
102: ; preds = %99, %91
%103 = load i8**, i8*** %5
%104 = load i32, i32* %13
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = load i8*, i8** %106
%108 = call i32 @strcmp(i8* %107, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %118
110: ; preds = %102
%111 = load i8**, i8*** %5
%112 = load i32, i32* %13
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8*, i8** %111, i64 %113
%115 = load i8*, i8** %114
%116 = call i32 @strcmp(i8* %115, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%117 = icmp ne i32 %116, 0
br i1 %117, label %121, label %118
118: ; preds = %110, %102
%119 = load i32, i32* %12
%120 = or i32 %119, 8
store i32 %120, i32* %12
br label %121
121: ; preds = %118, %110
%122 = load i8**, i8*** %5
%123 = load i32, i32* %13
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8*, i8** %122, i64 %124
%126 = load i8*, i8** %125
%127 = call i32 @strcmp(i8* %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %137
129: ; preds = %121
%130 = load i8**, i8*** %5
%131 = load i32, i32* %13
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8*, i8** %130, i64 %132
%134 = load i8*, i8** %133
%135 = call i32 @strcmp(i8* %134, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
%136 = icmp ne i32 %135, 0
br i1 %136, label %138, label %137
137: ; preds = %129, %121
store i32 1, i32* %14
br label %138
138: ; preds = %137, %129
br label %139
139: ; preds = %138
%140 = load i32, i32* %13
%141 = add nsw i32 %140, 1
store i32 %141, i32* %13
br label %36
142: ; preds = %43
br label %143
143: ; preds = %142, %200
%144 = load i32*, i32** %6
%145 = call %struct.plant* @parse_and_create_plant(i32* %144)
store %struct.plant* %145, %struct.plant** %7
%146 = load %struct.plant*, %struct.plant** %7
%147 = icmp ne %struct.plant* %146, null
br i1 %147, label %149, label %148
148: ; preds = %143
br label %201
149: ; preds = %143
%150 = load %struct.plant*, %struct.plant** %7
%151 = call i32 @calculate_plant_dates(%struct.plant* %150)
%152 = load i32, i32* %12
%153 = and i32 %152, 1
%154 = icmp ne i32 %153, 0
br i1 %154, label %155, label %160
155: ; preds = %149
%156 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%157 = load %struct.plant*, %struct.plant** %7
%158 = call i32 @print_action_dates(%struct.plant* %157)
%159 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
br label %160
160: ; preds = %155, %149
%161 = load i32, i32* %12
%162 = and i32 %161, 2
%163 = icmp ne i32 %162, 0
br i1 %163, label %164, label %175
164: ; preds = %160
%165 = load %struct.plant*, %struct.plant** %7
%166 = call i32 @add_indoor_plant_dates_to_list(%struct.plant* %165, %struct.date_list** %9, i32 1)
%167 = icmp ne i32 %166, 0
br i1 %167, label %169, label %168
168: ; preds = %164
store i32 -1, i32* %3
br label %277
169: ; preds = %164
%170 = load %struct.plant*, %struct.plant** %7
%171 = call i32 @add_direct_sown_plant_dates_to_list(%struct.plant* %170, %struct.date_list** %9, i32 1)
%172 = icmp ne i32 %171, 0
br i1 %172, label %174, label %173
173: ; preds = %169
store i32 -1, i32* %3
br label %277
174: ; preds = %169
br label %175
175: ; preds = %174, %160
%176 = load i32, i32* %12
%177 = and i32 %176, 8
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %190
179: ; preds = %175
%180 = load %struct.plant*, %struct.plant** %7
%181 = call i32 @add_indoor_plant_dates_to_list(%struct.plant* %180, %struct.date_list** %8, i32 0)
%182 = icmp ne i32 %181, 0
br i1 %182, label %184, label %183
183: ; preds = %179
store i32 -1, i32* %3
br label %277
184: ; preds = %179
%185 = load %struct.plant*, %struct.plant** %7
%186 = call i32 @add_direct_sown_plant_dates_to_list(%struct.plant* %185, %struct.date_list** %8, i32 0)
%187 = icmp ne i32 %186, 0
br i1 %187, label %189, label %188
188: ; preds = %184
store i32 -1, i32* %3
br label %277
189: ; preds = %184
br label %190
190: ; preds = %189, %175
%191 = load i32, i32* %12
%192 = and i32 %191, 4
%193 = icmp ne i32 %192, 0
br i1 %193, label %194, label %200
194: ; preds = %190
%195 = load %struct.plant*, %struct.plant** %7
%196 = call i32 @add_harvest_dates_to_list(%struct.plant* %195, %struct.date_list** %10)
%197 = icmp ne i32 %196, 0
br i1 %197, label %199, label %198
198: ; preds = %194
store i32 -1, i32* %3
br label %277
199: ; preds = %194
br label %200
200: ; preds = %199, %190
br label %143
201: ; preds = %148
%202 = load i32, i32* %12
%203 = and i32 %202, 2
%204 = icmp ne i32 %203, 0
br i1 %204, label %205, label %226
205: ; preds = %201
%206 = load i32, i32* %14
%207 = icmp ne i32 %206, 0
br i1 %207, label %208, label %211
208: ; preds = %205
%209 = load %struct.date_list*, %struct.date_list** %9
%210 = call i32 @make_icalendar(%struct.date_list* %209)
br label %225
211: ; preds = %205
%212 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.21, i64 0, i64 0))
store i32 %212, i32* %11
br label %213
213: ; preds = %218, %211
%214 = load i32, i32* %11
%215 = icmp ugt i32 %214, 3
br i1 %215, label %216, label %221
216: ; preds = %213
%217 = call i32 @putchar(i8 signext 42)
br label %218
218: ; preds = %216
%219 = load i32, i32* %11
%220 = add i32 %219, -1
store i32 %220, i32* %11
br label %213
221: ; preds = %213
%222 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%223 = load %struct.date_list*, %struct.date_list** %9
%224 = call i32 @print_by_month_calendar(%struct.date_list* %223)
br label %225
225: ; preds = %221, %208
br label %226
226: ; preds = %225, %201
%227 = load i32, i32* %12
%228 = and i32 %227, 8
%229 = icmp ne i32 %228, 0
br i1 %229, label %230, label %251
230: ; preds = %226
%231 = load i32, i32* %14
%232 = icmp ne i32 %231, 0
br i1 %232, label %233, label %236
233: ; preds = %230
%234 = load %struct.date_list*, %struct.date_list** %8
%235 = call i32 @make_icalendar(%struct.date_list* %234)
br label %250
236: ; preds = %230
%237 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.22, i64 0, i64 0))
store i32 %237, i32* %11
br label %238
238: ; preds = %243, %236
%239 = load i32, i32* %11
%240 = icmp ugt i32 %239, 3
br i1 %240, label %241, label %246
241: ; preds = %238
%242 = call i32 @putchar(i8 signext 42)
br label %243
243: ; preds = %241
%244 = load i32, i32* %11
%245 = add i32 %244, -1
store i32 %245, i32* %11
br label %238
246: ; preds = %238
%247 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%248 = load %struct.date_list*, %struct.date_list** %8
%249 = call i32 @print_by_month_calendar(%struct.date_list* %248)
br label %250
250: ; preds = %246, %233
br label %251
251: ; preds = %250, %226
%252 = load i32, i32* %12
%253 = and i32 %252, 4
%254 = icmp ne i32 %253, 0
br i1 %254, label %255, label %276
255: ; preds = %251
%256 = load i32, i32* %14
%257 = icmp ne i32 %256, 0
br i1 %257, label %258, label %261
258: ; preds = %255
%259 = load %struct.date_list*, %struct.date_list** %10
%260 = call i32 @make_icalendar(%struct.date_list* %259)
br label %275
261: ; preds = %255
%262 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0))
store i32 %262, i32* %11
br label %263
263: ; preds = %268, %261
%264 = load i32, i32* %11
%265 = icmp ugt i32 %264, 3
br i1 %265, label %266, label %271
266: ; preds = %263
%267 = call i32 @putchar(i8 signext 42)
br label %268
268: ; preds = %266
%269 = load i32, i32* %11
%270 = add i32 %269, -1
store i32 %270, i32* %11
br label %263
271: ; preds = %263
%272 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%273 = load %struct.date_list*, %struct.date_list** %10
%274 = call i32 @print_by_month_calendar(%struct.date_list* %273)
br label %275
275: ; preds = %271, %258
br label %276
276: ; preds = %275, %251
store i32 0, i32* %3
br label %277
277: ; preds = %276, %198, %188, %183, %173, %168, %33, %17
%278 = load i32, i32* %3
ret i32 %278
}

LLVM IR (-O2):
%struct.date_list = type { i32 }
%struct.plant = type { i32 }
@.str.8 = [2 x i8] c"r\00"
@.str.10 = [2 x i8] c"p\00"
@.str.11 = [3 x i8] c"-p\00"
@.str.12 = [2 x i8] c"m\00"
@.str.13 = [3 x i8] c"-m\00"
@.str.14 = [2 x i8] c"h\00"
@.str.15 = [3 x i8] c"-h\00"
@.str.16 = [2 x i8] c"s\00"
@.str.17 = [3 x i8] c"-s\00"
@.str.18 = [2 x i8] c"i\00"
@.str.19 = [3 x i8] c"-i\00"
@.str.21 = [32 x i8] c"\0A\0AGarden Action Items Calendar\0A\00"
@.str.22 = [27 x i8] c"\0A\0ASeed Sprouting Calendar\0A\00"
@.str.23 = [20 x i8] c"\0A\0AHarvest Calendar\0A\00"
@str = [10 x i8] c"Bad file.\00"
@str.24 = [46 x i8] c"Help: plant <file> [output type] [options]...\00"
@str.25 = [28 x i8] c"Where [output type] can be:\00"
@str.26 = [28 x i8] c" p for a by-plant calendar\00"
@str.27 = [28 x i8] c" m for a by-month calendar\00"
@str.28 = [27 x i8] c" h for a harvest calendar\00"
@str.29 = [34 x i8] c" s for a seed sprouting calendar\00"
@str.30 = [24 x i8] c"Where [options] can be:\00"
@str.31 = [45 x i8] c" i to use ical format instead of plain text\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.date_list*
%4 = alloca %struct.date_list*
%5 = alloca %struct.date_list*
%6 = bitcast %struct.date_list** %3 to i8*
store %struct.date_list* null, %struct.date_list** %3
%7 = bitcast %struct.date_list** %4 to i8*
store %struct.date_list* null, %struct.date_list** %4
%8 = bitcast %struct.date_list** %5 to i8*
store %struct.date_list* null, %struct.date_list** %5
%9 = icmp slt i32 %0, 2
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.24, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.25, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.26, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.27, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.28, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.29, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.30, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.31, i64 0, i64 0))
br label %189
19: ; preds = %2
%20 = getelementptr inbounds i8*, i8** %1, i64 1
%21 = load i8*, i8** %20
%22 = tail call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %31, label %24
24: ; preds = %19
%25 = icmp ugt i32 %0, 2
br i1 %25, label %26, label %33
26: ; preds = %24
%27 = add nsw i32 %0, -3
%28 = call i32 @llvm.umin.i32(i32 %27, i32 3)
%29 = add nuw nsw i32 %28, 3
%30 = zext i32 %29 to i64
br label %49
31: ; preds = %19
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %189
33: ; preds = %97, %24
%34 = phi i32 [ 0, %24 ], [ %90, %97 ]
%35 = phi i32 [ 0, %24 ], [ %98, %97 ]
%36 = call %struct.plant* @parse_and_create_plant(i32* %22)
%37 = icmp eq %struct.plant* %36, null
br i1 %37, label %38, label %40
38: ; preds = %33
%39 = and i32 %34, 2
br label %129
40: ; preds = %33
%41 = and i32 %34, 1
%42 = icmp eq i32 %41, 0
%43 = and i32 %34, 2
%44 = icmp eq i32 %43, 0
%45 = and i32 %34, 8
%46 = icmp eq i32 %45, 0
%47 = and i32 %34, 4
%48 = icmp eq i32 %47, 0
br label %101
49: ; preds = %26, %97
%50 = phi i64 [ 2, %26 ], [ %99, %97 ]
%51 = phi i32 [ 0, %26 ], [ %98, %97 ]
%52 = phi i32 [ 0, %26 ], [ %90, %97 ]
%53 = getelementptr inbounds i8*, i8** %1, i64 %50
%54 = load i8*, i8** %53
%55 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%56 = icmp eq i32 %55, 0
br i1 %56, label %60, label %57
57: ; preds = %49
%58 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %57, %49
%61 = or i32 %52, 1
br label %62
62: ; preds = %60, %57
%63 = phi i32 [ %52, %57 ], [ %61, %60 ]
%64 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%65 = icmp eq i32 %64, 0
br i1 %65, label %69, label %66
66: ; preds = %62
%67 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %66, %62
%70 = or i32 %63, 2
br label %71
71: ; preds = %69, %66
%72 = phi i32 [ %63, %66 ], [ %70, %69 ]
%73 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%74 = icmp eq i32 %73, 0
br i1 %74, label %78, label %75
75: ; preds = %71
%76 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %75, %71
%79 = or i32 %72, 4
br label %80
80: ; preds = %78, %75
%81 = phi i32 [ %72, %75 ], [ %79, %78 ]
%82 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%83 = icmp eq i32 %82, 0
br i1 %83, label %87, label %84
84: ; preds = %80
%85 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%86 = icmp eq i32 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %84, %80
%88 = or i32 %81, 8
br label %89
89: ; preds = %87, %84
%90 = phi i32 [ %81, %84 ], [ %88, %87 ]
%91 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%92 = icmp eq i32 %91, 0
br i1 %92, label %96, label %93
93: ; preds = %89
%94 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
%95 = icmp eq i32 %94, 0
br i1 %95, label %96, label %97
96: ; preds = %93, %89
br label %97
97: ; preds = %93, %96
%98 = phi i32 [ %51, %93 ], [ 1, %96 ]
%99 = add nuw nsw i64 %50, 1
%100 = icmp eq i64 %99, %30
br i1 %100, label %33, label %49
101: ; preds = %40, %126
%102 = phi %struct.plant* [ %36, %40 ], [ %127, %126 ]
%103 = call i32 @calculate_plant_dates(%struct.plant* %102)
br i1 %42, label %108, label %104
104: ; preds = %101
%105 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%106 = call i32 @print_action_dates(%struct.plant* %102)
%107 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
br label %108
108: ; preds = %104, %101
br i1 %44, label %115, label %109
109: ; preds = %108
%110 = call i32 @add_indoor_plant_dates_to_list(%struct.plant* %102, %struct.date_list** %4, i32 1)
%111 = icmp eq i32 %110, 0
br i1 %111, label %189, label %112
112: ; preds = %109
%113 = call i32 @add_direct_sown_plant_dates_to_list(%struct.plant* %102, %struct.date_list** %4, i32 1)
%114 = icmp eq i32 %113, 0
br i1 %114, label %189, label %115
115: ; preds = %112, %108
br i1 %46, label %122, label %116
116: ; preds = %115
%117 = call i32 @add_indoor_plant_dates_to_list(%struct.plant* %102, %struct.date_list** %3, i32 0)
%118 = icmp eq i32 %117, 0
br i1 %118, label %189, label %119
119: ; preds = %116
%120 = call i32 @add_direct_sown_plant_dates_to_list(%struct.plant* %102, %struct.date_list** %3, i32 0)
%121 = icmp eq i32 %120, 0
br i1 %121, label %189, label %122
122: ; preds = %119, %115
br i1 %48, label %126, label %123
123: ; preds = %122
%124 = call i32 @add_harvest_dates_to_list(%struct.plant* %102, %struct.date_list** %5)
%125 = icmp eq i32 %124, 0
br i1 %125, label %189, label %126
126: ; preds = %123, %122
%127 = call %struct.plant* @parse_and_create_plant(i32* %22)
%128 = icmp eq %struct.plant* %127, null
br i1 %128, label %129, label %101
129: ; preds = %126, %38
%130 = phi i32 [ %39, %38 ], [ %43, %126 ]
%131 = icmp eq i32 %130, 0
br i1 %131, label %149, label %132
132: ; preds = %129
%133 = icmp eq i32 %35, 0
br i1 %133, label %137, label %134
134: ; preds = %132
%135 = load %struct.date_list*, %struct.date_list** %4
%136 = call i32 @make_icalendar(%struct.date_list* %135)
br label %149
137: ; preds = %132
%138 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.21, i64 0, i64 0))
%139 = icmp ugt i32 %138, 3
br i1 %139, label %140, label %145
140: ; preds = %137, %140
%141 = phi i32 [ %143, %140 ], [ %138, %137 ]
%142 = call i32 @putchar(i8 signext 42)
%143 = add i32 %141, -1
%144 = icmp ugt i32 %143, 3
br i1 %144, label %140, label %145
145: ; preds = %140, %137
%146 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%147 = load %struct.date_list*, %struct.date_list** %4
%148 = call i32 @print_by_month_calendar(%struct.date_list* %147)
br label %149
149: ; preds = %134, %145, %129
%150 = and i32 %34, 8
%151 = icmp eq i32 %150, 0
br i1 %151, label %169, label %152
152: ; preds = %149
%153 = icmp eq i32 %35, 0
br i1 %153, label %157, label %154
154: ; preds = %152
%155 = load %struct.date_list*, %struct.date_list** %3
%156 = call i32 @make_icalendar(%struct.date_list* %155)
br label %169
157: ; preds = %152
%158 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.22, i64 0, i64 0))
%159 = icmp ugt i32 %158, 3
br i1 %159, label %160, label %165
160: ; preds = %157, %160
%161 = phi i32 [ %163, %160 ], [ %158, %157 ]
%162 = call i32 @putchar(i8 signext 42)
%163 = add i32 %161, -1
%164 = icmp ugt i32 %163, 3
br i1 %164, label %160, label %165
165: ; preds = %160, %157
%166 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%167 = load %struct.date_list*, %struct.date_list** %3
%168 = call i32 @print_by_month_calendar(%struct.date_list* %167)
br label %169
169: ; preds = %154, %165, %149
%170 = and i32 %34, 4
%171 = icmp eq i32 %170, 0
br i1 %171, label %189, label %172
172: ; preds = %169
%173 = icmp eq i32 %35, 0
br i1 %173, label %177, label %174
174: ; preds = %172
%175 = load %struct.date_list*, %struct.date_list** %5
%176 = call i32 @make_icalendar(%struct.date_list* %175)
br label %189
177: ; preds = %172
%178 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0))
%179 = icmp ugt i32 %178, 3
br i1 %179, label %180, label %185
180: ; preds = %177, %180
%181 = phi i32 [ %183, %180 ], [ %178, %177 ]
%182 = call i32 @putchar(i8 signext 42)
%183 = add i32 %181, -1
%184 = icmp ugt i32 %183, 3
br i1 %184, label %180, label %185
185: ; preds = %180, %177
%186 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%187 = load %struct.date_list*, %struct.date_list** %5
%188 = call i32 @print_by_month_calendar(%struct.date_list* %187)
br label %189
189: ; preds = %123, %119, %116, %112, %109, %169, %185, %174, %31, %10
%190 = phi i32 [ -1, %10 ], [ -1, %31 ], [ 0, %174 ], [ 0, %185 ], [ 0, %169 ], [ -1, %109 ], [ -1, %112 ], [ -1, %116 ], [ -1, %119 ], [ -1, %123 ]
ret i32 %190
}