#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*/ hr20GetTimer(int, int, char *);
int /*<<< orphan*/ hr20ParseTimer(char *);
int /*<<< orphan*/ printf(char *, ...);
void hr20GetAllTimers() {
  int day, slot;
  char result[5];
  for (day = 0; day < 8; day++) {
    printf("Day   %d\n", day);
    slot = 0;
    while (1) {
      hr20GetTimer(day, slot, result);
      if (result[1] == 'f')
        break;
      printf("Slot  %d   ", slot);
      hr20ParseTimer(result);
      slot++;
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<hr20GetAllTimers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    11c6 <hr20GetAllTimers+0x96>
mov    -0x4(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xd(%rbp),%rdx
call   1040 <hr20GetTimer@plt>
movsbl -0xc(%rbp),%eax
cmp    $0x66,%eax
jne    1182 <hr20GetAllTimers+0x52>
jmp    11aa <hr20GetAllTimers+0x7a>
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xd(%rbp),%rdi
call   1050 <hr20ParseTimer@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <hr20GetAllTimers+0x31>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <hr20GetAllTimers+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hr20GetAllTimers>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xead(%rip),%r14
lea    0xb(%rsp),%r12
lea    0xeab(%rip),%r15
xor    %ebp,%ebp
jmp    1182 <hr20GetAllTimers+0x42>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x8,%ebp
je     11dc <hr20GetAllTimers+0x9c>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
xor    %esi,%esi
mov    %r12,%rdx
call   1050 <hr20GetTimer@plt>
cmpb   $0x66,0xc(%rsp)
je     1170 <hr20GetAllTimers+0x30>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
call   1060 <hr20ParseTimer@plt>
add    $0x1,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r12,%rdx
call   1050 <hr20GetTimer@plt>
cmpb   $0x66,0xc(%rsp)
jne    11b0 <hr20GetAllTimers+0x70>
jmp    1170 <hr20GetAllTimers+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Day %d\0A\00"
@.str.1 = [12 x i8] c"Slot %d \00"
define void @hr20GetAllTimers() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
br label %4
4: ; preds = %0, %18
%5 = phi i32 [ 0, %0 ], [ %20, %18 ]
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @hr20GetTimer(i32 %5, i32 0, i8* %2)
%8 = load i8, i8* %3
%9 = icmp eq i8 %8, 102
br i1 %9, label %18, label %10
10: ; preds = %4, %10
%11 = phi i32 [ %14, %10 ], [ 0, %4 ]
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @hr20ParseTimer(i8* %2)
%14 = add nuw nsw i32 %11, 1
%15 = call i32 @hr20GetTimer(i32 %5, i32 %14, i8* %2)
%16 = load i8, i8* %3
%17 = icmp eq i8 %16, 102
br i1 %17, label %18, label %10
18: ; preds = %10, %4
%19 = call i32 @putchar(i32 10)
%20 = add nuw nsw i32 %5, 1
%21 = icmp eq i32 %20, 8
br i1 %21, label %22, label %4
22: ; preds = %18
ret void
}