#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*/ sleep(int);
int main() {
  int h = 567;
  int l = 43;
  float ratio = 567 / 43;
  while (1) {
    for (int i = (h - (int)(ratio * l)); i >= 0; i--) {
      h--;
    }
    l--;
    printf("%d,%d\n", l, h);
    sleep(0.2);
    if (l == 0) {
      printf("Done!\n");
      sleep(120);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x237,-0x8(%rbp)
movl   $0x2b,-0xc(%rbp)
movss  0xebb(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1185 <main+0x65>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <main+0x44>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <sleep@plt>
cmpl   $0x0,-0xc(%rbp)
jne    11cb <main+0xab>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x78,%edi
call   1040 <sleep@plt>
jmp    114a <main+0x2a>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x237,%ebp
mov    $0x2a,%ebx
lea    0xebc(%rip),%r14
lea    0xebc(%rip),%r15
nop
lea    0x1(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mov    %ebp,%eax
mulss  0xe9c(%rip),%xmm0
cvttss2si %xmm0,%ecx
lea    -0x1(%rcx),%ebp
cmp    %ecx,%eax
cmovl  %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <sleep@plt>
sub    $0x1,%ebx
jae    1150 <main+0x20>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    $0x78,%edi
call   1050 <sleep@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [7 x i8] c"%d,%d\0A\00"
@.str.1 = [7 x i8] c"Done!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %1
store i32 567, i32* %2
store i32 43, i32* %3
store float 1.300000e+01, float* %4
br label %6
6: ; preds = %0, %35
%7 = load i32, i32* %2
%8 = load float, float* %4
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to float
%11 = fmul float %8, %10
%12 = fptosi float %11 to i32
%13 = sub nsw i32 %7, %12
store i32 %13, i32* %5
br label %14
14: ; preds = %20, %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %2
%19 = add nsw i32 %18, -1
store i32 %19, i32* %2
br label %20
20: ; preds = %17
%21 = load i32, i32* %5
%22 = add nsw i32 %21, -1
store i32 %22, i32* %5
br label %14
23: ; preds = %14
%24 = load i32, i32* %3
%25 = add nsw i32 %24, -1
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %26, i32 %27)
%29 = call i32 @sleep(i32 0)
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %23
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @sleep(i32 120)
br label %35
35: ; preds = %32, %23
br label %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
@str = [6 x i8] c"Done!\00"
define i32 @main() {
br label %1
1: ; preds = %17, %0
%2 = phi i32 [ 43, %0 ], [ %10, %17 ]
%3 = phi i32 [ 567, %0 ], [ %9, %17 ]
%4 = sitofp i32 %2 to float
%5 = fmul float %4, 1.300000e+01
%6 = fptosi float %5 to i32
%7 = icmp slt i32 %3, %6
%8 = add i32 %6, -1
%9 = select i1 %7, i32 %3, i32 %8
%10 = add nsw i32 %2, -1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = tail call i32 @sleep(i32 0)
%13 = icmp eq i32 %10, 0
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%16 = tail call i32 @sleep(i32 120)
br label %17
17: ; preds = %14, %1
br label %1
}