#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 *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int i, department_date, arrived_date;
  int sport_shoes = 0, boots = 0, flipflop = 0;
  do {
    scanf("%d %d", &department_date, &arrived_date);
    if (arrived_date < 31 && department_date <= arrived_date &&
        department_date > 0) {
      for (i = department_date; i <= arrived_date; i++) {
        if (i % 9 == 0) {
          boots += 3;
        } else {
          if (i % 2 == 0) {
            flipflop += 1;
            sport_shoes += 2;
          } else {
            sport_shoes += 3;
          }
        }
      }
      printf("sport shoe %d\n", sport_shoes);
      printf("boots %d\n", boots);
      printf("flipflop %d\n", flipflop);
      break;
    } else {
      printf("Date Error\n");
    }
  } while (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x1f,-0x10(%rbp)
jge    1230 <main+0x110>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1230 <main+0x110>
cmpl   $0x0,-0xc(%rbp)
jle    1230 <main+0x110>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11f8 <main+0xd8>
mov    -0x8(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ac <main+0x8c>
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    11e5 <main+0xc5>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11d7 <main+0xb7>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    11e0 <main+0xc0>
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    11e5 <main+0xc5>
jmp    11ea <main+0xca>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <main+0x5e>
mov    -0x14(%rbp),%esi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1252 <main+0x132>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1243 <main+0x123>
mov    $0x1,%al
test   $0x1,%al
jne    1144 <main+0x24>
jmp    1252 <main+0x132>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%rbx
lea    0xedf(%rip),%rbp
jmp    1158 <main+0x28>
nop
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%eax
cmp    $0x1e,%eax
jg     1150 <main+0x20>
mov    0x4(%rsp),%ecx
cmp    %eax,%ecx
jg     1150 <main+0x20>
test   %ecx,%ecx
jle    1150 <main+0x20>
add    $0x1,%eax
xor    %ebx,%ebx
xor    %ebp,%ebp
xor    %esi,%esi
jmp    119a <main+0x6a>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x3,%ebp
add    $0x1,%ecx
cmp    %ecx,%eax
je     11c5 <main+0x95>
imul   $0x38e38e39,%ecx,%edx
add    $0xe38e38e,%edx
cmp    $0x1c71c71c,%edx
jbe    1190 <main+0x60>
test   $0x1,%cl
jne    11c0 <main+0x90>
add    $0x1,%ebx
add    $0x2,%esi
jmp    1193 <main+0x63>
nopl   0x0(%rax,%rax,1)
add    $0x3,%esi
jmp    1193 <main+0x63>
lea    0xe3a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe3b(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe35(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [15 x i8] c"sport shoe %d\0A\00"
@.str.2 = [10 x i8] c"boots %d\0A\00"
@.str.3 = [13 x i8] c"flipflop %d\0A\00"
@.str.4 = [12 x i8] c"Date Error\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %59, %0
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 31
br i1 %11, label %12, label %56
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %56
16: ; preds = %12
%17 = load i32, i32* %3
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %56
19: ; preds = %16
%20 = load i32, i32* %3
store i32 %20, i32* %2
br label %21
21: ; preds = %46, %19
%22 = load i32, i32* %2
%23 = load i32, i32* %4
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %49
25: ; preds = %21
%26 = load i32, i32* %2
%27 = srem i32 %26, 9
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 3
store i32 %31, i32* %6
br label %45
32: ; preds = %25
%33 = load i32, i32* %2
%34 = srem i32 %33, 2
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 2
store i32 %40, i32* %5
br label %44
41: ; preds = %32
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 3
store i32 %43, i32* %5
br label %44
44: ; preds = %41, %36
br label %45
45: ; preds = %44, %29
br label %46
46: ; preds = %45
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %21
49: ; preds = %21
%50 = load i32, i32* %5
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %6
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %7
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %54)
br label %60
56: ; preds = %16, %12, %8
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %58
58: ; preds = %56
br label %59
59: ; preds = %58
br i1 true, label %8, label %60
60: ; preds = %59, %49
%61 = load i32, i32* %1
ret i32 %61
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [15 x i8] c"sport shoe %d\0A\00"
@.str.2 = [10 x i8] c"boots %d\0A\00"
@.str.3 = [13 x i8] c"flipflop %d\0A\00"
@str = [11 x i8] c"Date Error\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %41, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 31
br i1 %8, label %9, label %41
9: ; preds = %5
%10 = load i32, i32* %1
%11 = icmp sle i32 %10, %7
%12 = icmp sgt i32 %10, 0
%13 = and i1 %11, %12
br i1 %13, label %14, label %41
14: ; preds = %9, %31
%15 = phi i32 [ %34, %31 ], [ 0, %9 ]
%16 = phi i32 [ %33, %31 ], [ 0, %9 ]
%17 = phi i32 [ %32, %31 ], [ 0, %9 ]
%18 = phi i32 [ %35, %31 ], [ %10, %9 ]
%19 = srem i32 %18, 9
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = add nsw i32 %16, 3
br label %31
23: ; preds = %14
%24 = and i32 %18, 1
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = add nsw i32 %15, 1
%28 = add nsw i32 %17, 2
br label %31
29: ; preds = %23
%30 = add nsw i32 %17, 3
br label %31
31: ; preds = %21, %29, %26
%32 = phi i32 [ %17, %21 ], [ %28, %26 ], [ %30, %29 ]
%33 = phi i32 [ %22, %21 ], [ %16, %26 ], [ %16, %29 ]
%34 = phi i32 [ %15, %21 ], [ %27, %26 ], [ %15, %29 ]
%35 = add i32 %18, 1
%36 = icmp eq i32 %18, %7
br i1 %36, label %37, label %14
37: ; preds = %31
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %34)
ret i32 0
41: ; preds = %9, %5
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %5
}